{"action":"created","comment":{"url":"https://api.github.com/repos/natsys/tempesta/pulls/comments/44213821","id":44213821,"diff_hunk":"@@ -1323,28 +1342,70 @@ tfw_http_parse_req(void *req_data, unsigned char *data, size_t len)\n \t *\n \t * We must not rewrite abs_path, but still can cast host part\n \t * to lower case.\n+\t *\n+\t * We parse authority. It can be \"host\" or \"userinfo@host\".\n+\t * At the begining we don't know, which of variants we have.\n+\t *\n+\t * So we start to fill both req->host and req->userinfo. If we find\n+\t * '@' we reset req->host and finish req->userinfo. If we don't,\n+\t * we clean req->userinfo.\n \t */\n-\t__FSM_STATE(Req_UriHostStart) {\n+\t__FSM_STATE(Req_UriAuthorityStart) {\n \t\tif (likely(isalnum(c) || c == '.' || c == '-')) {\n \t\t\t*p = LC(*p);\n+\t\t\ttfw_http_msg_set_data(msg, &req->userinfo, p);\n \t\t\ttfw_http_msg_set_data(msg, &req->host, p);\n-\t\t\t__FSM_MOVE_f(Req_UriHost, &req->host);\n+\t\t\t__FSM_MOVE_f2(Req_UriAuthority, &req->host, &req->userinfo);\n \t\t}\n \t\treturn TFW_BLOCK;\n \t}\n \n-\t__FSM_STATE(Req_UriHost) {\n-\t\tif (likely(isalnum(c) || c == '.' || c == '-')) {\n+\t__FSM_STATE(Req_UriAuthority) {\n+\t\tif (likely(isalnum(c) || c == '.' || c == '-' ||\n+\t\t\t(c == '@' && !(parser->flags & TFW_HTTP_PF_HAS_USERINFO))))","path":"tempesta_fw/http_parser.c","position":85,"original_position":80,"commit_id":"f927797bdbc70fe6a014d32bf558f21a41661461","original_commit_id":"e40988c7cdf7e069e5dc5a51489ba2cb223cf05c","user":{"login":"krizhanovsky","id":884694,"avatar_url":"https://avatars.githubusercontent.com/u/884694?v=3","gravatar_id":"","url":"https://api.github.com/users/krizhanovsky","html_url":"https://github.com/krizhanovsky","followers_url":"https://api.github.com/users/krizhanovsky/followers","following_url":"https://api.github.com/users/krizhanovsky/following{/other_user}","gists_url":"https://api.github.com/users/krizhanovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/krizhanovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krizhanovsky/subscriptions","organizations_url":"https://api.github.com/users/krizhanovsky/orgs","repos_url":"https://api.github.com/users/krizhanovsky/repos","events_url":"https://api.github.com/users/krizhanovsky/events{/privacy}","received_events_url":"https://api.github.com/users/krizhanovsky/received_events","type":"User","site_admin":false},"body":"Too long line, please fit to 80 characters line width.","created_at":"2015-11-07T16:09:12Z","updated_at":"2015-11-07T16:09:12Z","html_url":"https://github.com/natsys/tempesta/pull/333#discussion_r44213821","pull_request_url":"https://api.github.com/repos/natsys/tempesta/pulls/333","_links":{"self":{"href":"https://api.github.com/repos/natsys/tempesta/pulls/comments/44213821"},"html":{"href":"https://github.com/natsys/tempesta/pull/333#discussion_r44213821"},"pull_request":{"href":"https://api.github.com/repos/natsys/tempesta/pulls/333"}}},"pull_request":{"url":"https://api.github.com/repos/natsys/tempesta/pulls/333","id":49009123,"html_url":"https://github.com/natsys/tempesta/pull/333","diff_url":"https://github.com/natsys/tempesta/pull/333.diff","patch_url":"https://github.com/natsys/tempesta/pull/333.patch","issue_url":"https://api.github.com/repos/natsys/tempesta/issues/333","number":333,"state":"open","locked":false,"title":"Parsing userinfo@hostname - #325","user":{"login":"vladtcvs","id":3390973,"avatar_url":"https://avatars.githubusercontent.com/u/3390973?v=3","gravatar_id":"","url":"https://api.github.com/users/vladtcvs","html_url":"https://github.com/vladtcvs","followers_url":"https://api.github.com/users/vladtcvs/followers","following_url":"https://api.github.com/users/vladtcvs/following{/other_user}","gists_url":"https://api.github.com/users/vladtcvs/gists{/gist_id}","starred_url":"https://api.github.com/users/vladtcvs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladtcvs/subscriptions","organizations_url":"https://api.github.com/users/vladtcvs/orgs","repos_url":"https://api.github.com/users/vladtcvs/repos","events_url":"https://api.github.com/users/vladtcvs/events{/privacy}","received_events_url":"https://api.github.com/users/vladtcvs/received_events","type":"User","site_admin":false},"body":"fixing #325 item","created_at":"2015-10-28T14:00:10Z","updated_at":"2015-11-07T16:09:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6ce77465d4775b3eb2f77befd4de2108f0f12fa6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/natsys/tempesta/pulls/333/commits","review_comments_url":"https://api.github.com/repos/natsys/tempesta/pulls/333/comments","review_comment_url":"https://api.github.com/repos/natsys/tempesta/pulls/comments{/number}","comments_url":"https://api.github.com/repos/natsys/tempesta/issues/333/comments","statuses_url":"https://api.github.com/repos/natsys/tempesta/statuses/f927797bdbc70fe6a014d32bf558f21a41661461","head":{"label":"natsys:vlts-325","ref":"vlts-325","sha":"f927797bdbc70fe6a014d32bf558f21a41661461","user":{"login":"natsys","id":8489938,"avatar_url":"https://avatars.githubusercontent.com/u/8489938?v=3","gravatar_id":"","url":"https://api.github.com/users/natsys","html_url":"https://github.com/natsys","followers_url":"https://api.github.com/users/natsys/followers","following_url":"https://api.github.com/users/natsys/following{/other_user}","gists_url":"https://api.github.com/users/natsys/gists{/gist_id}","starred_url":"https://api.github.com/users/natsys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natsys/subscriptions","organizations_url":"https://api.github.com/users/natsys/orgs","repos_url":"https://api.github.com/users/natsys/repos","events_url":"https://api.github.com/users/natsys/events{/privacy}","received_events_url":"https://api.github.com/users/natsys/received_events","type":"Organization","site_admin":false},"repo":{"id":23121600,"name":"tempesta","full_name":"natsys/tempesta","owner":{"login":"natsys","id":8489938,"avatar_url":"https://avatars.githubusercontent.com/u/8489938?v=3","gravatar_id":"","url":"https://api.github.com/users/natsys","html_url":"https://github.com/natsys","followers_url":"https://api.github.com/users/natsys/followers","following_url":"https://api.github.com/users/natsys/following{/other_user}","gists_url":"https://api.github.com/users/natsys/gists{/gist_id}","starred_url":"https://api.github.com/users/natsys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natsys/subscriptions","organizations_url":"https://api.github.com/users/natsys/orgs","repos_url":"https://api.github.com/users/natsys/repos","events_url":"https://api.github.com/users/natsys/events{/privacy}","received_events_url":"https://api.github.com/users/natsys/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/natsys/tempesta","description":"High performance HTTP accelerator and firewall for WAF and DDoS prevention","fork":false,"url":"https://api.github.com/repos/natsys/tempesta","forks_url":"https://api.github.com/repos/natsys/tempesta/forks","keys_url":"https://api.github.com/repos/natsys/tempesta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/natsys/tempesta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/natsys/tempesta/teams","hooks_url":"https://api.github.com/repos/natsys/tempesta/hooks","issue_events_url":"https://api.github.com/repos/natsys/tempesta/issues/events{/number}","events_url":"https://api.github.com/repos/natsys/tempesta/events","assignees_url":"https://api.github.com/repos/natsys/tempesta/assignees{/user}","branches_url":"https://api.github.com/repos/natsys/tempesta/branches{/branch}","tags_url":"https://api.github.com/repos/natsys/tempesta/tags","blobs_url":"https://api.github.com/repos/natsys/tempesta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/natsys/tempesta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/natsys/tempesta/git/refs{/sha}","trees_url":"https://api.github.com/repos/natsys/tempesta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/natsys/tempesta/statuses/{sha}","languages_url":"https://api.github.com/repos/natsys/tempesta/languages","stargazers_url":"https://api.github.com/repos/natsys/tempesta/stargazers","contributors_url":"https://api.github.com/repos/natsys/tempesta/contributors","subscribers_url":"https://api.github.com/repos/natsys/tempesta/subscribers","subscription_url":"https://api.github.com/repos/natsys/tempesta/subscription","commits_url":"https://api.github.com/repos/natsys/tempesta/commits{/sha}","git_commits_url":"https://api.github.com/repos/natsys/tempesta/git/commits{/sha}","comments_url":"https://api.github.com/repos/natsys/tempesta/comments{/number}","issue_comment_url":"https://api.github.com/repos/natsys/tempesta/issues/comments{/number}","contents_url":"https://api.github.com/repos/natsys/tempesta/contents/{+path}","compare_url":"https://api.github.com/repos/natsys/tempesta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/natsys/tempesta/merges","archive_url":"https://api.github.com/repos/natsys/tempesta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/natsys/tempesta/downloads","issues_url":"https://api.github.com/repos/natsys/tempesta/issues{/number}","pulls_url":"https://api.github.com/repos/natsys/tempesta/pulls{/number}","milestones_url":"https://api.github.com/repos/natsys/tempesta/milestones{/number}","notifications_url":"https://api.github.com/repos/natsys/tempesta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/natsys/tempesta/labels{/name}","releases_url":"https://api.github.com/repos/natsys/tempesta/releases{/id}","created_at":"2014-08-19T18:44:05Z","updated_at":"2015-10-30T15:28:12Z","pushed_at":"2015-11-07T16:06:25Z","git_url":"git://github.com/natsys/tempesta.git","ssh_url":"git@github.com:natsys/tempesta.git","clone_url":"https://github.com/natsys/tempesta.git","svn_url":"https://github.com/natsys/tempesta","homepage":"","size":5106,"stargazers_count":75,"watchers_count":75,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":68,"forks":15,"open_issues":68,"watchers":75,"default_branch":"master"}},"base":{"label":"natsys:master","ref":"master","sha":"f1ee1153736da1fd840081bda0b753049d4df2f6","user":{"login":"natsys","id":8489938,"avatar_url":"https://avatars.githubusercontent.com/u/8489938?v=3","gravatar_id":"","url":"https://api.github.com/users/natsys","html_url":"https://github.com/natsys","followers_url":"https://api.github.com/users/natsys/followers","following_url":"https://api.github.com/users/natsys/following{/other_user}","gists_url":"https://api.github.com/users/natsys/gists{/gist_id}","starred_url":"https://api.github.com/users/natsys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natsys/subscriptions","organizations_url":"https://api.github.com/users/natsys/orgs","repos_url":"https://api.github.com/users/natsys/repos","events_url":"https://api.github.com/users/natsys/events{/privacy}","received_events_url":"https://api.github.com/users/natsys/received_events","type":"Organization","site_admin":false},"repo":{"id":23121600,"name":"tempesta","full_name":"natsys/tempesta","owner":{"login":"natsys","id":8489938,"avatar_url":"https://avatars.githubusercontent.com/u/8489938?v=3","gravatar_id":"","url":"https://api.github.com/users/natsys","html_url":"https://github.com/natsys","followers_url":"https://api.github.com/users/natsys/followers","following_url":"https://api.github.com/users/natsys/following{/other_user}","gists_url":"https://api.github.com/users/natsys/gists{/gist_id}","starred_url":"https://api.github.com/users/natsys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/natsys/subscriptions","organizations_url":"https://api.github.com/users/natsys/orgs","repos_url":"https://api.github.com/users/natsys/repos","events_url":"https://api.github.com/users/natsys/events{/privacy}","received_events_url":"https://api.github.com/users/natsys/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/natsys/tempesta","description":"High performance HTTP accelerator and firewall for WAF and DDoS prevention","fork":false,"url":"https://api.github.com/repos/natsys/tempesta","forks_url":"https://api.github.com/repos/natsys/tempesta/forks","keys_url":"https://api.github.com/repos/natsys/tempesta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/natsys/tempesta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/natsys/tempesta/teams","hooks_url":"https://api.github.com/repos/natsys/tempesta/hooks","issue_events_url":"https://api.github.com/repos/natsys/tempesta/issues/events{/number}","events_url":"https://api.github.com/repos/natsys/tempesta/events","assignees_url":"https://api.github.com/repos/natsys/tempesta/assignees{/user}","branches_url":"https://api.github.com/repos/natsys/tempesta/branches{/branch}","tags_url":"https://api.github.com/repos/natsys/tempesta/tags","blobs_url":"https://api.github.com/repos/natsys/tempesta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/natsys/tempesta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/natsys/tempesta/git/refs{/sha}","trees_url":"https://api.github.com/repos/natsys/tempesta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/natsys/tempesta/statuses/{sha}","languages_url":"https://api.github.com/repos/natsys/tempesta/languages","stargazers_url":"https://api.github.com/repos/natsys/tempesta/stargazers","contributors_url":"https://api.github.com/repos/natsys/tempesta/contributors","subscribers_url":"https://api.github.com/repos/natsys/tempesta/subscribers","subscription_url":"https://api.github.com/repos/natsys/tempesta/subscription","commits_url":"https://api.github.com/repos/natsys/tempesta/commits{/sha}","git_commits_url":"https://api.github.com/repos/natsys/tempesta/git/commits{/sha}","comments_url":"https://api.github.com/repos/natsys/tempesta/comments{/number}","issue_comment_url":"https://api.github.com/repos/natsys/tempesta/issues/comments{/number}","contents_url":"https://api.github.com/repos/natsys/tempesta/contents/{+path}","compare_url":"https://api.github.com/repos/natsys/tempesta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/natsys/tempesta/merges","archive_url":"https://api.github.com/repos/natsys/tempesta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/natsys/tempesta/downloads","issues_url":"https://api.github.com/repos/natsys/tempesta/issues{/number}","pulls_url":"https://api.github.com/repos/natsys/tempesta/pulls{/number}","milestones_url":"https://api.github.com/repos/natsys/tempesta/milestones{/number}","notifications_url":"https://api.github.com/repos/natsys/tempesta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/natsys/tempesta/labels{/name}","releases_url":"https://api.github.com/repos/natsys/tempesta/releases{/id}","created_at":"2014-08-19T18:44:05Z","updated_at":"2015-10-30T15:28:12Z","pushed_at":"2015-11-07T16:06:25Z","git_url":"git://github.com/natsys/tempesta.git","ssh_url":"git@github.com:natsys/tempesta.git","clone_url":"https://github.com/natsys/tempesta.git","svn_url":"https://github.com/natsys/tempesta","homepage":"","size":5106,"stargazers_count":75,"watchers_count":75,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":68,"forks":15,"open_issues":68,"watchers":75,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/natsys/tempesta/pulls/333"},"html":{"href":"https://github.com/natsys/tempesta/pull/333"},"issue":{"href":"https://api.github.com/repos/natsys/tempesta/issues/333"},"comments":{"href":"https://api.github.com/repos/natsys/tempesta/issues/333/comments"},"review_comments":{"href":"https://api.github.com/repos/natsys/tempesta/pulls/333/comments"},"review_comment":{"href":"https://api.github.com/repos/natsys/tempesta/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/natsys/tempesta/pulls/333/commits"},"statuses":{"href":"https://api.github.com/repos/natsys/tempesta/statuses/f927797bdbc70fe6a014d32bf558f21a41661461"}}}}