{"action":"created","comment":{"url":"https://api.github.com/repos/varnishcache/varnish-cache/pulls/comments/221881814","pull_request_review_id":160635096,"id":221881814,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTg4MTgxNA==","diff_hunk":"@@ -769,9 +769,77 @@ ccf_ban_list(struct cli *cli, const char * const *av, void *priv)\n \tLck_Unlock(&ban_mtx);\n }\n \n+static void v_matchproto_(cli_func_t)\n+ccf_ban_list_json(struct cli *cli, const char * const *av, void *priv)\n+{\n+\tstruct ban *b, *bl;\n+\tint64_t o;\n+\tint n = 0;\n+\tint ocs;\n+\n+\t(void)priv;\n+\n+\tLck_Lock(&ban_mtx);\n+\tbl = VTAILQ_LAST(&ban_head, banhead_s);\n+\tbl->refcount++;\n+\tLck_Unlock(&ban_mtx);\n+\n+\tVCLI_JSON_begin(cli, 2, av);\n+\tVCLI_Out(cli, \",\\n\");\n+\tVTAILQ_FOREACH(b, &ban_head, list) {\n+\t\to = bl == b ? 1 : 0;\n+\t\tVCLI_Out(cli, \"%s\", n ? \",\\n\" : \"\");\n+\t\tn++;\n+\t\tVCLI_Out(cli, \"{\\n\");\n+\t\tVSB_indent(cli->sb, 2);\n+\t\tVCLI_Out(cli, \"\\\"time\\\": %.6f,\\n\", ban_time(b->spec));\n+\t\tVCLI_Out(cli, \"\\\"refs\\\": %ju,\\n\", (intmax_t)(b->refcount - o));\n+\t\tVCLI_Out(cli, \"\\\"completed\\\": %s,\\n\",\n+\t\t\t b->flags & BANS_FLAG_COMPLETED ? \"true\" : \"false\");\n+\t\tVCLI_Out(cli, \"\\\"spec\\\": \\\"\");\n+\t\tban_render(cli, b->spec);","path":"bin/varnishd/cache/cache_ban.c","position":32,"original_position":32,"commit_id":"408eb93f26da1f009c72497484e5d6c7900fbcb0","original_commit_id":"408eb93f26da1f009c72497484e5d6c7900fbcb0","user":{"login":"slimhazard","id":6084911,"node_id":"MDQ6VXNlcjYwODQ5MTE=","avatar_url":"https://avatars0.githubusercontent.com/u/6084911?v=4","gravatar_id":"","url":"https://api.github.com/users/slimhazard","html_url":"https://github.com/slimhazard","followers_url":"https://api.github.com/users/slimhazard/followers","following_url":"https://api.github.com/users/slimhazard/following{/other_user}","gists_url":"https://api.github.com/users/slimhazard/gists{/gist_id}","starred_url":"https://api.github.com/users/slimhazard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slimhazard/subscriptions","organizations_url":"https://api.github.com/users/slimhazard/orgs","repos_url":"https://api.github.com/users/slimhazard/repos","events_url":"https://api.github.com/users/slimhazard/events{/privacy}","received_events_url":"https://api.github.com/users/slimhazard/received_events","type":"User","site_admin":false},"body":"@nigoroll none of the test outputs required it. The only thing I see in ban_render() that might require quoting is the output of the ban argument: ``VCLI_Out(cli, \"%s\", bt.arg2);`` (currently line 719 in cache_ban.c). Could that potentially contain something that needs to be quoted? (You know bans better than I do.) If you can write up an example it would help a lot, then I'd add it to the tests and write up the code.\r\n\r\nGenerally I'm trying to avoid rewriting existing code like ban_render() where possible. But if the quoting can be limited to that one line, it won't be too obtrusive","created_at":"2018-10-02T09:28:34Z","updated_at":"2018-10-02T09:28:35Z","html_url":"https://github.com/varnishcache/varnish-cache/pull/2783#discussion_r221881814","pull_request_url":"https://api.github.com/repos/varnishcache/varnish-cache/pulls/2783","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/varnishcache/varnish-cache/pulls/comments/221881814"},"html":{"href":"https://github.com/varnishcache/varnish-cache/pull/2783#discussion_r221881814"},"pull_request":{"href":"https://api.github.com/repos/varnishcache/varnish-cache/pulls/2783"}},"in_reply_to_id":221573250},"pull_request":{"url":"https://api.github.com/repos/varnishcache/varnish-cache/pulls/2783","id":217914933,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3OTE0OTMz","html_url":"https://github.com/varnishcache/varnish-cache/pull/2783","diff_url":"https://github.com/varnishcache/varnish-cache/pull/2783.diff","patch_url":"https://github.com/varnishcache/varnish-cache/pull/2783.patch","issue_url":"https://api.github.com/repos/varnishcache/varnish-cache/issues/2783","number":2783,"state":"open","locked":false,"title":"Extend JSON support in the CLI","user":{"login":"slimhazard","id":6084911,"node_id":"MDQ6VXNlcjYwODQ5MTE=","avatar_url":"https://avatars0.githubusercontent.com/u/6084911?v=4","gravatar_id":"","url":"https://api.github.com/users/slimhazard","html_url":"https://github.com/slimhazard","followers_url":"https://api.github.com/users/slimhazard/followers","following_url":"https://api.github.com/users/slimhazard/following{/other_user}","gists_url":"https://api.github.com/users/slimhazard/gists{/gist_id}","starred_url":"https://api.github.com/users/slimhazard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slimhazard/subscriptions","organizations_url":"https://api.github.com/users/slimhazard/orgs","repos_url":"https://api.github.com/users/slimhazard/repos","events_url":"https://api.github.com/users/slimhazard/events{/privacy}","received_events_url":"https://api.github.com/users/slimhazard/received_events","type":"User","site_admin":false},"body":"Adds -j forms for:\r\n* status\r\n* vcl.list\r\n* param.show\r\n* ban.list\r\n* storage.list\r\n* panic.show\r\n\r\nAnd updates docs.","created_at":"2018-09-25T09:38:36Z","updated_at":"2018-10-02T09:28:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05651f772b5558630da2b4740416f0a82c538a57","assignee":null,"assignees":[],"requested_reviewers":[{"login":"bsdphk","id":567236,"node_id":"MDQ6VXNlcjU2NzIzNg==","avatar_url":"https://avatars3.githubusercontent.com/u/567236?v=4","gravatar_id":"","url":"https://api.github.com/users/bsdphk","html_url":"https://github.com/bsdphk","followers_url":"https://api.github.com/users/bsdphk/followers","following_url":"https://api.github.com/users/bsdphk/following{/other_user}","gists_url":"https://api.github.com/users/bsdphk/gists{/gist_id}","starred_url":"https://api.github.com/users/bsdphk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsdphk/subscriptions","organizations_url":"https://api.github.com/users/bsdphk/orgs","repos_url":"https://api.github.com/users/bsdphk/repos","events_url":"https://api.github.com/users/bsdphk/events{/privacy}","received_events_url":"https://api.github.com/users/bsdphk/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/varnishcache/varnish-cache/pulls/2783/commits","review_comments_url":"https://api.github.com/repos/varnishcache/varnish-cache/pulls/2783/comments","review_comment_url":"https://api.github.com/repos/varnishcache/varnish-cache/pulls/comments{/number}","comments_url":"https://api.github.com/repos/varnishcache/varnish-cache/issues/2783/comments","statuses_url":"https://api.github.com/repos/varnishcache/varnish-cache/statuses/408eb93f26da1f009c72497484e5d6c7900fbcb0","head":{"label":"slimhazard:clijson","ref":"clijson","sha":"408eb93f26da1f009c72497484e5d6c7900fbcb0","user":{"login":"slimhazard","id":6084911,"node_id":"MDQ6VXNlcjYwODQ5MTE=","avatar_url":"https://avatars0.githubusercontent.com/u/6084911?v=4","gravatar_id":"","url":"https://api.github.com/users/slimhazard","html_url":"https://github.com/slimhazard","followers_url":"https://api.github.com/users/slimhazard/followers","following_url":"https://api.github.com/users/slimhazard/following{/other_user}","gists_url":"https://api.github.com/users/slimhazard/gists{/gist_id}","starred_url":"https://api.github.com/users/slimhazard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slimhazard/subscriptions","organizations_url":"https://api.github.com/users/slimhazard/orgs","repos_url":"https://api.github.com/users/slimhazard/repos","events_url":"https://api.github.com/users/slimhazard/events{/privacy}","received_events_url":"https://api.github.com/users/slimhazard/received_events","type":"User","site_admin":false},"repo":{"id":96760691,"node_id":"MDEwOlJlcG9zaXRvcnk5Njc2MDY5MQ==","name":"varnish-cache","full_name":"slimhazard/varnish-cache","private":false,"owner":{"login":"slimhazard","id":6084911,"node_id":"MDQ6VXNlcjYwODQ5MTE=","avatar_url":"https://avatars0.githubusercontent.com/u/6084911?v=4","gravatar_id":"","url":"https://api.github.com/users/slimhazard","html_url":"https://github.com/slimhazard","followers_url":"https://api.github.com/users/slimhazard/followers","following_url":"https://api.github.com/users/slimhazard/following{/other_user}","gists_url":"https://api.github.com/users/slimhazard/gists{/gist_id}","starred_url":"https://api.github.com/users/slimhazard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slimhazard/subscriptions","organizations_url":"https://api.github.com/users/slimhazard/orgs","repos_url":"https://api.github.com/users/slimhazard/repos","events_url":"https://api.github.com/users/slimhazard/events{/privacy}","received_events_url":"https://api.github.com/users/slimhazard/received_events","type":"User","site_admin":false},"html_url":"https://github.com/slimhazard/varnish-cache","description":"Varnish Cache source code repository","fork":true,"url":"https://api.github.com/repos/slimhazard/varnish-cache","forks_url":"https://api.github.com/repos/slimhazard/varnish-cache/forks","keys_url":"https://api.github.com/repos/slimhazard/varnish-cache/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slimhazard/varnish-cache/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slimhazard/varnish-cache/teams","hooks_url":"https://api.github.com/repos/slimhazard/varnish-cache/hooks","issue_events_url":"https://api.github.com/repos/slimhazard/varnish-cache/issues/events{/number}","events_url":"https://api.github.com/repos/slimhazard/varnish-cache/events","assignees_url":"https://api.github.com/repos/slimhazard/varnish-cache/assignees{/user}","branches_url":"https://api.github.com/repos/slimhazard/varnish-cache/branches{/branch}","tags_url":"https://api.github.com/repos/slimhazard/varnish-cache/tags","blobs_url":"https://api.github.com/repos/slimhazard/varnish-cache/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slimhazard/varnish-cache/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slimhazard/varnish-cache/git/refs{/sha}","trees_url":"https://api.github.com/repos/slimhazard/varnish-cache/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slimhazard/varnish-cache/statuses/{sha}","languages_url":"https://api.github.com/repos/slimhazard/varnish-cache/languages","stargazers_url":"https://api.github.com/repos/slimhazard/varnish-cache/stargazers","contributors_url":"https://api.github.com/repos/slimhazard/varnish-cache/contributors","subscribers_url":"https://api.github.com/repos/slimhazard/varnish-cache/subscribers","subscription_url":"https://api.github.com/repos/slimhazard/varnish-cache/subscription","commits_url":"https://api.github.com/repos/slimhazard/varnish-cache/commits{/sha}","git_commits_url":"https://api.github.com/repos/slimhazard/varnish-cache/git/commits{/sha}","comments_url":"https://api.github.com/repos/slimhazard/varnish-cache/comments{/number}","issue_comment_url":"https://api.github.com/repos/slimhazard/varnish-cache/issues/comments{/number}","contents_url":"https://api.github.com/repos/slimhazard/varnish-cache/contents/{+path}","compare_url":"https://api.github.com/repos/slimhazard/varnish-cache/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slimhazard/varnish-cache/merges","archive_url":"https://api.github.com/repos/slimhazard/varnish-cache/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slimhazard/varnish-cache/downloads","issues_url":"https://api.github.com/repos/slimhazard/varnish-cache/issues{/number}","pulls_url":"https://api.github.com/repos/slimhazard/varnish-cache/pulls{/number}","milestones_url":"https://api.github.com/repos/slimhazard/varnish-cache/milestones{/number}","notifications_url":"https://api.github.com/repos/slimhazard/varnish-cache/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slimhazard/varnish-cache/labels{/name}","releases_url":"https://api.github.com/repos/slimhazard/varnish-cache/releases{/id}","deployments_url":"https://api.github.com/repos/slimhazard/varnish-cache/deployments","created_at":"2017-07-10T09:36:33Z","updated_at":"2017-07-10T09:36:38Z","pushed_at":"2018-09-25T09:34:56Z","git_url":"git://github.com/slimhazard/varnish-cache.git","ssh_url":"git@github.com:slimhazard/varnish-cache.git","clone_url":"https://github.com/slimhazard/varnish-cache.git","svn_url":"https://github.com/slimhazard/varnish-cache","homepage":"https://www.varnish-cache.org","size":23307,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"varnishcache:master","ref":"master","sha":"97de384b2f8209d1766f57828d8ad1631f3fe51e","user":{"login":"varnishcache","id":14977495,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0OTc3NDk1","avatar_url":"https://avatars0.githubusercontent.com/u/14977495?v=4","gravatar_id":"","url":"https://api.github.com/users/varnishcache","html_url":"https://github.com/varnishcache","followers_url":"https://api.github.com/users/varnishcache/followers","following_url":"https://api.github.com/users/varnishcache/following{/other_user}","gists_url":"https://api.github.com/users/varnishcache/gists{/gist_id}","starred_url":"https://api.github.com/users/varnishcache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varnishcache/subscriptions","organizations_url":"https://api.github.com/users/varnishcache/orgs","repos_url":"https://api.github.com/users/varnishcache/repos","events_url":"https://api.github.com/users/varnishcache/events{/privacy}","received_events_url":"https://api.github.com/users/varnishcache/received_events","type":"Organization","site_admin":false},"repo":{"id":43681824,"node_id":"MDEwOlJlcG9zaXRvcnk0MzY4MTgyNA==","name":"varnish-cache","full_name":"varnishcache/varnish-cache","private":false,"owner":{"login":"varnishcache","id":14977495,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0OTc3NDk1","avatar_url":"https://avatars0.githubusercontent.com/u/14977495?v=4","gravatar_id":"","url":"https://api.github.com/users/varnishcache","html_url":"https://github.com/varnishcache","followers_url":"https://api.github.com/users/varnishcache/followers","following_url":"https://api.github.com/users/varnishcache/following{/other_user}","gists_url":"https://api.github.com/users/varnishcache/gists{/gist_id}","starred_url":"https://api.github.com/users/varnishcache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/varnishcache/subscriptions","organizations_url":"https://api.github.com/users/varnishcache/orgs","repos_url":"https://api.github.com/users/varnishcache/repos","events_url":"https://api.github.com/users/varnishcache/events{/privacy}","received_events_url":"https://api.github.com/users/varnishcache/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/varnishcache/varnish-cache","description":"Varnish Cache source code repository","fork":false,"url":"https://api.github.com/repos/varnishcache/varnish-cache","forks_url":"https://api.github.com/repos/varnishcache/varnish-cache/forks","keys_url":"https://api.github.com/repos/varnishcache/varnish-cache/keys{/key_id}","collaborators_url":"https://api.github.com/repos/varnishcache/varnish-cache/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/varnishcache/varnish-cache/teams","hooks_url":"https://api.github.com/repos/varnishcache/varnish-cache/hooks","issue_events_url":"https://api.github.com/repos/varnishcache/varnish-cache/issues/events{/number}","events_url":"https://api.github.com/repos/varnishcache/varnish-cache/events","assignees_url":"https://api.github.com/repos/varnishcache/varnish-cache/assignees{/user}","branches_url":"https://api.github.com/repos/varnishcache/varnish-cache/branches{/branch}","tags_url":"https://api.github.com/repos/varnishcache/varnish-cache/tags","blobs_url":"https://api.github.com/repos/varnishcache/varnish-cache/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/varnishcache/varnish-cache/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/varnishcache/varnish-cache/git/refs{/sha}","trees_url":"https://api.github.com/repos/varnishcache/varnish-cache/git/trees{/sha}","statuses_url":"https://api.github.com/repos/varnishcache/varnish-cache/statuses/{sha}","languages_url":"https://api.github.com/repos/varnishcache/varnish-cache/languages","stargazers_url":"https://api.github.com/repos/varnishcache/varnish-cache/stargazers","contributors_url":"https://api.github.com/repos/varnishcache/varnish-cache/contributors","subscribers_url":"https://api.github.com/repos/varnishcache/varnish-cache/subscribers","subscription_url":"https://api.github.com/repos/varnishcache/varnish-cache/subscription","commits_url":"https://api.github.com/repos/varnishcache/varnish-cache/commits{/sha}","git_commits_url":"https://api.github.com/repos/varnishcache/varnish-cache/git/commits{/sha}","comments_url":"https://api.github.com/repos/varnishcache/varnish-cache/comments{/number}","issue_comment_url":"https://api.github.com/repos/varnishcache/varnish-cache/issues/comments{/number}","contents_url":"https://api.github.com/repos/varnishcache/varnish-cache/contents/{+path}","compare_url":"https://api.github.com/repos/varnishcache/varnish-cache/compare/{base}...{head}","merges_url":"https://api.github.com/repos/varnishcache/varnish-cache/merges","archive_url":"https://api.github.com/repos/varnishcache/varnish-cache/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/varnishcache/varnish-cache/downloads","issues_url":"https://api.github.com/repos/varnishcache/varnish-cache/issues{/number}","pulls_url":"https://api.github.com/repos/varnishcache/varnish-cache/pulls{/number}","milestones_url":"https://api.github.com/repos/varnishcache/varnish-cache/milestones{/number}","notifications_url":"https://api.github.com/repos/varnishcache/varnish-cache/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/varnishcache/varnish-cache/labels{/name}","releases_url":"https://api.github.com/repos/varnishcache/varnish-cache/releases{/id}","deployments_url":"https://api.github.com/repos/varnishcache/varnish-cache/deployments","created_at":"2015-10-05T12:04:36Z","updated_at":"2018-10-01T17:32:50Z","pushed_at":"2018-10-01T09:58:21Z","git_url":"git://github.com/varnishcache/varnish-cache.git","ssh_url":"git@github.com:varnishcache/varnish-cache.git","clone_url":"https://github.com/varnishcache/varnish-cache.git","svn_url":"https://github.com/varnishcache/varnish-cache","homepage":"https://www.varnish-cache.org","size":23526,"stargazers_count":1358,"watchers_count":1358,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":181,"mirror_url":null,"archived":false,"open_issues_count":41,"license":{"key":"other","name":"NOASSERTION","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":181,"open_issues":41,"watchers":1358,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/varnishcache/varnish-cache/pulls/2783"},"html":{"href":"https://github.com/varnishcache/varnish-cache/pull/2783"},"issue":{"href":"https://api.github.com/repos/varnishcache/varnish-cache/issues/2783"},"comments":{"href":"https://api.github.com/repos/varnishcache/varnish-cache/issues/2783/comments"},"review_comments":{"href":"https://api.github.com/repos/varnishcache/varnish-cache/pulls/2783/comments"},"review_comment":{"href":"https://api.github.com/repos/varnishcache/varnish-cache/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/varnishcache/varnish-cache/pulls/2783/commits"},"statuses":{"href":"https://api.github.com/repos/varnishcache/varnish-cache/statuses/408eb93f26da1f009c72497484e5d6c7900fbcb0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"slimhazard"}}