{"action":"created","comment":{"url":"https://api.github.com/repos/luser/sccache2/pulls/comments/70647366","id":70647366,"diff_hunk":"@@ -687,19 +688,17 @@ impl<C : CommandCreatorSync + 'static> ClientConnection<C> {\n     /// If a full request was read, return `Ok(Some(ClientRequest))`.\n     /// If data was read but not a full request, return `Ok(None)`.\n     fn read(&mut self, event_loop : &mut EventLoop<SccacheServer<C>>) -> io::Result<Option<ClientRequest>> {\n-        //FIXME: use something from bytes:\n-        // http://carllerche.github.io/bytes/bytes/index.html\n-        let mut buf : [u8; 2048] = [0; 2048];\n+        let mut buf = ByteBuf::mut_with_capacity(2048);\n         loop {\n-            match self.sock.try_read(&mut buf) {\n+            match self.sock.try_read_buf(&mut buf) {\n                 Ok(None) => {\n                     // Read all available data.\n                     trace!(\"try_read returned Ok(None)\");\n                     break;\n                 },\n                 Ok(Some(n)) => {\n                     trace!(\"try_read read {} bytes\", n);\n-                    self.recv_buf.extend_from_slice(&buf[..n])\n+                    self.recv_buf.extend_from_slice(buf.bytes())","path":"src/server.rs","position":27,"original_position":27,"commit_id":"2032638c44d2d151a0d50dc2daa97eba6a3b3eac","original_commit_id":"2032638c44d2d151a0d50dc2daa97eba6a3b3eac","user":{"login":"luser","id":286001,"avatar_url":"https://avatars.githubusercontent.com/u/286001?v=3","gravatar_id":"","url":"https://api.github.com/users/luser","html_url":"https://github.com/luser","followers_url":"https://api.github.com/users/luser/followers","following_url":"https://api.github.com/users/luser/following{/other_user}","gists_url":"https://api.github.com/users/luser/gists{/gist_id}","starred_url":"https://api.github.com/users/luser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luser/subscriptions","organizations_url":"https://api.github.com/users/luser/orgs","repos_url":"https://api.github.com/users/luser/repos","events_url":"https://api.github.com/users/luser/events{/privacy}","received_events_url":"https://api.github.com/users/luser/received_events","type":"User","site_admin":false},"body":"I think what I was hoping to do here was to make `self.recv_buf` and `self.send_queue` into `MutByteBuf`, to make the logic around appending bytes and draining bytes cleaner. Does that make sense?","created_at":"2016-07-13T15:24:00Z","updated_at":"2016-07-13T15:24:00Z","html_url":"https://github.com/luser/sccache2/pull/17#discussion_r70647366","pull_request_url":"https://api.github.com/repos/luser/sccache2/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/luser/sccache2/pulls/comments/70647366"},"html":{"href":"https://github.com/luser/sccache2/pull/17#discussion_r70647366"},"pull_request":{"href":"https://api.github.com/repos/luser/sccache2/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/luser/sccache2/pulls/17","id":76883044,"html_url":"https://github.com/luser/sccache2/pull/17","diff_url":"https://github.com/luser/sccache2/pull/17.diff","patch_url":"https://github.com/luser/sccache2/pull/17.patch","issue_url":"https://api.github.com/repos/luser/sccache2/issues/17","number":17,"state":"open","locked":false,"title":"Use MutByteBuf","user":{"login":"F3real","id":7493206,"avatar_url":"https://avatars.githubusercontent.com/u/7493206?v=3","gravatar_id":"","url":"https://api.github.com/users/F3real","html_url":"https://github.com/F3real","followers_url":"https://api.github.com/users/F3real/followers","following_url":"https://api.github.com/users/F3real/following{/other_user}","gists_url":"https://api.github.com/users/F3real/gists{/gist_id}","starred_url":"https://api.github.com/users/F3real/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/F3real/subscriptions","organizations_url":"https://api.github.com/users/F3real/orgs","repos_url":"https://api.github.com/users/F3real/repos","events_url":"https://api.github.com/users/F3real/events{/privacy}","received_events_url":"https://api.github.com/users/F3real/received_events","type":"User","site_admin":false},"body":"Fixes #13 ","created_at":"2016-07-10T20:42:38Z","updated_at":"2016-07-13T15:24:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ed85c85da96dfa15962427964ef895eac426b41","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/luser/sccache2/pulls/17/commits","review_comments_url":"https://api.github.com/repos/luser/sccache2/pulls/17/comments","review_comment_url":"https://api.github.com/repos/luser/sccache2/pulls/comments{/number}","comments_url":"https://api.github.com/repos/luser/sccache2/issues/17/comments","statuses_url":"https://api.github.com/repos/luser/sccache2/statuses/2032638c44d2d151a0d50dc2daa97eba6a3b3eac","head":{"label":"F3real:buff","ref":"buff","sha":"2032638c44d2d151a0d50dc2daa97eba6a3b3eac","user":{"login":"F3real","id":7493206,"avatar_url":"https://avatars.githubusercontent.com/u/7493206?v=3","gravatar_id":"","url":"https://api.github.com/users/F3real","html_url":"https://github.com/F3real","followers_url":"https://api.github.com/users/F3real/followers","following_url":"https://api.github.com/users/F3real/following{/other_user}","gists_url":"https://api.github.com/users/F3real/gists{/gist_id}","starred_url":"https://api.github.com/users/F3real/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/F3real/subscriptions","organizations_url":"https://api.github.com/users/F3real/orgs","repos_url":"https://api.github.com/users/F3real/repos","events_url":"https://api.github.com/users/F3real/events{/privacy}","received_events_url":"https://api.github.com/users/F3real/received_events","type":"User","site_admin":false},"repo":{"id":61571822,"name":"sccache2","full_name":"F3real/sccache2","owner":{"login":"F3real","id":7493206,"avatar_url":"https://avatars.githubusercontent.com/u/7493206?v=3","gravatar_id":"","url":"https://api.github.com/users/F3real","html_url":"https://github.com/F3real","followers_url":"https://api.github.com/users/F3real/followers","following_url":"https://api.github.com/users/F3real/following{/other_user}","gists_url":"https://api.github.com/users/F3real/gists{/gist_id}","starred_url":"https://api.github.com/users/F3real/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/F3real/subscriptions","organizations_url":"https://api.github.com/users/F3real/orgs","repos_url":"https://api.github.com/users/F3real/repos","events_url":"https://api.github.com/users/F3real/events{/privacy}","received_events_url":"https://api.github.com/users/F3real/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/F3real/sccache2","description":"Rewrite of sccache in Rust","fork":true,"url":"https://api.github.com/repos/F3real/sccache2","forks_url":"https://api.github.com/repos/F3real/sccache2/forks","keys_url":"https://api.github.com/repos/F3real/sccache2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/F3real/sccache2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/F3real/sccache2/teams","hooks_url":"https://api.github.com/repos/F3real/sccache2/hooks","issue_events_url":"https://api.github.com/repos/F3real/sccache2/issues/events{/number}","events_url":"https://api.github.com/repos/F3real/sccache2/events","assignees_url":"https://api.github.com/repos/F3real/sccache2/assignees{/user}","branches_url":"https://api.github.com/repos/F3real/sccache2/branches{/branch}","tags_url":"https://api.github.com/repos/F3real/sccache2/tags","blobs_url":"https://api.github.com/repos/F3real/sccache2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/F3real/sccache2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/F3real/sccache2/git/refs{/sha}","trees_url":"https://api.github.com/repos/F3real/sccache2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/F3real/sccache2/statuses/{sha}","languages_url":"https://api.github.com/repos/F3real/sccache2/languages","stargazers_url":"https://api.github.com/repos/F3real/sccache2/stargazers","contributors_url":"https://api.github.com/repos/F3real/sccache2/contributors","subscribers_url":"https://api.github.com/repos/F3real/sccache2/subscribers","subscription_url":"https://api.github.com/repos/F3real/sccache2/subscription","commits_url":"https://api.github.com/repos/F3real/sccache2/commits{/sha}","git_commits_url":"https://api.github.com/repos/F3real/sccache2/git/commits{/sha}","comments_url":"https://api.github.com/repos/F3real/sccache2/comments{/number}","issue_comment_url":"https://api.github.com/repos/F3real/sccache2/issues/comments{/number}","contents_url":"https://api.github.com/repos/F3real/sccache2/contents/{+path}","compare_url":"https://api.github.com/repos/F3real/sccache2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/F3real/sccache2/merges","archive_url":"https://api.github.com/repos/F3real/sccache2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/F3real/sccache2/downloads","issues_url":"https://api.github.com/repos/F3real/sccache2/issues{/number}","pulls_url":"https://api.github.com/repos/F3real/sccache2/pulls{/number}","milestones_url":"https://api.github.com/repos/F3real/sccache2/milestones{/number}","notifications_url":"https://api.github.com/repos/F3real/sccache2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/F3real/sccache2/labels{/name}","releases_url":"https://api.github.com/repos/F3real/sccache2/releases{/id}","deployments_url":"https://api.github.com/repos/F3real/sccache2/deployments","created_at":"2016-06-20T18:44:22Z","updated_at":"2016-06-20T18:44:23Z","pushed_at":"2016-07-10T20:40:54Z","git_url":"git://github.com/F3real/sccache2.git","ssh_url":"git@github.com:F3real/sccache2.git","clone_url":"https://github.com/F3real/sccache2.git","svn_url":"https://github.com/F3real/sccache2","homepage":null,"size":194,"stargazers_count":0,"watchers_count":0,"language":"Rust","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":"luser:master","ref":"master","sha":"05589919738920383a9ff24fd5cb391e6b8dbb06","user":{"login":"luser","id":286001,"avatar_url":"https://avatars.githubusercontent.com/u/286001?v=3","gravatar_id":"","url":"https://api.github.com/users/luser","html_url":"https://github.com/luser","followers_url":"https://api.github.com/users/luser/followers","following_url":"https://api.github.com/users/luser/following{/other_user}","gists_url":"https://api.github.com/users/luser/gists{/gist_id}","starred_url":"https://api.github.com/users/luser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luser/subscriptions","organizations_url":"https://api.github.com/users/luser/orgs","repos_url":"https://api.github.com/users/luser/repos","events_url":"https://api.github.com/users/luser/events{/privacy}","received_events_url":"https://api.github.com/users/luser/received_events","type":"User","site_admin":false},"repo":{"id":57160728,"name":"sccache2","full_name":"luser/sccache2","owner":{"login":"luser","id":286001,"avatar_url":"https://avatars.githubusercontent.com/u/286001?v=3","gravatar_id":"","url":"https://api.github.com/users/luser","html_url":"https://github.com/luser","followers_url":"https://api.github.com/users/luser/followers","following_url":"https://api.github.com/users/luser/following{/other_user}","gists_url":"https://api.github.com/users/luser/gists{/gist_id}","starred_url":"https://api.github.com/users/luser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luser/subscriptions","organizations_url":"https://api.github.com/users/luser/orgs","repos_url":"https://api.github.com/users/luser/repos","events_url":"https://api.github.com/users/luser/events{/privacy}","received_events_url":"https://api.github.com/users/luser/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/luser/sccache2","description":"Rewrite of sccache in Rust","fork":false,"url":"https://api.github.com/repos/luser/sccache2","forks_url":"https://api.github.com/repos/luser/sccache2/forks","keys_url":"https://api.github.com/repos/luser/sccache2/keys{/key_id}","collaborators_url":"https://api.github.com/repos/luser/sccache2/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/luser/sccache2/teams","hooks_url":"https://api.github.com/repos/luser/sccache2/hooks","issue_events_url":"https://api.github.com/repos/luser/sccache2/issues/events{/number}","events_url":"https://api.github.com/repos/luser/sccache2/events","assignees_url":"https://api.github.com/repos/luser/sccache2/assignees{/user}","branches_url":"https://api.github.com/repos/luser/sccache2/branches{/branch}","tags_url":"https://api.github.com/repos/luser/sccache2/tags","blobs_url":"https://api.github.com/repos/luser/sccache2/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/luser/sccache2/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/luser/sccache2/git/refs{/sha}","trees_url":"https://api.github.com/repos/luser/sccache2/git/trees{/sha}","statuses_url":"https://api.github.com/repos/luser/sccache2/statuses/{sha}","languages_url":"https://api.github.com/repos/luser/sccache2/languages","stargazers_url":"https://api.github.com/repos/luser/sccache2/stargazers","contributors_url":"https://api.github.com/repos/luser/sccache2/contributors","subscribers_url":"https://api.github.com/repos/luser/sccache2/subscribers","subscription_url":"https://api.github.com/repos/luser/sccache2/subscription","commits_url":"https://api.github.com/repos/luser/sccache2/commits{/sha}","git_commits_url":"https://api.github.com/repos/luser/sccache2/git/commits{/sha}","comments_url":"https://api.github.com/repos/luser/sccache2/comments{/number}","issue_comment_url":"https://api.github.com/repos/luser/sccache2/issues/comments{/number}","contents_url":"https://api.github.com/repos/luser/sccache2/contents/{+path}","compare_url":"https://api.github.com/repos/luser/sccache2/compare/{base}...{head}","merges_url":"https://api.github.com/repos/luser/sccache2/merges","archive_url":"https://api.github.com/repos/luser/sccache2/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/luser/sccache2/downloads","issues_url":"https://api.github.com/repos/luser/sccache2/issues{/number}","pulls_url":"https://api.github.com/repos/luser/sccache2/pulls{/number}","milestones_url":"https://api.github.com/repos/luser/sccache2/milestones{/number}","notifications_url":"https://api.github.com/repos/luser/sccache2/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/luser/sccache2/labels{/name}","releases_url":"https://api.github.com/repos/luser/sccache2/releases{/id}","deployments_url":"https://api.github.com/repos/luser/sccache2/deployments","created_at":"2016-04-26T20:44:16Z","updated_at":"2016-07-08T03:13:45Z","pushed_at":"2016-07-10T20:42:39Z","git_url":"git://github.com/luser/sccache2.git","ssh_url":"git@github.com:luser/sccache2.git","clone_url":"https://github.com/luser/sccache2.git","svn_url":"https://github.com/luser/sccache2","homepage":null,"size":199,"stargazers_count":1,"watchers_count":1,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":10,"forks":1,"open_issues":10,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/luser/sccache2/pulls/17"},"html":{"href":"https://github.com/luser/sccache2/pull/17"},"issue":{"href":"https://api.github.com/repos/luser/sccache2/issues/17"},"comments":{"href":"https://api.github.com/repos/luser/sccache2/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/luser/sccache2/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/luser/sccache2/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/luser/sccache2/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/luser/sccache2/statuses/2032638c44d2d151a0d50dc2daa97eba6a3b3eac"}}}}
{"actor":{"display_login":"luser"}}