{"action":"created","comment":{"url":"https://api.github.com/repos/hoaproject/Blog/pulls/comments/70326596","id":70326596,"diff_hunk":"@@ -0,0 +1,175 @@\n+<?xml version=\"1.0\" encoding=\"utf-8\"?>\n+<?xyl-overlay href=\"hoa://Application/Overlays/Article.xyl\"?>\n+<?xyl-meta name=\"title\" value=\"WebSocket, safety, stability and performance\"?>\n+<?xyl-meta name=\"date\" value=\"2016-07-11T07:54:50+02:00\"?>\n+\n+<overlay xmlns=\"http://hoa-project.net/xyl/xylophone\">\n+  <article id=\"main\">\n+    <p>\n+      Since several weeks, we were working hard on\n+      <a href=\"http://central.hoa-project.net/Resource/Library/Websocket\">the\n+      <code>Hoa\\Websocket</code> library</a> test suites, including both unit\n+      and integration test suites. Stability and performance have been good\n+      goals too. This article presents what we have accomplished, the bugs that\n+      have been found and how complementary tests are.\n+    </p>\n+\n+    <h2>Bugs found</h2>\n+\n+    <p>\n+      Long story short, <strong>2 important bugs have been found and\n+      fixed</strong> with these new test suites, despite the fact we were\n+      using another integration test suite before.\n+    </p>\n+    <p>\n+      Before our own test suites, we were using the famous\n+      <a href=\"http://autobahn.ws/testsuite/\">Autobahn test suite</a>. It works\n+      great and this is a good tool used by major vendors like Mozilla, Google,\n+      Apple, Microsoft, Facebook and more. It validates several aspects of the\n+      standard (<a href=\"https://tools.ietf.org/html/rfc6455\">RFC6455</a>) in\n+      addition to “industrial aspects” (real usecases that are important in\n+      practice). But tests are not demonstrating the absence of bugs at all.\n+      Moreover, it was hard to set up Autobahn for new comers: This is in\n+      Python (we are in PHP) and this is not in our devtools box; 2 factors that\n+      form an obstacle for new contributor. So we decided some months ago to\n+      “migrate” this test suite into our own test suite. The work has been split\n+      into 2 chapters:\n+    </p>\n+    <ol>\n+      <li>Write <strong>unit test suites</strong> from scratch, and</li>\n+      <li>Migrate the Autobahn <strong>integration test suites</strong>.</li>\n+    </ol>\n+    <p>Let's describe quickly the bugs that have been found and fixed.</p>\n+    <p>\n+      The most important bug found concerns the RFC6455 protocol. As a reminder,\n+      <code>Hoa\\Websocket</code> supports two WebSocket protocols: The standard\n+      one (RFC6455) and the old one (Hybi00) for compatibility reasons. When\n+      reading a frame, it is required to start reading the “headers” of the\n+      message before reading the real message. Only the required bytes were read\n+      when needed. This was an error in a specific edge-case: When the message\n+      was empty, the algorithm was returning earlier, letting one part of the\n+      frame into the network buffer. So the next call to the algorithm was\n+      reading invalid data. This is important to consume the whole frame each\n+      time.\n+    </p>\n+    <p>\n+      This bug has been revealed by the integration test suite when reading\n+      consecutive empty messages. It has not been revealed by the Autobahn test\n+      suite while it has this test case! See\n+      <a href=\"https://github.com/hoaproject/Websocket/commit/d54553799867c2fe8ac2f21ff92e53430ccdd6ce\">the\n+      commit fixing the bug</a>.\n+    </p>\n+    <p>\n+      The second bug was not as much critical as the first one. It concerns a\n+      too strict constraint checking UTF-8 validity. You may know that all\n+      WebSocket messages must be UTF-8 encoded, so <code>Hoa\\Websocket</code>\n+      checks this constraint when sending and when receiving a message.\n+      Checking this at sending avoids having invalid data on network, then it\n+      sounds like a good idea, isn't it? Actually no. A message can be split\n+      into arbitrary fragments. Thus each fragment may contain invalid UTF-8\n+      data; but at the end, when all fragments have been received and the","path":"Source/Posts/2016/07-WebSocket-safety-stability-and-performance.xyl","position":70,"original_position":70,"commit_id":"f00cfaaed5679858d1e2b482ee3572c16bab51c7","original_commit_id":"f00cfaaed5679858d1e2b482ee3572c16bab51c7","user":{"login":"jubianchi","id":327237,"avatar_url":"https://avatars.githubusercontent.com/u/327237?v=3","gravatar_id":"","url":"https://api.github.com/users/jubianchi","html_url":"https://github.com/jubianchi","followers_url":"https://api.github.com/users/jubianchi/followers","following_url":"https://api.github.com/users/jubianchi/following{/other_user}","gists_url":"https://api.github.com/users/jubianchi/gists{/gist_id}","starred_url":"https://api.github.com/users/jubianchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jubianchi/subscriptions","organizations_url":"https://api.github.com/users/jubianchi/orgs","repos_url":"https://api.github.com/users/jubianchi/repos","events_url":"https://api.github.com/users/jubianchi/events{/privacy}","received_events_url":"https://api.github.com/users/jubianchi/received_events","type":"User","site_admin":false},"body":"```diff\r\n- but at the end\r\n+ but in the end\r\n```","created_at":"2016-07-11T20:05:46Z","updated_at":"2016-07-11T20:05:46Z","html_url":"https://github.com/hoaproject/Blog/pull/3#discussion_r70326596","pull_request_url":"https://api.github.com/repos/hoaproject/Blog/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/hoaproject/Blog/pulls/comments/70326596"},"html":{"href":"https://github.com/hoaproject/Blog/pull/3#discussion_r70326596"},"pull_request":{"href":"https://api.github.com/repos/hoaproject/Blog/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/hoaproject/Blog/pulls/3","id":76909931,"html_url":"https://github.com/hoaproject/Blog/pull/3","diff_url":"https://github.com/hoaproject/Blog/pull/3.diff","patch_url":"https://github.com/hoaproject/Blog/pull/3.patch","issue_url":"https://api.github.com/repos/hoaproject/Blog/issues/3","number":3,"state":"open","locked":false,"title":"Post: WebSocket, safety and performance","user":{"login":"Hywan","id":946104,"avatar_url":"https://avatars.githubusercontent.com/u/946104?v=3","gravatar_id":"","url":"https://api.github.com/users/Hywan","html_url":"https://github.com/Hywan","followers_url":"https://api.github.com/users/Hywan/followers","following_url":"https://api.github.com/users/Hywan/following{/other_user}","gists_url":"https://api.github.com/users/Hywan/gists{/gist_id}","starred_url":"https://api.github.com/users/Hywan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hywan/subscriptions","organizations_url":"https://api.github.com/users/Hywan/orgs","repos_url":"https://api.github.com/users/Hywan/repos","events_url":"https://api.github.com/users/Hywan/events{/privacy}","received_events_url":"https://api.github.com/users/Hywan/received_events","type":"User","site_admin":false},"body":"New blog post about recent work on the `Hoa\\Websocket` library.","created_at":"2016-07-11T07:28:17Z","updated_at":"2016-07-11T20:05:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a2d451c4e5f411295d67b9645e85861e34bf8c02","assignee":{"login":"osaris","id":125797,"avatar_url":"https://avatars.githubusercontent.com/u/125797?v=3","gravatar_id":"","url":"https://api.github.com/users/osaris","html_url":"https://github.com/osaris","followers_url":"https://api.github.com/users/osaris/followers","following_url":"https://api.github.com/users/osaris/following{/other_user}","gists_url":"https://api.github.com/users/osaris/gists{/gist_id}","starred_url":"https://api.github.com/users/osaris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osaris/subscriptions","organizations_url":"https://api.github.com/users/osaris/orgs","repos_url":"https://api.github.com/users/osaris/repos","events_url":"https://api.github.com/users/osaris/events{/privacy}","received_events_url":"https://api.github.com/users/osaris/received_events","type":"User","site_admin":false},"assignees":[{"login":"osaris","id":125797,"avatar_url":"https://avatars.githubusercontent.com/u/125797?v=3","gravatar_id":"","url":"https://api.github.com/users/osaris","html_url":"https://github.com/osaris","followers_url":"https://api.github.com/users/osaris/followers","following_url":"https://api.github.com/users/osaris/following{/other_user}","gists_url":"https://api.github.com/users/osaris/gists{/gist_id}","starred_url":"https://api.github.com/users/osaris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osaris/subscriptions","organizations_url":"https://api.github.com/users/osaris/orgs","repos_url":"https://api.github.com/users/osaris/repos","events_url":"https://api.github.com/users/osaris/events{/privacy}","received_events_url":"https://api.github.com/users/osaris/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/hoaproject/Blog/pulls/3/commits","review_comments_url":"https://api.github.com/repos/hoaproject/Blog/pulls/3/comments","review_comment_url":"https://api.github.com/repos/hoaproject/Blog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hoaproject/Blog/issues/3/comments","statuses_url":"https://api.github.com/repos/hoaproject/Blog/statuses/f00cfaaed5679858d1e2b482ee3572c16bab51c7","head":{"label":"Hywan:post_websocket.xyl","ref":"post_websocket.xyl","sha":"f00cfaaed5679858d1e2b482ee3572c16bab51c7","user":{"login":"Hywan","id":946104,"avatar_url":"https://avatars.githubusercontent.com/u/946104?v=3","gravatar_id":"","url":"https://api.github.com/users/Hywan","html_url":"https://github.com/Hywan","followers_url":"https://api.github.com/users/Hywan/followers","following_url":"https://api.github.com/users/Hywan/following{/other_user}","gists_url":"https://api.github.com/users/Hywan/gists{/gist_id}","starred_url":"https://api.github.com/users/Hywan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hywan/subscriptions","organizations_url":"https://api.github.com/users/Hywan/orgs","repos_url":"https://api.github.com/users/Hywan/repos","events_url":"https://api.github.com/users/Hywan/events{/privacy}","received_events_url":"https://api.github.com/users/Hywan/received_events","type":"User","site_admin":false},"repo":{"id":59109847,"name":"Blog","full_name":"Hywan/Blog","owner":{"login":"Hywan","id":946104,"avatar_url":"https://avatars.githubusercontent.com/u/946104?v=3","gravatar_id":"","url":"https://api.github.com/users/Hywan","html_url":"https://github.com/Hywan","followers_url":"https://api.github.com/users/Hywan/followers","following_url":"https://api.github.com/users/Hywan/following{/other_user}","gists_url":"https://api.github.com/users/Hywan/gists{/gist_id}","starred_url":"https://api.github.com/users/Hywan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hywan/subscriptions","organizations_url":"https://api.github.com/users/Hywan/orgs","repos_url":"https://api.github.com/users/Hywan/repos","events_url":"https://api.github.com/users/Hywan/events{/privacy}","received_events_url":"https://api.github.com/users/Hywan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Hywan/Blog","description":"Blog of the Hoa project","fork":true,"url":"https://api.github.com/repos/Hywan/Blog","forks_url":"https://api.github.com/repos/Hywan/Blog/forks","keys_url":"https://api.github.com/repos/Hywan/Blog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Hywan/Blog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Hywan/Blog/teams","hooks_url":"https://api.github.com/repos/Hywan/Blog/hooks","issue_events_url":"https://api.github.com/repos/Hywan/Blog/issues/events{/number}","events_url":"https://api.github.com/repos/Hywan/Blog/events","assignees_url":"https://api.github.com/repos/Hywan/Blog/assignees{/user}","branches_url":"https://api.github.com/repos/Hywan/Blog/branches{/branch}","tags_url":"https://api.github.com/repos/Hywan/Blog/tags","blobs_url":"https://api.github.com/repos/Hywan/Blog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Hywan/Blog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Hywan/Blog/git/refs{/sha}","trees_url":"https://api.github.com/repos/Hywan/Blog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Hywan/Blog/statuses/{sha}","languages_url":"https://api.github.com/repos/Hywan/Blog/languages","stargazers_url":"https://api.github.com/repos/Hywan/Blog/stargazers","contributors_url":"https://api.github.com/repos/Hywan/Blog/contributors","subscribers_url":"https://api.github.com/repos/Hywan/Blog/subscribers","subscription_url":"https://api.github.com/repos/Hywan/Blog/subscription","commits_url":"https://api.github.com/repos/Hywan/Blog/commits{/sha}","git_commits_url":"https://api.github.com/repos/Hywan/Blog/git/commits{/sha}","comments_url":"https://api.github.com/repos/Hywan/Blog/comments{/number}","issue_comment_url":"https://api.github.com/repos/Hywan/Blog/issues/comments{/number}","contents_url":"https://api.github.com/repos/Hywan/Blog/contents/{+path}","compare_url":"https://api.github.com/repos/Hywan/Blog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Hywan/Blog/merges","archive_url":"https://api.github.com/repos/Hywan/Blog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Hywan/Blog/downloads","issues_url":"https://api.github.com/repos/Hywan/Blog/issues{/number}","pulls_url":"https://api.github.com/repos/Hywan/Blog/pulls{/number}","milestones_url":"https://api.github.com/repos/Hywan/Blog/milestones{/number}","notifications_url":"https://api.github.com/repos/Hywan/Blog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Hywan/Blog/labels{/name}","releases_url":"https://api.github.com/repos/Hywan/Blog/releases{/id}","deployments_url":"https://api.github.com/repos/Hywan/Blog/deployments","created_at":"2016-05-18T11:34:17Z","updated_at":"2016-05-18T11:34:18Z","pushed_at":"2016-07-11T19:31:23Z","git_url":"git://github.com/Hywan/Blog.git","ssh_url":"git@github.com:Hywan/Blog.git","clone_url":"https://github.com/Hywan/Blog.git","svn_url":"https://github.com/Hywan/Blog","homepage":null,"size":190,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hoaproject:master","ref":"master","sha":"c9c16d18d4dae749d8a7ed0bb6c2ff0a3453ed59","user":{"login":"hoaproject","id":1519718,"avatar_url":"https://avatars.githubusercontent.com/u/1519718?v=3","gravatar_id":"","url":"https://api.github.com/users/hoaproject","html_url":"https://github.com/hoaproject","followers_url":"https://api.github.com/users/hoaproject/followers","following_url":"https://api.github.com/users/hoaproject/following{/other_user}","gists_url":"https://api.github.com/users/hoaproject/gists{/gist_id}","starred_url":"https://api.github.com/users/hoaproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoaproject/subscriptions","organizations_url":"https://api.github.com/users/hoaproject/orgs","repos_url":"https://api.github.com/users/hoaproject/repos","events_url":"https://api.github.com/users/hoaproject/events{/privacy}","received_events_url":"https://api.github.com/users/hoaproject/received_events","type":"Organization","site_admin":false},"repo":{"id":58441198,"name":"Blog","full_name":"hoaproject/Blog","owner":{"login":"hoaproject","id":1519718,"avatar_url":"https://avatars.githubusercontent.com/u/1519718?v=3","gravatar_id":"","url":"https://api.github.com/users/hoaproject","html_url":"https://github.com/hoaproject","followers_url":"https://api.github.com/users/hoaproject/followers","following_url":"https://api.github.com/users/hoaproject/following{/other_user}","gists_url":"https://api.github.com/users/hoaproject/gists{/gist_id}","starred_url":"https://api.github.com/users/hoaproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoaproject/subscriptions","organizations_url":"https://api.github.com/users/hoaproject/orgs","repos_url":"https://api.github.com/users/hoaproject/repos","events_url":"https://api.github.com/users/hoaproject/events{/privacy}","received_events_url":"https://api.github.com/users/hoaproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hoaproject/Blog","description":"Blog of the Hoa project","fork":false,"url":"https://api.github.com/repos/hoaproject/Blog","forks_url":"https://api.github.com/repos/hoaproject/Blog/forks","keys_url":"https://api.github.com/repos/hoaproject/Blog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hoaproject/Blog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hoaproject/Blog/teams","hooks_url":"https://api.github.com/repos/hoaproject/Blog/hooks","issue_events_url":"https://api.github.com/repos/hoaproject/Blog/issues/events{/number}","events_url":"https://api.github.com/repos/hoaproject/Blog/events","assignees_url":"https://api.github.com/repos/hoaproject/Blog/assignees{/user}","branches_url":"https://api.github.com/repos/hoaproject/Blog/branches{/branch}","tags_url":"https://api.github.com/repos/hoaproject/Blog/tags","blobs_url":"https://api.github.com/repos/hoaproject/Blog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hoaproject/Blog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hoaproject/Blog/git/refs{/sha}","trees_url":"https://api.github.com/repos/hoaproject/Blog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hoaproject/Blog/statuses/{sha}","languages_url":"https://api.github.com/repos/hoaproject/Blog/languages","stargazers_url":"https://api.github.com/repos/hoaproject/Blog/stargazers","contributors_url":"https://api.github.com/repos/hoaproject/Blog/contributors","subscribers_url":"https://api.github.com/repos/hoaproject/Blog/subscribers","subscription_url":"https://api.github.com/repos/hoaproject/Blog/subscription","commits_url":"https://api.github.com/repos/hoaproject/Blog/commits{/sha}","git_commits_url":"https://api.github.com/repos/hoaproject/Blog/git/commits{/sha}","comments_url":"https://api.github.com/repos/hoaproject/Blog/comments{/number}","issue_comment_url":"https://api.github.com/repos/hoaproject/Blog/issues/comments{/number}","contents_url":"https://api.github.com/repos/hoaproject/Blog/contents/{+path}","compare_url":"https://api.github.com/repos/hoaproject/Blog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hoaproject/Blog/merges","archive_url":"https://api.github.com/repos/hoaproject/Blog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hoaproject/Blog/downloads","issues_url":"https://api.github.com/repos/hoaproject/Blog/issues{/number}","pulls_url":"https://api.github.com/repos/hoaproject/Blog/pulls{/number}","milestones_url":"https://api.github.com/repos/hoaproject/Blog/milestones{/number}","notifications_url":"https://api.github.com/repos/hoaproject/Blog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hoaproject/Blog/labels{/name}","releases_url":"https://api.github.com/repos/hoaproject/Blog/releases{/id}","deployments_url":"https://api.github.com/repos/hoaproject/Blog/deployments","created_at":"2016-05-10T07:59:55Z","updated_at":"2016-07-11T14:16:26Z","pushed_at":"2016-07-11T19:31:23Z","git_url":"git://github.com/hoaproject/Blog.git","ssh_url":"git@github.com:hoaproject/Blog.git","clone_url":"https://github.com/hoaproject/Blog.git","svn_url":"https://github.com/hoaproject/Blog","homepage":null,"size":186,"stargazers_count":2,"watchers_count":2,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hoaproject/Blog/pulls/3"},"html":{"href":"https://github.com/hoaproject/Blog/pull/3"},"issue":{"href":"https://api.github.com/repos/hoaproject/Blog/issues/3"},"comments":{"href":"https://api.github.com/repos/hoaproject/Blog/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/hoaproject/Blog/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/hoaproject/Blog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hoaproject/Blog/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/hoaproject/Blog/statuses/f00cfaaed5679858d1e2b482ee3572c16bab51c7"}}}}
{"actor":{"display_login":"jubianchi"}}