{"action":"created","comment":{"url":"https://api.github.com/repos/apache/trafficserver/pulls/comments/78400907","id":78400907,"diff_hunk":"@@ -170,6 +170,38 @@ class UnixNetVConnection : public NetVConnection\n   /////////////////////////////////////////////////////////////////\n   UnixNetVConnection();\n \n+  int\n+  populate_protocol(char const **results, int n) const\n+  {\n+    int retval = 0;\n+    if (n > 0) {\n+      results[0] = options.get_proto_string();\n+      retval++;\n+      if (n > 1) {\n+        results[1] = options.get_family_string();\n+        retval++;\n+      }\n+    }\n+    return retval;\n+  }\n+\n+  const char *\n+  protocol_contains(const char *tag) const\n+  {\n+    const char *retval   = NULL;\n+    unsigned int tag_len = strlen(tag);\n+    const char *test_tag = options.get_proto_string();\n+    if (tag_len <= strlen(test_tag) && strncmp(tag, test_tag, tag_len) == 0) {","path":"iocore/net/P_UnixNetVConnection.h","position":25,"original_position":25,"commit_id":"9888698a880f8cc78812c3e79aba77db710ac451","original_commit_id":"9888698a880f8cc78812c3e79aba77db710ac451","user":{"login":"SolidWallOfCode","id":1545753,"avatar_url":"https://avatars.githubusercontent.com/u/1545753?v=3","gravatar_id":"","url":"https://api.github.com/users/SolidWallOfCode","html_url":"https://github.com/SolidWallOfCode","followers_url":"https://api.github.com/users/SolidWallOfCode/followers","following_url":"https://api.github.com/users/SolidWallOfCode/following{/other_user}","gists_url":"https://api.github.com/users/SolidWallOfCode/gists{/gist_id}","starred_url":"https://api.github.com/users/SolidWallOfCode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SolidWallOfCode/subscriptions","organizations_url":"https://api.github.com/users/SolidWallOfCode/orgs","repos_url":"https://api.github.com/users/SolidWallOfCode/repos","events_url":"https://api.github.com/users/SolidWallOfCode/events{/privacy}","received_events_url":"https://api.github.com/users/SolidWallOfCode/received_events","type":"User","site_admin":false},"body":"Don't need to do the `strlen`, `strncmp` will stop (and fail) if the protocol tag has a null termination.","created_at":"2016-09-12T15:59:44Z","updated_at":"2016-09-12T15:59:44Z","html_url":"https://github.com/apache/trafficserver/pull/1007#discussion_r78400907","pull_request_url":"https://api.github.com/repos/apache/trafficserver/pulls/1007","_links":{"self":{"href":"https://api.github.com/repos/apache/trafficserver/pulls/comments/78400907"},"html":{"href":"https://github.com/apache/trafficserver/pull/1007#discussion_r78400907"},"pull_request":{"href":"https://api.github.com/repos/apache/trafficserver/pulls/1007"}}},"pull_request":{"url":"https://api.github.com/repos/apache/trafficserver/pulls/1007","id":84893911,"html_url":"https://github.com/apache/trafficserver/pull/1007","diff_url":"https://github.com/apache/trafficserver/pull/1007.diff","patch_url":"https://github.com/apache/trafficserver/pull/1007.patch","issue_url":"https://api.github.com/repos/apache/trafficserver/issues/1007","number":1007,"state":"open","locked":false,"title":"TS-4703: Add API to retrieve client protocols","user":{"login":"shinrich","id":334488,"avatar_url":"https://avatars.githubusercontent.com/u/334488?v=3","gravatar_id":"","url":"https://api.github.com/users/shinrich","html_url":"https://github.com/shinrich","followers_url":"https://api.github.com/users/shinrich/followers","following_url":"https://api.github.com/users/shinrich/following{/other_user}","gists_url":"https://api.github.com/users/shinrich/gists{/gist_id}","starred_url":"https://api.github.com/users/shinrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shinrich/subscriptions","organizations_url":"https://api.github.com/users/shinrich/orgs","repos_url":"https://api.github.com/users/shinrich/repos","events_url":"https://api.github.com/users/shinrich/events{/privacy}","received_events_url":"https://api.github.com/users/shinrich/received_events","type":"User","site_admin":false},"body":"Added API's as discussed on the API review (also on the bug).\r\n\r\nAdded regression test and example plugin to exercise the options.","created_at":"2016-09-12T15:38:43Z","updated_at":"2016-09-12T15:59:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"db386c288a7c008c5aae417aac131774e2287ef3","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/apache/trafficserver/milestones/1","html_url":"https://github.com/apache/trafficserver/milestones/7.0.0","labels_url":"https://api.github.com/repos/apache/trafficserver/milestones/1/labels","id":1751566,"number":1,"title":"7.0.0","description":"","creator":{"login":"zwoop","id":202131,"avatar_url":"https://avatars.githubusercontent.com/u/202131?v=3","gravatar_id":"","url":"https://api.github.com/users/zwoop","html_url":"https://github.com/zwoop","followers_url":"https://api.github.com/users/zwoop/followers","following_url":"https://api.github.com/users/zwoop/following{/other_user}","gists_url":"https://api.github.com/users/zwoop/gists{/gist_id}","starred_url":"https://api.github.com/users/zwoop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zwoop/subscriptions","organizations_url":"https://api.github.com/users/zwoop/orgs","repos_url":"https://api.github.com/users/zwoop/repos","events_url":"https://api.github.com/users/zwoop/events{/privacy}","received_events_url":"https://api.github.com/users/zwoop/received_events","type":"User","site_admin":false},"open_issues":46,"closed_issues":263,"state":"open","created_at":"2016-05-06T14:28:01Z","updated_at":"2016-09-12T15:39:09Z","due_on":"2016-10-15T06:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/apache/trafficserver/pulls/1007/commits","review_comments_url":"https://api.github.com/repos/apache/trafficserver/pulls/1007/comments","review_comment_url":"https://api.github.com/repos/apache/trafficserver/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/trafficserver/issues/1007/comments","statuses_url":"https://api.github.com/repos/apache/trafficserver/statuses/9888698a880f8cc78812c3e79aba77db710ac451","head":{"label":"shinrich:ts-4703","ref":"ts-4703","sha":"9888698a880f8cc78812c3e79aba77db710ac451","user":{"login":"shinrich","id":334488,"avatar_url":"https://avatars.githubusercontent.com/u/334488?v=3","gravatar_id":"","url":"https://api.github.com/users/shinrich","html_url":"https://github.com/shinrich","followers_url":"https://api.github.com/users/shinrich/followers","following_url":"https://api.github.com/users/shinrich/following{/other_user}","gists_url":"https://api.github.com/users/shinrich/gists{/gist_id}","starred_url":"https://api.github.com/users/shinrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shinrich/subscriptions","organizations_url":"https://api.github.com/users/shinrich/orgs","repos_url":"https://api.github.com/users/shinrich/repos","events_url":"https://api.github.com/users/shinrich/events{/privacy}","received_events_url":"https://api.github.com/users/shinrich/received_events","type":"User","site_admin":false},"repo":{"id":22690186,"name":"trafficserver","full_name":"shinrich/trafficserver","owner":{"login":"shinrich","id":334488,"avatar_url":"https://avatars.githubusercontent.com/u/334488?v=3","gravatar_id":"","url":"https://api.github.com/users/shinrich","html_url":"https://github.com/shinrich","followers_url":"https://api.github.com/users/shinrich/followers","following_url":"https://api.github.com/users/shinrich/following{/other_user}","gists_url":"https://api.github.com/users/shinrich/gists{/gist_id}","starred_url":"https://api.github.com/users/shinrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shinrich/subscriptions","organizations_url":"https://api.github.com/users/shinrich/orgs","repos_url":"https://api.github.com/users/shinrich/repos","events_url":"https://api.github.com/users/shinrich/events{/privacy}","received_events_url":"https://api.github.com/users/shinrich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shinrich/trafficserver","description":"Mirror of Apache Traffic Server","fork":true,"url":"https://api.github.com/repos/shinrich/trafficserver","forks_url":"https://api.github.com/repos/shinrich/trafficserver/forks","keys_url":"https://api.github.com/repos/shinrich/trafficserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shinrich/trafficserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shinrich/trafficserver/teams","hooks_url":"https://api.github.com/repos/shinrich/trafficserver/hooks","issue_events_url":"https://api.github.com/repos/shinrich/trafficserver/issues/events{/number}","events_url":"https://api.github.com/repos/shinrich/trafficserver/events","assignees_url":"https://api.github.com/repos/shinrich/trafficserver/assignees{/user}","branches_url":"https://api.github.com/repos/shinrich/trafficserver/branches{/branch}","tags_url":"https://api.github.com/repos/shinrich/trafficserver/tags","blobs_url":"https://api.github.com/repos/shinrich/trafficserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shinrich/trafficserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shinrich/trafficserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/shinrich/trafficserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shinrich/trafficserver/statuses/{sha}","languages_url":"https://api.github.com/repos/shinrich/trafficserver/languages","stargazers_url":"https://api.github.com/repos/shinrich/trafficserver/stargazers","contributors_url":"https://api.github.com/repos/shinrich/trafficserver/contributors","subscribers_url":"https://api.github.com/repos/shinrich/trafficserver/subscribers","subscription_url":"https://api.github.com/repos/shinrich/trafficserver/subscription","commits_url":"https://api.github.com/repos/shinrich/trafficserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/shinrich/trafficserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/shinrich/trafficserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/shinrich/trafficserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/shinrich/trafficserver/contents/{+path}","compare_url":"https://api.github.com/repos/shinrich/trafficserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shinrich/trafficserver/merges","archive_url":"https://api.github.com/repos/shinrich/trafficserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shinrich/trafficserver/downloads","issues_url":"https://api.github.com/repos/shinrich/trafficserver/issues{/number}","pulls_url":"https://api.github.com/repos/shinrich/trafficserver/pulls{/number}","milestones_url":"https://api.github.com/repos/shinrich/trafficserver/milestones{/number}","notifications_url":"https://api.github.com/repos/shinrich/trafficserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shinrich/trafficserver/labels{/name}","releases_url":"https://api.github.com/repos/shinrich/trafficserver/releases{/id}","deployments_url":"https://api.github.com/repos/shinrich/trafficserver/deployments","created_at":"2014-08-06T16:38:05Z","updated_at":"2015-05-01T19:57:32Z","pushed_at":"2016-09-12T15:32:12Z","git_url":"git://github.com/shinrich/trafficserver.git","ssh_url":"git@github.com:shinrich/trafficserver.git","clone_url":"https://github.com/shinrich/trafficserver.git","svn_url":"https://github.com/shinrich/trafficserver","homepage":null,"size":56941,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"e1fd73b813b07bee5926da6e788fc65db5719e68","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":356066,"name":"trafficserver","full_name":"apache/trafficserver","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/trafficserver","description":"Mirror of Apache Traffic Server","fork":false,"url":"https://api.github.com/repos/apache/trafficserver","forks_url":"https://api.github.com/repos/apache/trafficserver/forks","keys_url":"https://api.github.com/repos/apache/trafficserver/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/trafficserver/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/trafficserver/teams","hooks_url":"https://api.github.com/repos/apache/trafficserver/hooks","issue_events_url":"https://api.github.com/repos/apache/trafficserver/issues/events{/number}","events_url":"https://api.github.com/repos/apache/trafficserver/events","assignees_url":"https://api.github.com/repos/apache/trafficserver/assignees{/user}","branches_url":"https://api.github.com/repos/apache/trafficserver/branches{/branch}","tags_url":"https://api.github.com/repos/apache/trafficserver/tags","blobs_url":"https://api.github.com/repos/apache/trafficserver/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/trafficserver/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/trafficserver/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/trafficserver/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/trafficserver/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/trafficserver/languages","stargazers_url":"https://api.github.com/repos/apache/trafficserver/stargazers","contributors_url":"https://api.github.com/repos/apache/trafficserver/contributors","subscribers_url":"https://api.github.com/repos/apache/trafficserver/subscribers","subscription_url":"https://api.github.com/repos/apache/trafficserver/subscription","commits_url":"https://api.github.com/repos/apache/trafficserver/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/trafficserver/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/trafficserver/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/trafficserver/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/trafficserver/contents/{+path}","compare_url":"https://api.github.com/repos/apache/trafficserver/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/trafficserver/merges","archive_url":"https://api.github.com/repos/apache/trafficserver/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/trafficserver/downloads","issues_url":"https://api.github.com/repos/apache/trafficserver/issues{/number}","pulls_url":"https://api.github.com/repos/apache/trafficserver/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/trafficserver/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/trafficserver/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/trafficserver/labels{/name}","releases_url":"https://api.github.com/repos/apache/trafficserver/releases{/id}","deployments_url":"https://api.github.com/repos/apache/trafficserver/deployments","created_at":"2009-10-31T08:00:10Z","updated_at":"2016-09-09T03:17:40Z","pushed_at":"2016-09-12T15:38:43Z","git_url":"git://github.com/apache/trafficserver.git","ssh_url":"git@github.com:apache/trafficserver.git","clone_url":"https://github.com/apache/trafficserver.git","svn_url":"https://github.com/apache/trafficserver","homepage":null,"size":68793,"stargazers_count":459,"watchers_count":459,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":366,"mirror_url":null,"open_issues_count":53,"forks":366,"open_issues":53,"watchers":459,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/trafficserver/pulls/1007"},"html":{"href":"https://github.com/apache/trafficserver/pull/1007"},"issue":{"href":"https://api.github.com/repos/apache/trafficserver/issues/1007"},"comments":{"href":"https://api.github.com/repos/apache/trafficserver/issues/1007/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/trafficserver/pulls/1007/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/trafficserver/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/trafficserver/pulls/1007/commits"},"statuses":{"href":"https://api.github.com/repos/apache/trafficserver/statuses/9888698a880f8cc78812c3e79aba77db710ac451"}}}}
{"actor":{"display_login":"SolidWallOfCode"}}