{"action":"closed","number":253,"pull_request":{"url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/253","id":52023042,"html_url":"https://github.com/measurement-kit/measurement-kit/pull/253","diff_url":"https://github.com/measurement-kit/measurement-kit/pull/253.diff","patch_url":"https://github.com/measurement-kit/measurement-kit/pull/253.patch","issue_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/253","number":253,"state":"closed","locked":false,"title":"fix for http-invalid-request-line","user":{"login":"bassosimone","id":337298,"avatar_url":"https://avatars.githubusercontent.com/u/337298?v=3","gravatar_id":"","url":"https://api.github.com/users/bassosimone","html_url":"https://github.com/bassosimone","followers_url":"https://api.github.com/users/bassosimone/followers","following_url":"https://api.github.com/users/bassosimone/following{/other_user}","gists_url":"https://api.github.com/users/bassosimone/gists{/gist_id}","starred_url":"https://api.github.com/users/bassosimone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bassosimone/subscriptions","organizations_url":"https://api.github.com/users/bassosimone/orgs","repos_url":"https://api.github.com/users/bassosimone/repos","events_url":"https://api.github.com/users/bassosimone/events{/privacy}","received_events_url":"https://api.github.com/users/bassosimone/received_events","type":"User","site_admin":false},"body":"This diff is the starting point to fix http-invalid-request-line test when the backend used is an echo server rather than a properly working HTTP server.\r\n\r\nSo far, I've changed the backend address according to what is indicated in #101. Then, I've added code to route errors in the read and write callbacks of the stream. I think this is a better approach than the other branch that I opened, in which I was rewriting too much of HTTP too close to the release.\r\n\r\nThe diff works (meaning that routing exceptions prevent the exception thrown by the http-parser to terminate the test). However, I think more is needed to have something mergeable.\r\n\r\nSpecifically:\r\n\r\n1. two new errors should be added to `include/measurement_kit/common/error.hpp`: one should represent a runtime exception received when reading, the other should represent a runtime exception received when writing\r\n\r\n2. the code in this pull request should be modified to throw the two exceptions defined in step 1 respectively in the reading and in the writing case (this removing the need to XXX the code)\r\n\r\n3. a new file should be added to the `include/measurement_kit/http` folder and should be called `error.hpp` for symmetry with other parts of measurement-kit\r\n\r\n4. inside this file we shall move the errors currently defined in `src/http/response_parser.hpp` and furthermore such errors should inherit from `measurement_kit::common::Error` rather than from `std::runtime_error`, i.e. this `error.hpp` file should be similar to `net/error.hpp` or `dns/error.hpp`\r\n\r\n5. we should make sure that all the errors that were defined by the parsing code are actually used and unused errors should be removed from `http/error.hpp`\r\n\r\n6. we should use Valgrind to make sure that there are no memory errors introduced by the code that routes the exceptions (http code is still fragile); to this end it would probably suffice to test with Valgrind the http-invalid-request-line test because it triggers that behavior, but to be safe I'd also check other http-related regress tests\r\n\r\n7. make sure that (and possibly add regress tests) the http-invalid-request-line test reports success if the response is exactly what was sent (this brings the question of how to get the content of the buffer that caused the http parser to freak out, which can probably be done through the http stream and the related transport) and failure otherwise\r\n\r\nCloses #101.","created_at":"2015-11-27T20:33:15Z","updated_at":"2015-12-02T16:57:15Z","closed_at":"2015-12-02T16:57:15Z","merged_at":"2015-12-02T16:57:14Z","merge_commit_sha":"871e46a38a46ab4dee56e1e0facbeba0ada16e7d","assignee":{"login":"bassosimone","id":337298,"avatar_url":"https://avatars.githubusercontent.com/u/337298?v=3","gravatar_id":"","url":"https://api.github.com/users/bassosimone","html_url":"https://github.com/bassosimone","followers_url":"https://api.github.com/users/bassosimone/followers","following_url":"https://api.github.com/users/bassosimone/following{/other_user}","gists_url":"https://api.github.com/users/bassosimone/gists{/gist_id}","starred_url":"https://api.github.com/users/bassosimone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bassosimone/subscriptions","organizations_url":"https://api.github.com/users/bassosimone/orgs","repos_url":"https://api.github.com/users/bassosimone/repos","events_url":"https://api.github.com/users/bassosimone/events{/privacy}","received_events_url":"https://api.github.com/users/bassosimone/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/measurement-kit/measurement-kit/milestones/4","html_url":"https://github.com/measurement-kit/measurement-kit/milestones/release-0.1.0","labels_url":"https://api.github.com/repos/measurement-kit/measurement-kit/milestones/4/labels","id":1163605,"number":4,"title":"release-0.1.0","description":"- common api\r\n- dns api\r\n- http api\r\n- net api\r\n- ooni api\r\n- report api\r\n- traceroute api\r\n- ooni tests: dns injection, http invalid request line, tcp connect\r\n- documentation\r\n- c++ api for portolan","creator":{"login":"hellais","id":424620,"avatar_url":"https://avatars.githubusercontent.com/u/424620?v=3","gravatar_id":"","url":"https://api.github.com/users/hellais","html_url":"https://github.com/hellais","followers_url":"https://api.github.com/users/hellais/followers","following_url":"https://api.github.com/users/hellais/following{/other_user}","gists_url":"https://api.github.com/users/hellais/gists{/gist_id}","starred_url":"https://api.github.com/users/hellais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellais/subscriptions","organizations_url":"https://api.github.com/users/hellais/orgs","repos_url":"https://api.github.com/users/hellais/repos","events_url":"https://api.github.com/users/hellais/events{/privacy}","received_events_url":"https://api.github.com/users/hellais/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":78,"state":"open","created_at":"2015-06-14T10:40:07Z","updated_at":"2015-12-02T16:57:15Z","due_on":"2015-12-14T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/253/commits","review_comments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/253/comments","review_comment_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/253/comments","statuses_url":"https://api.github.com/repos/measurement-kit/measurement-kit/statuses/b7255549a63701efd672c31a16221e10eb752b52","head":{"label":"measurement-kit:fix/http-invalid-request-line-test","ref":"fix/http-invalid-request-line-test","sha":"b7255549a63701efd672c31a16221e10eb752b52","user":{"login":"measurement-kit","id":11982841,"avatar_url":"https://avatars.githubusercontent.com/u/11982841?v=3","gravatar_id":"","url":"https://api.github.com/users/measurement-kit","html_url":"https://github.com/measurement-kit","followers_url":"https://api.github.com/users/measurement-kit/followers","following_url":"https://api.github.com/users/measurement-kit/following{/other_user}","gists_url":"https://api.github.com/users/measurement-kit/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-kit/subscriptions","organizations_url":"https://api.github.com/users/measurement-kit/orgs","repos_url":"https://api.github.com/users/measurement-kit/repos","events_url":"https://api.github.com/users/measurement-kit/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-kit/received_events","type":"Organization","site_admin":false},"repo":{"id":20287787,"name":"measurement-kit","full_name":"measurement-kit/measurement-kit","owner":{"login":"measurement-kit","id":11982841,"avatar_url":"https://avatars.githubusercontent.com/u/11982841?v=3","gravatar_id":"","url":"https://api.github.com/users/measurement-kit","html_url":"https://github.com/measurement-kit","followers_url":"https://api.github.com/users/measurement-kit/followers","following_url":"https://api.github.com/users/measurement-kit/following{/other_user}","gists_url":"https://api.github.com/users/measurement-kit/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-kit/subscriptions","organizations_url":"https://api.github.com/users/measurement-kit/orgs","repos_url":"https://api.github.com/users/measurement-kit/repos","events_url":"https://api.github.com/users/measurement-kit/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-kit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/measurement-kit/measurement-kit","description":"Portable network measurement library","fork":false,"url":"https://api.github.com/repos/measurement-kit/measurement-kit","forks_url":"https://api.github.com/repos/measurement-kit/measurement-kit/forks","keys_url":"https://api.github.com/repos/measurement-kit/measurement-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/measurement-kit/measurement-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/measurement-kit/measurement-kit/teams","hooks_url":"https://api.github.com/repos/measurement-kit/measurement-kit/hooks","issue_events_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/events{/number}","events_url":"https://api.github.com/repos/measurement-kit/measurement-kit/events","assignees_url":"https://api.github.com/repos/measurement-kit/measurement-kit/assignees{/user}","branches_url":"https://api.github.com/repos/measurement-kit/measurement-kit/branches{/branch}","tags_url":"https://api.github.com/repos/measurement-kit/measurement-kit/tags","blobs_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/measurement-kit/measurement-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/measurement-kit/measurement-kit/languages","stargazers_url":"https://api.github.com/repos/measurement-kit/measurement-kit/stargazers","contributors_url":"https://api.github.com/repos/measurement-kit/measurement-kit/contributors","subscribers_url":"https://api.github.com/repos/measurement-kit/measurement-kit/subscribers","subscription_url":"https://api.github.com/repos/measurement-kit/measurement-kit/subscription","commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/measurement-kit/measurement-kit/contents/{+path}","compare_url":"https://api.github.com/repos/measurement-kit/measurement-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/measurement-kit/measurement-kit/merges","archive_url":"https://api.github.com/repos/measurement-kit/measurement-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/measurement-kit/measurement-kit/downloads","issues_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues{/number}","pulls_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/measurement-kit/measurement-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/measurement-kit/measurement-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/measurement-kit/measurement-kit/labels{/name}","releases_url":"https://api.github.com/repos/measurement-kit/measurement-kit/releases{/id}","created_at":"2014-05-29T08:44:43Z","updated_at":"2015-11-11T20:26:54Z","pushed_at":"2015-12-02T16:57:15Z","git_url":"git://github.com/measurement-kit/measurement-kit.git","ssh_url":"git@github.com:measurement-kit/measurement-kit.git","clone_url":"https://github.com/measurement-kit/measurement-kit.git","svn_url":"https://github.com/measurement-kit/measurement-kit","homepage":"https://measurement-kit.github.io/","size":9306,"stargazers_count":14,"watchers_count":14,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":31,"forks":4,"open_issues":31,"watchers":14,"default_branch":"master"}},"base":{"label":"measurement-kit:master","ref":"master","sha":"cc0b63752e17048c0c14dcd3c0413db215eb5a15","user":{"login":"measurement-kit","id":11982841,"avatar_url":"https://avatars.githubusercontent.com/u/11982841?v=3","gravatar_id":"","url":"https://api.github.com/users/measurement-kit","html_url":"https://github.com/measurement-kit","followers_url":"https://api.github.com/users/measurement-kit/followers","following_url":"https://api.github.com/users/measurement-kit/following{/other_user}","gists_url":"https://api.github.com/users/measurement-kit/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-kit/subscriptions","organizations_url":"https://api.github.com/users/measurement-kit/orgs","repos_url":"https://api.github.com/users/measurement-kit/repos","events_url":"https://api.github.com/users/measurement-kit/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-kit/received_events","type":"Organization","site_admin":false},"repo":{"id":20287787,"name":"measurement-kit","full_name":"measurement-kit/measurement-kit","owner":{"login":"measurement-kit","id":11982841,"avatar_url":"https://avatars.githubusercontent.com/u/11982841?v=3","gravatar_id":"","url":"https://api.github.com/users/measurement-kit","html_url":"https://github.com/measurement-kit","followers_url":"https://api.github.com/users/measurement-kit/followers","following_url":"https://api.github.com/users/measurement-kit/following{/other_user}","gists_url":"https://api.github.com/users/measurement-kit/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-kit/subscriptions","organizations_url":"https://api.github.com/users/measurement-kit/orgs","repos_url":"https://api.github.com/users/measurement-kit/repos","events_url":"https://api.github.com/users/measurement-kit/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-kit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/measurement-kit/measurement-kit","description":"Portable network measurement library","fork":false,"url":"https://api.github.com/repos/measurement-kit/measurement-kit","forks_url":"https://api.github.com/repos/measurement-kit/measurement-kit/forks","keys_url":"https://api.github.com/repos/measurement-kit/measurement-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/measurement-kit/measurement-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/measurement-kit/measurement-kit/teams","hooks_url":"https://api.github.com/repos/measurement-kit/measurement-kit/hooks","issue_events_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/events{/number}","events_url":"https://api.github.com/repos/measurement-kit/measurement-kit/events","assignees_url":"https://api.github.com/repos/measurement-kit/measurement-kit/assignees{/user}","branches_url":"https://api.github.com/repos/measurement-kit/measurement-kit/branches{/branch}","tags_url":"https://api.github.com/repos/measurement-kit/measurement-kit/tags","blobs_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/measurement-kit/measurement-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/measurement-kit/measurement-kit/languages","stargazers_url":"https://api.github.com/repos/measurement-kit/measurement-kit/stargazers","contributors_url":"https://api.github.com/repos/measurement-kit/measurement-kit/contributors","subscribers_url":"https://api.github.com/repos/measurement-kit/measurement-kit/subscribers","subscription_url":"https://api.github.com/repos/measurement-kit/measurement-kit/subscription","commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/measurement-kit/measurement-kit/contents/{+path}","compare_url":"https://api.github.com/repos/measurement-kit/measurement-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/measurement-kit/measurement-kit/merges","archive_url":"https://api.github.com/repos/measurement-kit/measurement-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/measurement-kit/measurement-kit/downloads","issues_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues{/number}","pulls_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/measurement-kit/measurement-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/measurement-kit/measurement-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/measurement-kit/measurement-kit/labels{/name}","releases_url":"https://api.github.com/repos/measurement-kit/measurement-kit/releases{/id}","created_at":"2014-05-29T08:44:43Z","updated_at":"2015-11-11T20:26:54Z","pushed_at":"2015-12-02T16:57:15Z","git_url":"git://github.com/measurement-kit/measurement-kit.git","ssh_url":"git@github.com:measurement-kit/measurement-kit.git","clone_url":"https://github.com/measurement-kit/measurement-kit.git","svn_url":"https://github.com/measurement-kit/measurement-kit","homepage":"https://measurement-kit.github.io/","size":9306,"stargazers_count":14,"watchers_count":14,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":31,"forks":4,"open_issues":31,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/253"},"html":{"href":"https://github.com/measurement-kit/measurement-kit/pull/253"},"issue":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/253"},"comments":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/253/comments"},"review_comments":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/253/comments"},"review_comment":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/253/commits"},"statuses":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/statuses/b7255549a63701efd672c31a16221e10eb752b52"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"AntonioLangiu","id":4649406,"avatar_url":"https://avatars.githubusercontent.com/u/4649406?v=3","gravatar_id":"","url":"https://api.github.com/users/AntonioLangiu","html_url":"https://github.com/AntonioLangiu","followers_url":"https://api.github.com/users/AntonioLangiu/followers","following_url":"https://api.github.com/users/AntonioLangiu/following{/other_user}","gists_url":"https://api.github.com/users/AntonioLangiu/gists{/gist_id}","starred_url":"https://api.github.com/users/AntonioLangiu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AntonioLangiu/subscriptions","organizations_url":"https://api.github.com/users/AntonioLangiu/orgs","repos_url":"https://api.github.com/users/AntonioLangiu/repos","events_url":"https://api.github.com/users/AntonioLangiu/events{/privacy}","received_events_url":"https://api.github.com/users/AntonioLangiu/received_events","type":"User","site_admin":false},"comments":7,"review_comments":1,"commits":3,"additions":55,"deletions":32,"changed_files":6}}