{"action":"created","comment":{"url":"https://api.github.com/repos/vinniefalco/Beast/pulls/comments/61333415","id":61333415,"diff_hunk":"@@ -0,0 +1,388 @@\n+//\n+// Copyright (c) 2013-2016 Vinnie Falco (vinnie dot falco at gmail dot com)\n+//\n+// Distributed under the Boost Software License, Version 1.0. (See accompanying\n+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\n+//\n+\n+#ifndef BEAST_HTTP_DETAIL_BASIC_PARSER_HPP\n+#define BEAST_HTTP_DETAIL_BASIC_PARSER_HPP\n+\n+#include <boost/system/error_code.hpp>\n+#include <boost/utility/string_ref.hpp>\n+#include <array>\n+#include <cstdint>\n+\n+namespace beast {\n+namespace http {\n+namespace detail {\n+\n+// '0'...'9'\n+inline\n+bool\n+is_digit(char c)\n+{\n+    return c >= '0' && c <= '9';\n+}\n+\n+inline\n+bool\n+is_token(char c)\n+{\n+    /*  token = 1*<any CHAR except CTLs or separators>\n+        CHAR  = <any US-ASCII character (octets 0 - 127)>\n+        sep   = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n+              | \",\" | \";\" | \":\" | \"\\\" | <\">\n+              | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n+              | \"{\" | \"}\" | SP | HT\n+    */\n+    static std::array<char, 256> constexpr tab = {{\n+        0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0, // 0\n+        0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0, // 16\n+        0, 1, 0, 1,  1, 1, 1, 1,  0, 0, 1, 1,  0, 1, 1, 0, // 32\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 0, 0,  0, 0, 0, 0, // 48\n+        0, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1, // 64\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 0,  0, 0, 1, 1, // 80\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1, // 96\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 0,  1, 0, 1, 0, // 112\n+    }};\n+    return tab[static_cast<std::uint8_t>(c)] != 0;\n+}\n+\n+inline\n+bool\n+is_text(char c)\n+{\n+    // TEXT = <any OCTET except CTLs, but including LWS>\n+    static std::array<char, 256> constexpr tab = {{\n+        0, 0, 0, 0,  0, 0, 0, 0,  0, 1, 0, 0,  0, 0, 0, 0, // 0\n+        0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0, // 16\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1, // 32\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1, // 48\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1, // 64\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1, // 80\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1, // 96\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 0, // 112\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1, // 128\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1, // 144\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1, // 160\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1, // 176\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1, // 192\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1, // 208\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1, // 224\n+        1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1,  1, 1, 1, 1  // 240\n+    }};\n+    return tab[static_cast<std::uint8_t>(c)] != 0;","path":"include/beast/http/detail/basic_parser.hpp","position":75,"original_position":75,"commit_id":"b25ef3a1b8a6543d90b7a538f08d970ee73c357b","original_commit_id":"b80f1c7f8fedb1513265eba276e958c6e2d7c4d6","user":{"login":"vinniefalco","id":1503976,"avatar_url":"https://avatars.githubusercontent.com/u/1503976?v=3","gravatar_id":"","url":"https://api.github.com/users/vinniefalco","html_url":"https://github.com/vinniefalco","followers_url":"https://api.github.com/users/vinniefalco/followers","following_url":"https://api.github.com/users/vinniefalco/following{/other_user}","gists_url":"https://api.github.com/users/vinniefalco/gists{/gist_id}","starred_url":"https://api.github.com/users/vinniefalco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinniefalco/subscriptions","organizations_url":"https://api.github.com/users/vinniefalco/orgs","repos_url":"https://api.github.com/users/vinniefalco/repos","events_url":"https://api.github.com/users/vinniefalco/events{/privacy}","received_events_url":"https://api.github.com/users/vinniefalco/received_events","type":"User","site_admin":false},"body":"OOH!!! SHINY","created_at":"2016-04-27T20:50:14Z","updated_at":"2016-04-27T20:50:14Z","html_url":"https://github.com/vinniefalco/Beast/pull/4#discussion_r61333415","pull_request_url":"https://api.github.com/repos/vinniefalco/Beast/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/vinniefalco/Beast/pulls/comments/61333415"},"html":{"href":"https://github.com/vinniefalco/Beast/pull/4#discussion_r61333415"},"pull_request":{"href":"https://api.github.com/repos/vinniefalco/Beast/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/vinniefalco/Beast/pulls/4","id":67971206,"html_url":"https://github.com/vinniefalco/Beast/pull/4","diff_url":"https://github.com/vinniefalco/Beast/pull/4.diff","patch_url":"https://github.com/vinniefalco/Beast/pull/4.patch","issue_url":"https://api.github.com/repos/vinniefalco/Beast/issues/4","number":4,"state":"open","locked":false,"title":"basic_parser rewrite: header-only","user":{"login":"vinniefalco","id":1503976,"avatar_url":"https://avatars.githubusercontent.com/u/1503976?v=3","gravatar_id":"","url":"https://api.github.com/users/vinniefalco","html_url":"https://github.com/vinniefalco","followers_url":"https://api.github.com/users/vinniefalco/followers","following_url":"https://api.github.com/users/vinniefalco/following{/other_user}","gists_url":"https://api.github.com/users/vinniefalco/gists{/gist_id}","starred_url":"https://api.github.com/users/vinniefalco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinniefalco/subscriptions","organizations_url":"https://api.github.com/users/vinniefalco/orgs","repos_url":"https://api.github.com/users/vinniefalco/repos","events_url":"https://api.github.com/users/vinniefalco/events{/privacy}","received_events_url":"https://api.github.com/users/vinniefalco/received_events","type":"User","site_admin":false},"body":"The basic_parser is rewritten to be header-only. The nodejs parser is removed from the include subtree and placed into the test directory. Other changes:\r\n\r\n* Parser specific error codes in parse_error.hpp\r\n* Add parser-bench performance testing, nodejs vs beast\r\n* New random message generator for fuzz tests\r\n* Test for header-only parser using random message generator\r\n* Augmented some existing message tests to check more cases\r\n* Add beast::write(): This function performs serialization of a variable list of arguments to a streambuf. It accepts a wide variety of argument types, using boost::asio::buffer and boost::lexical_cast where possible.\r\n\r\nFirst 2 commits already passed review (add WebSocket tests and Beast documentation work). Preview of the documentation changes are here:\r\nhttp://vinniefalco.github.io/stage/beast\r\n\r\nThis commit also already passed review (Add UTF8_checker unit test)\r\n\r\nReviewers: @nbougalis ","created_at":"2016-04-26T22:52:32Z","updated_at":"2016-04-27T20:50:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ae779ac06444fec0ee0325b5e17a072da07fc92d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vinniefalco/Beast/pulls/4/commits","review_comments_url":"https://api.github.com/repos/vinniefalco/Beast/pulls/4/comments","review_comment_url":"https://api.github.com/repos/vinniefalco/Beast/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vinniefalco/Beast/issues/4/comments","statuses_url":"https://api.github.com/repos/vinniefalco/Beast/statuses/b25ef3a1b8a6543d90b7a538f08d970ee73c357b","head":{"label":"vinniefalco:parser","ref":"parser","sha":"b25ef3a1b8a6543d90b7a538f08d970ee73c357b","user":{"login":"vinniefalco","id":1503976,"avatar_url":"https://avatars.githubusercontent.com/u/1503976?v=3","gravatar_id":"","url":"https://api.github.com/users/vinniefalco","html_url":"https://github.com/vinniefalco","followers_url":"https://api.github.com/users/vinniefalco/followers","following_url":"https://api.github.com/users/vinniefalco/following{/other_user}","gists_url":"https://api.github.com/users/vinniefalco/gists{/gist_id}","starred_url":"https://api.github.com/users/vinniefalco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinniefalco/subscriptions","organizations_url":"https://api.github.com/users/vinniefalco/orgs","repos_url":"https://api.github.com/users/vinniefalco/repos","events_url":"https://api.github.com/users/vinniefalco/events{/privacy}","received_events_url":"https://api.github.com/users/vinniefalco/received_events","type":"User","site_admin":false},"repo":{"id":10726510,"name":"Beast","full_name":"vinniefalco/Beast","owner":{"login":"vinniefalco","id":1503976,"avatar_url":"https://avatars.githubusercontent.com/u/1503976?v=3","gravatar_id":"","url":"https://api.github.com/users/vinniefalco","html_url":"https://github.com/vinniefalco","followers_url":"https://api.github.com/users/vinniefalco/followers","following_url":"https://api.github.com/users/vinniefalco/following{/other_user}","gists_url":"https://api.github.com/users/vinniefalco/gists{/gist_id}","starred_url":"https://api.github.com/users/vinniefalco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinniefalco/subscriptions","organizations_url":"https://api.github.com/users/vinniefalco/orgs","repos_url":"https://api.github.com/users/vinniefalco/repos","events_url":"https://api.github.com/users/vinniefalco/events{/privacy}","received_events_url":"https://api.github.com/users/vinniefalco/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vinniefalco/Beast","description":"HTTP and WebSocket implementations built on Boost.Asio","fork":false,"url":"https://api.github.com/repos/vinniefalco/Beast","forks_url":"https://api.github.com/repos/vinniefalco/Beast/forks","keys_url":"https://api.github.com/repos/vinniefalco/Beast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vinniefalco/Beast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vinniefalco/Beast/teams","hooks_url":"https://api.github.com/repos/vinniefalco/Beast/hooks","issue_events_url":"https://api.github.com/repos/vinniefalco/Beast/issues/events{/number}","events_url":"https://api.github.com/repos/vinniefalco/Beast/events","assignees_url":"https://api.github.com/repos/vinniefalco/Beast/assignees{/user}","branches_url":"https://api.github.com/repos/vinniefalco/Beast/branches{/branch}","tags_url":"https://api.github.com/repos/vinniefalco/Beast/tags","blobs_url":"https://api.github.com/repos/vinniefalco/Beast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vinniefalco/Beast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vinniefalco/Beast/git/refs{/sha}","trees_url":"https://api.github.com/repos/vinniefalco/Beast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vinniefalco/Beast/statuses/{sha}","languages_url":"https://api.github.com/repos/vinniefalco/Beast/languages","stargazers_url":"https://api.github.com/repos/vinniefalco/Beast/stargazers","contributors_url":"https://api.github.com/repos/vinniefalco/Beast/contributors","subscribers_url":"https://api.github.com/repos/vinniefalco/Beast/subscribers","subscription_url":"https://api.github.com/repos/vinniefalco/Beast/subscription","commits_url":"https://api.github.com/repos/vinniefalco/Beast/commits{/sha}","git_commits_url":"https://api.github.com/repos/vinniefalco/Beast/git/commits{/sha}","comments_url":"https://api.github.com/repos/vinniefalco/Beast/comments{/number}","issue_comment_url":"https://api.github.com/repos/vinniefalco/Beast/issues/comments{/number}","contents_url":"https://api.github.com/repos/vinniefalco/Beast/contents/{+path}","compare_url":"https://api.github.com/repos/vinniefalco/Beast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vinniefalco/Beast/merges","archive_url":"https://api.github.com/repos/vinniefalco/Beast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vinniefalco/Beast/downloads","issues_url":"https://api.github.com/repos/vinniefalco/Beast/issues{/number}","pulls_url":"https://api.github.com/repos/vinniefalco/Beast/pulls{/number}","milestones_url":"https://api.github.com/repos/vinniefalco/Beast/milestones{/number}","notifications_url":"https://api.github.com/repos/vinniefalco/Beast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vinniefalco/Beast/labels{/name}","releases_url":"https://api.github.com/repos/vinniefalco/Beast/releases{/id}","deployments_url":"https://api.github.com/repos/vinniefalco/Beast/deployments","created_at":"2013-06-16T22:26:09Z","updated_at":"2016-04-27T16:31:58Z","pushed_at":"2016-04-27T20:49:59Z","git_url":"git://github.com/vinniefalco/Beast.git","ssh_url":"git@github.com:vinniefalco/Beast.git","clone_url":"https://github.com/vinniefalco/Beast.git","svn_url":"https://github.com/vinniefalco/Beast","homepage":"http://vinniefalco.github.io/","size":7089,"stargazers_count":35,"watchers_count":35,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":3,"forks":10,"open_issues":3,"watchers":35,"default_branch":"master"}},"base":{"label":"vinniefalco:master","ref":"master","sha":"ba7031cb3b4840c1135515eccd77b002f2ceae9f","user":{"login":"vinniefalco","id":1503976,"avatar_url":"https://avatars.githubusercontent.com/u/1503976?v=3","gravatar_id":"","url":"https://api.github.com/users/vinniefalco","html_url":"https://github.com/vinniefalco","followers_url":"https://api.github.com/users/vinniefalco/followers","following_url":"https://api.github.com/users/vinniefalco/following{/other_user}","gists_url":"https://api.github.com/users/vinniefalco/gists{/gist_id}","starred_url":"https://api.github.com/users/vinniefalco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinniefalco/subscriptions","organizations_url":"https://api.github.com/users/vinniefalco/orgs","repos_url":"https://api.github.com/users/vinniefalco/repos","events_url":"https://api.github.com/users/vinniefalco/events{/privacy}","received_events_url":"https://api.github.com/users/vinniefalco/received_events","type":"User","site_admin":false},"repo":{"id":10726510,"name":"Beast","full_name":"vinniefalco/Beast","owner":{"login":"vinniefalco","id":1503976,"avatar_url":"https://avatars.githubusercontent.com/u/1503976?v=3","gravatar_id":"","url":"https://api.github.com/users/vinniefalco","html_url":"https://github.com/vinniefalco","followers_url":"https://api.github.com/users/vinniefalco/followers","following_url":"https://api.github.com/users/vinniefalco/following{/other_user}","gists_url":"https://api.github.com/users/vinniefalco/gists{/gist_id}","starred_url":"https://api.github.com/users/vinniefalco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinniefalco/subscriptions","organizations_url":"https://api.github.com/users/vinniefalco/orgs","repos_url":"https://api.github.com/users/vinniefalco/repos","events_url":"https://api.github.com/users/vinniefalco/events{/privacy}","received_events_url":"https://api.github.com/users/vinniefalco/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vinniefalco/Beast","description":"HTTP and WebSocket implementations built on Boost.Asio","fork":false,"url":"https://api.github.com/repos/vinniefalco/Beast","forks_url":"https://api.github.com/repos/vinniefalco/Beast/forks","keys_url":"https://api.github.com/repos/vinniefalco/Beast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vinniefalco/Beast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vinniefalco/Beast/teams","hooks_url":"https://api.github.com/repos/vinniefalco/Beast/hooks","issue_events_url":"https://api.github.com/repos/vinniefalco/Beast/issues/events{/number}","events_url":"https://api.github.com/repos/vinniefalco/Beast/events","assignees_url":"https://api.github.com/repos/vinniefalco/Beast/assignees{/user}","branches_url":"https://api.github.com/repos/vinniefalco/Beast/branches{/branch}","tags_url":"https://api.github.com/repos/vinniefalco/Beast/tags","blobs_url":"https://api.github.com/repos/vinniefalco/Beast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vinniefalco/Beast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vinniefalco/Beast/git/refs{/sha}","trees_url":"https://api.github.com/repos/vinniefalco/Beast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vinniefalco/Beast/statuses/{sha}","languages_url":"https://api.github.com/repos/vinniefalco/Beast/languages","stargazers_url":"https://api.github.com/repos/vinniefalco/Beast/stargazers","contributors_url":"https://api.github.com/repos/vinniefalco/Beast/contributors","subscribers_url":"https://api.github.com/repos/vinniefalco/Beast/subscribers","subscription_url":"https://api.github.com/repos/vinniefalco/Beast/subscription","commits_url":"https://api.github.com/repos/vinniefalco/Beast/commits{/sha}","git_commits_url":"https://api.github.com/repos/vinniefalco/Beast/git/commits{/sha}","comments_url":"https://api.github.com/repos/vinniefalco/Beast/comments{/number}","issue_comment_url":"https://api.github.com/repos/vinniefalco/Beast/issues/comments{/number}","contents_url":"https://api.github.com/repos/vinniefalco/Beast/contents/{+path}","compare_url":"https://api.github.com/repos/vinniefalco/Beast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vinniefalco/Beast/merges","archive_url":"https://api.github.com/repos/vinniefalco/Beast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vinniefalco/Beast/downloads","issues_url":"https://api.github.com/repos/vinniefalco/Beast/issues{/number}","pulls_url":"https://api.github.com/repos/vinniefalco/Beast/pulls{/number}","milestones_url":"https://api.github.com/repos/vinniefalco/Beast/milestones{/number}","notifications_url":"https://api.github.com/repos/vinniefalco/Beast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vinniefalco/Beast/labels{/name}","releases_url":"https://api.github.com/repos/vinniefalco/Beast/releases{/id}","deployments_url":"https://api.github.com/repos/vinniefalco/Beast/deployments","created_at":"2013-06-16T22:26:09Z","updated_at":"2016-04-27T16:31:58Z","pushed_at":"2016-04-27T20:49:59Z","git_url":"git://github.com/vinniefalco/Beast.git","ssh_url":"git@github.com:vinniefalco/Beast.git","clone_url":"https://github.com/vinniefalco/Beast.git","svn_url":"https://github.com/vinniefalco/Beast","homepage":"http://vinniefalco.github.io/","size":7089,"stargazers_count":35,"watchers_count":35,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":3,"forks":10,"open_issues":3,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vinniefalco/Beast/pulls/4"},"html":{"href":"https://github.com/vinniefalco/Beast/pull/4"},"issue":{"href":"https://api.github.com/repos/vinniefalco/Beast/issues/4"},"comments":{"href":"https://api.github.com/repos/vinniefalco/Beast/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/vinniefalco/Beast/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/vinniefalco/Beast/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vinniefalco/Beast/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/vinniefalco/Beast/statuses/b25ef3a1b8a6543d90b7a538f08d970ee73c357b"}}}}