{"action":"created","comment":{"url":"https://api.github.com/repos/squid-cache/squid/pulls/comments/245273123","pull_request_review_id":189311593,"id":245273123,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTI3MzEyMw==","diff_hunk":"@@ -131,3 +131,17 @@ strListGetItem(const String * str, char del, const char **item, int *ilen, const\n     return len > 0;\n }\n \n+SBuf\n+getListMember(const String &list, const char *key, const char delimiter)","path":"src/StrList.cc","position":5,"original_position":5,"commit_id":"2c067b565ce6cc2586bb702543b57523335c7ae1","original_commit_id":"2c067b565ce6cc2586bb702543b57523335c7ae1","user":{"login":"yadij","id":9123754,"node_id":"MDQ6VXNlcjkxMjM3NTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/9123754?v=4","gravatar_id":"","url":"https://api.github.com/users/yadij","html_url":"https://github.com/yadij","followers_url":"https://api.github.com/users/yadij/followers","following_url":"https://api.github.com/users/yadij/following{/other_user}","gists_url":"https://api.github.com/users/yadij/gists{/gist_id}","starred_url":"https://api.github.com/users/yadij/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yadij/subscriptions","organizations_url":"https://api.github.com/users/yadij/orgs","repos_url":"https://api.github.com/users/yadij/repos","events_url":"https://api.github.com/users/yadij/events{/privacy}","received_events_url":"https://api.github.com/users/yadij/received_events","type":"User","site_admin":false},"body":"This code was in HttpHeader because it is tied directly to HTTP parsing semantics for MiME header fields. There are parsing tolerance criteria which we may have to add to this logic to enforce certain behaviours. So please do not move it here.\r\n\r\nThe requested change to the HttpHeader:: members should remove the need for this code to be touched at all by this PR.","created_at":"2019-01-04T11:22:40Z","updated_at":"2019-01-04T11:23:35Z","html_url":"https://github.com/squid-cache/squid/pull/342#discussion_r245273123","pull_request_url":"https://api.github.com/repos/squid-cache/squid/pulls/342","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/squid-cache/squid/pulls/comments/245273123"},"html":{"href":"https://github.com/squid-cache/squid/pull/342#discussion_r245273123"},"pull_request":{"href":"https://api.github.com/repos/squid-cache/squid/pulls/342"}}},"pull_request":{"url":"https://api.github.com/repos/squid-cache/squid/pulls/342","id":241332366,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxMzMyMzY2","html_url":"https://github.com/squid-cache/squid/pull/342","diff_url":"https://github.com/squid-cache/squid/pull/342.diff","patch_url":"https://github.com/squid-cache/squid/pull/342.patch","issue_url":"https://api.github.com/repos/squid-cache/squid/issues/342","number":342,"state":"open","locked":false,"title":"Log PROXY protocol v2 TLVs; fix PROXY protocol parsing bugs","user":{"login":"eduard-bagdasaryan","id":13069213,"node_id":"MDQ6VXNlcjEzMDY5MjEz","avatar_url":"https://avatars3.githubusercontent.com/u/13069213?v=4","gravatar_id":"","url":"https://api.github.com/users/eduard-bagdasaryan","html_url":"https://github.com/eduard-bagdasaryan","followers_url":"https://api.github.com/users/eduard-bagdasaryan/followers","following_url":"https://api.github.com/users/eduard-bagdasaryan/following{/other_user}","gists_url":"https://api.github.com/users/eduard-bagdasaryan/gists{/gist_id}","starred_url":"https://api.github.com/users/eduard-bagdasaryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduard-bagdasaryan/subscriptions","organizations_url":"https://api.github.com/users/eduard-bagdasaryan/orgs","repos_url":"https://api.github.com/users/eduard-bagdasaryan/repos","events_url":"https://api.github.com/users/eduard-bagdasaryan/events{/privacy}","received_events_url":"https://api.github.com/users/eduard-bagdasaryan/received_events","type":"User","site_admin":false},"body":"Added %proxy_protocol::>h logformat code for logging received PROXY\r\nprotocol TLV values and passing them to adaptation services and helpers.\r\nFor simplicity, this implementation treats TLV values as text and reuses\r\nthe existing HTTP header field logging interfaces. Support for binary\r\nTLV value logging can be added later if needed.\r\n\r\nAlso support logging of metadata extracted from the fixed portion of a\r\nPROXY protocol header and referenced as \"pseudo headers\": :command,\r\n:version, :src_addr, :dst_addr, :src_port, and :dst_port.\r\n\r\nAlso fixed several bugs in the old PROXY protocol v1/v2 parsing code:\r\n\r\n* Buffer overrun in ConnStateData::parseProxy2p0(). The available\r\n  local SBuf could be less than sizeof(pax), resulting in copying\r\n  excessive bytes with SBuf::rawContent().\r\n\r\n* Incorrect processing of malformed v1 messages lacking CRLF in\r\n  ConnStateData::parseProxy1p0(), which waited for more data\r\n  even if the buffer size already exceeded the maximum v1 message\r\n  size.\r\n\r\n* Incorrect processing of partial-buffered v1 messages, when only\r\n  the initial (magic) part of the message has been received. The old\r\n  code resulted with an error instead of waiting for more data in this\r\n  case.\r\n\r\n* Incorrect v1 message framing for proto=UNKNOWN messages.\r\n  The code used only LF while the protocol requires CRLF for it.\r\n    \r\n* Do not use address information from v2 message if the message\r\n  proto is UNSPEC.\r\n\r\n* Incorrect v1 magic expectations (a 6-character `PROXY ` instead of the\r\n  proper 5-character `PROXY` sequence) leading to mishandling of\r\n  non-PROXY input. For example, receiving `PROXY\\r\\n` would result in\r\n  \"need more data\" outcome (and long timeout) instead of an immediate\r\n  error.\r\n\r\nAlso eliminated code duplication in HttpHeader::getByNameListMember()\r\nand HttpHeader::getListMember(), moving the common part into a\r\nseparate getListMember() method.\r\n\r\nAlso eliminated code duplication and probably fixed a bug with applying\r\nclient_netmask parameter in ConnStateData constructor. The mask should\r\nnot be applied to localhost and IPv6 addresses but was.\r\n\r\nAlso parse PROXY protocol v2 LOCAL addresses (for logging purposes). In\r\ncompliance with the PROXY protocol specs, LOCAL addresses are still\r\nunused for connection routing.\r\n","created_at":"2018-12-28T13:20:49Z","updated_at":"2019-01-04T11:23:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"605d4e9c7ab328288a95c64d176bf2277d27d4e0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":666352303,"node_id":"MDU6TGFiZWw2NjYzNTIzMDM=","url":"https://api.github.com/repos/squid-cache/squid/labels/S-waiting-for-committer","name":"S-waiting-for-committer","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/squid-cache/squid/pulls/342/commits","review_comments_url":"https://api.github.com/repos/squid-cache/squid/pulls/342/comments","review_comment_url":"https://api.github.com/repos/squid-cache/squid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/squid-cache/squid/issues/342/comments","statuses_url":"https://api.github.com/repos/squid-cache/squid/statuses/2c067b565ce6cc2586bb702543b57523335c7ae1","head":{"label":"measurement-factory:SQUID-394-parse-v2-tlv-headers","ref":"SQUID-394-parse-v2-tlv-headers","sha":"2c067b565ce6cc2586bb702543b57523335c7ae1","user":{"login":"measurement-factory","id":5461029,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0NjEwMjk=","avatar_url":"https://avatars1.githubusercontent.com/u/5461029?v=4","gravatar_id":"","url":"https://api.github.com/users/measurement-factory","html_url":"https://github.com/measurement-factory","followers_url":"https://api.github.com/users/measurement-factory/followers","following_url":"https://api.github.com/users/measurement-factory/following{/other_user}","gists_url":"https://api.github.com/users/measurement-factory/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-factory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-factory/subscriptions","organizations_url":"https://api.github.com/users/measurement-factory/orgs","repos_url":"https://api.github.com/users/measurement-factory/repos","events_url":"https://api.github.com/users/measurement-factory/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-factory/received_events","type":"Organization","site_admin":false},"repo":{"id":97358214,"node_id":"MDEwOlJlcG9zaXRvcnk5NzM1ODIxNA==","name":"squid","full_name":"measurement-factory/squid","private":false,"owner":{"login":"measurement-factory","id":5461029,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU0NjEwMjk=","avatar_url":"https://avatars1.githubusercontent.com/u/5461029?v=4","gravatar_id":"","url":"https://api.github.com/users/measurement-factory","html_url":"https://github.com/measurement-factory","followers_url":"https://api.github.com/users/measurement-factory/followers","following_url":"https://api.github.com/users/measurement-factory/following{/other_user}","gists_url":"https://api.github.com/users/measurement-factory/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-factory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-factory/subscriptions","organizations_url":"https://api.github.com/users/measurement-factory/orgs","repos_url":"https://api.github.com/users/measurement-factory/repos","events_url":"https://api.github.com/users/measurement-factory/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-factory/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/measurement-factory/squid","description":"Squid Web Proxy Cache","fork":true,"url":"https://api.github.com/repos/measurement-factory/squid","forks_url":"https://api.github.com/repos/measurement-factory/squid/forks","keys_url":"https://api.github.com/repos/measurement-factory/squid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/measurement-factory/squid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/measurement-factory/squid/teams","hooks_url":"https://api.github.com/repos/measurement-factory/squid/hooks","issue_events_url":"https://api.github.com/repos/measurement-factory/squid/issues/events{/number}","events_url":"https://api.github.com/repos/measurement-factory/squid/events","assignees_url":"https://api.github.com/repos/measurement-factory/squid/assignees{/user}","branches_url":"https://api.github.com/repos/measurement-factory/squid/branches{/branch}","tags_url":"https://api.github.com/repos/measurement-factory/squid/tags","blobs_url":"https://api.github.com/repos/measurement-factory/squid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/measurement-factory/squid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/measurement-factory/squid/git/refs{/sha}","trees_url":"https://api.github.com/repos/measurement-factory/squid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/measurement-factory/squid/statuses/{sha}","languages_url":"https://api.github.com/repos/measurement-factory/squid/languages","stargazers_url":"https://api.github.com/repos/measurement-factory/squid/stargazers","contributors_url":"https://api.github.com/repos/measurement-factory/squid/contributors","subscribers_url":"https://api.github.com/repos/measurement-factory/squid/subscribers","subscription_url":"https://api.github.com/repos/measurement-factory/squid/subscription","commits_url":"https://api.github.com/repos/measurement-factory/squid/commits{/sha}","git_commits_url":"https://api.github.com/repos/measurement-factory/squid/git/commits{/sha}","comments_url":"https://api.github.com/repos/measurement-factory/squid/comments{/number}","issue_comment_url":"https://api.github.com/repos/measurement-factory/squid/issues/comments{/number}","contents_url":"https://api.github.com/repos/measurement-factory/squid/contents/{+path}","compare_url":"https://api.github.com/repos/measurement-factory/squid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/measurement-factory/squid/merges","archive_url":"https://api.github.com/repos/measurement-factory/squid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/measurement-factory/squid/downloads","issues_url":"https://api.github.com/repos/measurement-factory/squid/issues{/number}","pulls_url":"https://api.github.com/repos/measurement-factory/squid/pulls{/number}","milestones_url":"https://api.github.com/repos/measurement-factory/squid/milestones{/number}","notifications_url":"https://api.github.com/repos/measurement-factory/squid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/measurement-factory/squid/labels{/name}","releases_url":"https://api.github.com/repos/measurement-factory/squid/releases{/id}","deployments_url":"https://api.github.com/repos/measurement-factory/squid/deployments","created_at":"2017-07-16T03:46:50Z","updated_at":"2018-12-18T18:00:09Z","pushed_at":"2019-01-04T04:45:42Z","git_url":"git://github.com/measurement-factory/squid.git","ssh_url":"git@github.com:measurement-factory/squid.git","clone_url":"https://github.com/measurement-factory/squid.git","svn_url":"https://github.com/measurement-factory/squid","homepage":"http://www.squid-cache.org/","size":172673,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":14,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":0,"open_issues":14,"watchers":0,"default_branch":"master"}},"base":{"label":"squid-cache:master","ref":"master","sha":"9d4250625d6d6f018a8d74d1faf09e1f07719cac","user":{"login":"squid-cache","id":363029,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MzAyOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/363029?v=4","gravatar_id":"","url":"https://api.github.com/users/squid-cache","html_url":"https://github.com/squid-cache","followers_url":"https://api.github.com/users/squid-cache/followers","following_url":"https://api.github.com/users/squid-cache/following{/other_user}","gists_url":"https://api.github.com/users/squid-cache/gists{/gist_id}","starred_url":"https://api.github.com/users/squid-cache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/squid-cache/subscriptions","organizations_url":"https://api.github.com/users/squid-cache/orgs","repos_url":"https://api.github.com/users/squid-cache/repos","events_url":"https://api.github.com/users/squid-cache/events{/privacy}","received_events_url":"https://api.github.com/users/squid-cache/received_events","type":"Organization","site_admin":false},"repo":{"id":24519987,"node_id":"MDEwOlJlcG9zaXRvcnkyNDUxOTk4Nw==","name":"squid","full_name":"squid-cache/squid","private":false,"owner":{"login":"squid-cache","id":363029,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2MzAyOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/363029?v=4","gravatar_id":"","url":"https://api.github.com/users/squid-cache","html_url":"https://github.com/squid-cache","followers_url":"https://api.github.com/users/squid-cache/followers","following_url":"https://api.github.com/users/squid-cache/following{/other_user}","gists_url":"https://api.github.com/users/squid-cache/gists{/gist_id}","starred_url":"https://api.github.com/users/squid-cache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/squid-cache/subscriptions","organizations_url":"https://api.github.com/users/squid-cache/orgs","repos_url":"https://api.github.com/users/squid-cache/repos","events_url":"https://api.github.com/users/squid-cache/events{/privacy}","received_events_url":"https://api.github.com/users/squid-cache/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/squid-cache/squid","description":"Squid Web Proxy Cache","fork":false,"url":"https://api.github.com/repos/squid-cache/squid","forks_url":"https://api.github.com/repos/squid-cache/squid/forks","keys_url":"https://api.github.com/repos/squid-cache/squid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/squid-cache/squid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/squid-cache/squid/teams","hooks_url":"https://api.github.com/repos/squid-cache/squid/hooks","issue_events_url":"https://api.github.com/repos/squid-cache/squid/issues/events{/number}","events_url":"https://api.github.com/repos/squid-cache/squid/events","assignees_url":"https://api.github.com/repos/squid-cache/squid/assignees{/user}","branches_url":"https://api.github.com/repos/squid-cache/squid/branches{/branch}","tags_url":"https://api.github.com/repos/squid-cache/squid/tags","blobs_url":"https://api.github.com/repos/squid-cache/squid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/squid-cache/squid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/squid-cache/squid/git/refs{/sha}","trees_url":"https://api.github.com/repos/squid-cache/squid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/squid-cache/squid/statuses/{sha}","languages_url":"https://api.github.com/repos/squid-cache/squid/languages","stargazers_url":"https://api.github.com/repos/squid-cache/squid/stargazers","contributors_url":"https://api.github.com/repos/squid-cache/squid/contributors","subscribers_url":"https://api.github.com/repos/squid-cache/squid/subscribers","subscription_url":"https://api.github.com/repos/squid-cache/squid/subscription","commits_url":"https://api.github.com/repos/squid-cache/squid/commits{/sha}","git_commits_url":"https://api.github.com/repos/squid-cache/squid/git/commits{/sha}","comments_url":"https://api.github.com/repos/squid-cache/squid/comments{/number}","issue_comment_url":"https://api.github.com/repos/squid-cache/squid/issues/comments{/number}","contents_url":"https://api.github.com/repos/squid-cache/squid/contents/{+path}","compare_url":"https://api.github.com/repos/squid-cache/squid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/squid-cache/squid/merges","archive_url":"https://api.github.com/repos/squid-cache/squid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/squid-cache/squid/downloads","issues_url":"https://api.github.com/repos/squid-cache/squid/issues{/number}","pulls_url":"https://api.github.com/repos/squid-cache/squid/pulls{/number}","milestones_url":"https://api.github.com/repos/squid-cache/squid/milestones{/number}","notifications_url":"https://api.github.com/repos/squid-cache/squid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/squid-cache/squid/labels{/name}","releases_url":"https://api.github.com/repos/squid-cache/squid/releases{/id}","deployments_url":"https://api.github.com/repos/squid-cache/squid/deployments","created_at":"2014-09-27T00:59:40Z","updated_at":"2019-01-04T06:15:10Z","pushed_at":"2019-01-03T15:50:24Z","git_url":"git://github.com/squid-cache/squid.git","ssh_url":"git@github.com:squid-cache/squid.git","clone_url":"https://github.com/squid-cache/squid.git","svn_url":"https://github.com/squid-cache/squid","homepage":"http://www.squid-cache.org/","size":162383,"stargazers_count":448,"watchers_count":448,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":175,"mirror_url":null,"archived":false,"open_issues_count":30,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":175,"open_issues":30,"watchers":448,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/squid-cache/squid/pulls/342"},"html":{"href":"https://github.com/squid-cache/squid/pull/342"},"issue":{"href":"https://api.github.com/repos/squid-cache/squid/issues/342"},"comments":{"href":"https://api.github.com/repos/squid-cache/squid/issues/342/comments"},"review_comments":{"href":"https://api.github.com/repos/squid-cache/squid/pulls/342/comments"},"review_comment":{"href":"https://api.github.com/repos/squid-cache/squid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/squid-cache/squid/pulls/342/commits"},"statuses":{"href":"https://api.github.com/repos/squid-cache/squid/statuses/2c067b565ce6cc2586bb702543b57523335c7ae1"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"yadij"}}