{"action":"created","comment":{"url":"https://api.github.com/repos/natsys/tempesta/pulls/comments/39402487","id":39402487,"diff_hunk":"@@ -47,11 +49,88 @@ reset_req(size_t data_len)\n \talloc_req(data_len);\n }\n \n+static void\n+alloc_resp(size_t data_len)\n+{\n+\tBUG_ON(resp);\n+\tresp = test_resp_alloc(data_len);\n+}\n+\n+static void\n+free_resp(void)\n+{\n+\tif (resp)\n+\t\ttest_resp_free(resp);\n+\tresp = NULL;\n+}\n+\n+static void\n+reset_resp(size_t data_len)\n+{\n+\tfree_resp();\n+\talloc_resp(data_len);\n+}\n+\n+static void\n+free_msgs(void)\n+{\n+\tfree_req();\n+\tfree_resp();\n+}\n+\n+int\n+split_and_parse_n(unsigned char *str, int type, size_t len, int chunks)\n+{\n+\tint chlen = len / chunks, rem = len % chunks, pos = 0, step, r;\n+\tchar tmp1, tmp2;\n+\n+\twhile (pos < len)\n+\t{\n+\t\tstep = chlen;\n+\n+\t\tif (rem) {\n+\t\t\tstep += rem;\n+\t\t\trem = 0;\n+\t\t}\n+\n+\t\tif (pos) {\n+\t\t\ttmp1 = *(str + pos - 1);\n+\t\t\t*(str + pos - 1) = 0;\n+\t\t}\n+\t\tif (pos + step < len) {\n+\t\t\ttmp2 = *(str + pos + step);\n+\t\t\t*(str + pos + step) = 0;\n+\t\t}","path":"tempesta_fw/t/unit/test_http_parser.c","position":66,"original_position":66,"commit_id":"a583ca5a655de249b96d829a4eb24ee0ea64fc15","original_commit_id":"a583ca5a655de249b96d829a4eb24ee0ea64fc15","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":"This is very unusual thing, but it has sense. Please always comment such code.","created_at":"2015-09-14T14:48:55Z","updated_at":"2015-09-14T14:48:55Z","html_url":"https://github.com/natsys/tempesta/pull/252#discussion_r39402487","pull_request_url":"https://api.github.com/repos/natsys/tempesta/pulls/252","_links":{"self":{"href":"https://api.github.com/repos/natsys/tempesta/pulls/comments/39402487"},"html":{"href":"https://github.com/natsys/tempesta/pull/252#discussion_r39402487"},"pull_request":{"href":"https://api.github.com/repos/natsys/tempesta/pulls/252"}}},"pull_request":{"url":"https://api.github.com/repos/natsys/tempesta/pulls/252","id":44669923,"html_url":"https://github.com/natsys/tempesta/pull/252","diff_url":"https://github.com/natsys/tempesta/pull/252.diff","patch_url":"https://github.com/natsys/tempesta/pull/252.patch","issue_url":"https://api.github.com/repos/natsys/tempesta/issues/252","number":252,"state":"open","locked":false,"title":"tfw_fuzzer: fuzzing requests and responses in the HTTP parser unit test: #150","user":{"login":"stefanstrogin","id":10670399,"avatar_url":"https://avatars.githubusercontent.com/u/10670399?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanstrogin","html_url":"https://github.com/stefanstrogin","followers_url":"https://api.github.com/users/stefanstrogin/followers","following_url":"https://api.github.com/users/stefanstrogin/following{/other_user}","gists_url":"https://api.github.com/users/stefanstrogin/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanstrogin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanstrogin/subscriptions","organizations_url":"https://api.github.com/users/stefanstrogin/orgs","repos_url":"https://api.github.com/users/stefanstrogin/repos","events_url":"https://api.github.com/users/stefanstrogin/events{/privacy}","received_events_url":"https://api.github.com/users/stefanstrogin/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-10T13:51:50Z","updated_at":"2015-09-14T14:48:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17c72b229a7a8423efbef0d9b5f0452022a78b75","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/natsys/tempesta/pulls/252/commits","review_comments_url":"https://api.github.com/repos/natsys/tempesta/pulls/252/comments","review_comment_url":"https://api.github.com/repos/natsys/tempesta/pulls/comments{/number}","comments_url":"https://api.github.com/repos/natsys/tempesta/issues/252/comments","statuses_url":"https://api.github.com/repos/natsys/tempesta/statuses/a583ca5a655de249b96d829a4eb24ee0ea64fc15","head":{"label":"natsys:ss-fuzzer","ref":"ss-fuzzer","sha":"a583ca5a655de249b96d829a4eb24ee0ea64fc15","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-09-03T12:35:56Z","pushed_at":"2015-09-13T14:17:21Z","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":3382,"stargazers_count":60,"watchers_count":60,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":63,"forks":12,"open_issues":63,"watchers":60,"default_branch":"master"}},"base":{"label":"natsys:master","ref":"master","sha":"183e647cc9c9d15c2e59d89123e6244534e3efc2","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-09-03T12:35:56Z","pushed_at":"2015-09-13T14:17:21Z","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":3382,"stargazers_count":60,"watchers_count":60,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":63,"forks":12,"open_issues":63,"watchers":60,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/natsys/tempesta/pulls/252"},"html":{"href":"https://github.com/natsys/tempesta/pull/252"},"issue":{"href":"https://api.github.com/repos/natsys/tempesta/issues/252"},"comments":{"href":"https://api.github.com/repos/natsys/tempesta/issues/252/comments"},"review_comments":{"href":"https://api.github.com/repos/natsys/tempesta/pulls/252/comments"},"review_comment":{"href":"https://api.github.com/repos/natsys/tempesta/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/natsys/tempesta/pulls/252/commits"},"statuses":{"href":"https://api.github.com/repos/natsys/tempesta/statuses/a583ca5a655de249b96d829a4eb24ee0ea64fc15"}}}}