{"action":"created","comment":{"url":"https://api.github.com/repos/sozu-proxy/lapin/pulls/comments/183293586","pull_request_review_id":114263189,"id":183293586,"diff_hunk":"@@ -541,14 +541,22 @@ impl Connection {\n       channel.state.clone()\n     }).unwrap();\n     if let ChannelState::WillReceiveContent(queue_name, consumer_tag) = state {\n-      self.set_channel_state(channel_id, ChannelState::ReceivingContent(queue_name.clone(), consumer_tag.clone(), size as usize));\n+      if size > 0 {\n+        self.set_channel_state(channel_id, ChannelState::ReceivingContent(queue_name.clone(), consumer_tag.clone(), size as usize));\n+      } else {\n+        self.set_channel_state(channel_id, ChannelState::Connected);\n+      }\n       if let Some(ref mut c) = self.channels.get_mut(&channel_id) {\n         if let Some(ref mut q) = c.queues.get_mut(&queue_name) {\n           if let Some(ref consumer_tag) = consumer_tag {\n             if let Some(ref mut cs) = q.consumers.get_mut(consumer_tag) {\n               if let Some(msg) = cs.current_message.as_mut() {\n                 msg.properties = properties;\n               }\n+              if size == 0 {\n+                let message = cs.current_message.take().expect(\"there should be an in flight message in the consumer\");\n+                cs.messages.push_back(message);\n+              }","path":"async/src/connection.rs","position":20,"original_position":20,"commit_id":"ed02746062114a7464a058ba836ef2bb73caa3ad","original_commit_id":"f9270cb08de0cf814b3a58d382f75faa8522e772","user":{"login":"Keruspe","id":222942,"avatar_url":"https://avatars0.githubusercontent.com/u/222942?v=4","gravatar_id":"","url":"https://api.github.com/users/Keruspe","html_url":"https://github.com/Keruspe","followers_url":"https://api.github.com/users/Keruspe/followers","following_url":"https://api.github.com/users/Keruspe/following{/other_user}","gists_url":"https://api.github.com/users/Keruspe/gists{/gist_id}","starred_url":"https://api.github.com/users/Keruspe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Keruspe/subscriptions","organizations_url":"https://api.github.com/users/Keruspe/orgs","repos_url":"https://api.github.com/users/Keruspe/repos","events_url":"https://api.github.com/users/Keruspe/events{/privacy}","received_events_url":"https://api.github.com/users/Keruspe/received_events","type":"User","site_admin":false},"body":"I think you're missing the same block for basic get just a couple of lines below?","created_at":"2018-04-23T07:10:41Z","updated_at":"2018-04-23T07:10:42Z","html_url":"https://github.com/sozu-proxy/lapin/pull/97#discussion_r183293586","pull_request_url":"https://api.github.com/repos/sozu-proxy/lapin/pulls/97","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/sozu-proxy/lapin/pulls/comments/183293586"},"html":{"href":"https://github.com/sozu-proxy/lapin/pull/97#discussion_r183293586"},"pull_request":{"href":"https://api.github.com/repos/sozu-proxy/lapin/pulls/97"}}},"pull_request":{"url":"https://api.github.com/repos/sozu-proxy/lapin/pulls/97","id":179982206,"html_url":"https://github.com/sozu-proxy/lapin/pull/97","diff_url":"https://github.com/sozu-proxy/lapin/pull/97.diff","patch_url":"https://github.com/sozu-proxy/lapin/pull/97.patch","issue_url":"https://api.github.com/repos/sozu-proxy/lapin/issues/97","number":97,"state":"open","locked":false,"title":"Fix basic consume empty payload","user":{"login":"kureuil","id":1275463,"avatar_url":"https://avatars1.githubusercontent.com/u/1275463?v=4","gravatar_id":"","url":"https://api.github.com/users/kureuil","html_url":"https://github.com/kureuil","followers_url":"https://api.github.com/users/kureuil/followers","following_url":"https://api.github.com/users/kureuil/following{/other_user}","gists_url":"https://api.github.com/users/kureuil/gists{/gist_id}","starred_url":"https://api.github.com/users/kureuil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kureuil/subscriptions","organizations_url":"https://api.github.com/users/kureuil/orgs","repos_url":"https://api.github.com/users/kureuil/repos","events_url":"https://api.github.com/users/kureuil/events{/privacy}","received_events_url":"https://api.github.com/users/kureuil/received_events","type":"User","site_admin":false},"body":"While consuming a message, if a delivery has a payload size of 0 RabbitMQ won't send a body frame. Lapin expected a body frame for all deliveries and hanged up on the connection, blocking the consumer.\r\n\r\nThe tests included in this PR are directly testing the state machine but I'm open to change them to communicate with an external broker process if you prefer.","created_at":"2018-04-06T15:31:43Z","updated_at":"2018-04-23T07:10:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d0428551318a08bc87799d8a09f19d7e3306f875","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sozu-proxy/lapin/pulls/97/commits","review_comments_url":"https://api.github.com/repos/sozu-proxy/lapin/pulls/97/comments","review_comment_url":"https://api.github.com/repos/sozu-proxy/lapin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sozu-proxy/lapin/issues/97/comments","statuses_url":"https://api.github.com/repos/sozu-proxy/lapin/statuses/ed02746062114a7464a058ba836ef2bb73caa3ad","head":{"label":"kureuil:fix-basic-consume-empty-payload","ref":"fix-basic-consume-empty-payload","sha":"ed02746062114a7464a058ba836ef2bb73caa3ad","user":{"login":"kureuil","id":1275463,"avatar_url":"https://avatars1.githubusercontent.com/u/1275463?v=4","gravatar_id":"","url":"https://api.github.com/users/kureuil","html_url":"https://github.com/kureuil","followers_url":"https://api.github.com/users/kureuil/followers","following_url":"https://api.github.com/users/kureuil/following{/other_user}","gists_url":"https://api.github.com/users/kureuil/gists{/gist_id}","starred_url":"https://api.github.com/users/kureuil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kureuil/subscriptions","organizations_url":"https://api.github.com/users/kureuil/orgs","repos_url":"https://api.github.com/users/kureuil/repos","events_url":"https://api.github.com/users/kureuil/events{/privacy}","received_events_url":"https://api.github.com/users/kureuil/received_events","type":"User","site_admin":false},"repo":{"id":128407840,"name":"lapin","full_name":"kureuil/lapin","owner":{"login":"kureuil","id":1275463,"avatar_url":"https://avatars1.githubusercontent.com/u/1275463?v=4","gravatar_id":"","url":"https://api.github.com/users/kureuil","html_url":"https://github.com/kureuil","followers_url":"https://api.github.com/users/kureuil/followers","following_url":"https://api.github.com/users/kureuil/following{/other_user}","gists_url":"https://api.github.com/users/kureuil/gists{/gist_id}","starred_url":"https://api.github.com/users/kureuil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kureuil/subscriptions","organizations_url":"https://api.github.com/users/kureuil/orgs","repos_url":"https://api.github.com/users/kureuil/repos","events_url":"https://api.github.com/users/kureuil/events{/privacy}","received_events_url":"https://api.github.com/users/kureuil/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kureuil/lapin","description":"AMQP client library in Rust, with a clean, futures based API","fork":true,"url":"https://api.github.com/repos/kureuil/lapin","forks_url":"https://api.github.com/repos/kureuil/lapin/forks","keys_url":"https://api.github.com/repos/kureuil/lapin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kureuil/lapin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kureuil/lapin/teams","hooks_url":"https://api.github.com/repos/kureuil/lapin/hooks","issue_events_url":"https://api.github.com/repos/kureuil/lapin/issues/events{/number}","events_url":"https://api.github.com/repos/kureuil/lapin/events","assignees_url":"https://api.github.com/repos/kureuil/lapin/assignees{/user}","branches_url":"https://api.github.com/repos/kureuil/lapin/branches{/branch}","tags_url":"https://api.github.com/repos/kureuil/lapin/tags","blobs_url":"https://api.github.com/repos/kureuil/lapin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kureuil/lapin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kureuil/lapin/git/refs{/sha}","trees_url":"https://api.github.com/repos/kureuil/lapin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kureuil/lapin/statuses/{sha}","languages_url":"https://api.github.com/repos/kureuil/lapin/languages","stargazers_url":"https://api.github.com/repos/kureuil/lapin/stargazers","contributors_url":"https://api.github.com/repos/kureuil/lapin/contributors","subscribers_url":"https://api.github.com/repos/kureuil/lapin/subscribers","subscription_url":"https://api.github.com/repos/kureuil/lapin/subscription","commits_url":"https://api.github.com/repos/kureuil/lapin/commits{/sha}","git_commits_url":"https://api.github.com/repos/kureuil/lapin/git/commits{/sha}","comments_url":"https://api.github.com/repos/kureuil/lapin/comments{/number}","issue_comment_url":"https://api.github.com/repos/kureuil/lapin/issues/comments{/number}","contents_url":"https://api.github.com/repos/kureuil/lapin/contents/{+path}","compare_url":"https://api.github.com/repos/kureuil/lapin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kureuil/lapin/merges","archive_url":"https://api.github.com/repos/kureuil/lapin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kureuil/lapin/downloads","issues_url":"https://api.github.com/repos/kureuil/lapin/issues{/number}","pulls_url":"https://api.github.com/repos/kureuil/lapin/pulls{/number}","milestones_url":"https://api.github.com/repos/kureuil/lapin/milestones{/number}","notifications_url":"https://api.github.com/repos/kureuil/lapin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kureuil/lapin/labels{/name}","releases_url":"https://api.github.com/repos/kureuil/lapin/releases{/id}","deployments_url":"https://api.github.com/repos/kureuil/lapin/deployments","created_at":"2018-04-06T14:47:35Z","updated_at":"2018-04-06T14:47:37Z","pushed_at":"2018-04-22T21:16:41Z","git_url":"git://github.com/kureuil/lapin.git","ssh_url":"git@github.com:kureuil/lapin.git","clone_url":"https://github.com/kureuil/lapin.git","svn_url":"https://github.com/kureuil/lapin","homepage":"","size":449,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sozu-proxy:master","ref":"master","sha":"258291981481d814df5e62ac64b80105df84ea1e","user":{"login":"sozu-proxy","id":25197590,"avatar_url":"https://avatars2.githubusercontent.com/u/25197590?v=4","gravatar_id":"","url":"https://api.github.com/users/sozu-proxy","html_url":"https://github.com/sozu-proxy","followers_url":"https://api.github.com/users/sozu-proxy/followers","following_url":"https://api.github.com/users/sozu-proxy/following{/other_user}","gists_url":"https://api.github.com/users/sozu-proxy/gists{/gist_id}","starred_url":"https://api.github.com/users/sozu-proxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sozu-proxy/subscriptions","organizations_url":"https://api.github.com/users/sozu-proxy/orgs","repos_url":"https://api.github.com/users/sozu-proxy/repos","events_url":"https://api.github.com/users/sozu-proxy/events{/privacy}","received_events_url":"https://api.github.com/users/sozu-proxy/received_events","type":"Organization","site_admin":false},"repo":{"id":83697754,"name":"lapin","full_name":"sozu-proxy/lapin","owner":{"login":"sozu-proxy","id":25197590,"avatar_url":"https://avatars2.githubusercontent.com/u/25197590?v=4","gravatar_id":"","url":"https://api.github.com/users/sozu-proxy","html_url":"https://github.com/sozu-proxy","followers_url":"https://api.github.com/users/sozu-proxy/followers","following_url":"https://api.github.com/users/sozu-proxy/following{/other_user}","gists_url":"https://api.github.com/users/sozu-proxy/gists{/gist_id}","starred_url":"https://api.github.com/users/sozu-proxy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sozu-proxy/subscriptions","organizations_url":"https://api.github.com/users/sozu-proxy/orgs","repos_url":"https://api.github.com/users/sozu-proxy/repos","events_url":"https://api.github.com/users/sozu-proxy/events{/privacy}","received_events_url":"https://api.github.com/users/sozu-proxy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sozu-proxy/lapin","description":"AMQP client library in Rust, with a clean, futures based API","fork":false,"url":"https://api.github.com/repos/sozu-proxy/lapin","forks_url":"https://api.github.com/repos/sozu-proxy/lapin/forks","keys_url":"https://api.github.com/repos/sozu-proxy/lapin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sozu-proxy/lapin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sozu-proxy/lapin/teams","hooks_url":"https://api.github.com/repos/sozu-proxy/lapin/hooks","issue_events_url":"https://api.github.com/repos/sozu-proxy/lapin/issues/events{/number}","events_url":"https://api.github.com/repos/sozu-proxy/lapin/events","assignees_url":"https://api.github.com/repos/sozu-proxy/lapin/assignees{/user}","branches_url":"https://api.github.com/repos/sozu-proxy/lapin/branches{/branch}","tags_url":"https://api.github.com/repos/sozu-proxy/lapin/tags","blobs_url":"https://api.github.com/repos/sozu-proxy/lapin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sozu-proxy/lapin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sozu-proxy/lapin/git/refs{/sha}","trees_url":"https://api.github.com/repos/sozu-proxy/lapin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sozu-proxy/lapin/statuses/{sha}","languages_url":"https://api.github.com/repos/sozu-proxy/lapin/languages","stargazers_url":"https://api.github.com/repos/sozu-proxy/lapin/stargazers","contributors_url":"https://api.github.com/repos/sozu-proxy/lapin/contributors","subscribers_url":"https://api.github.com/repos/sozu-proxy/lapin/subscribers","subscription_url":"https://api.github.com/repos/sozu-proxy/lapin/subscription","commits_url":"https://api.github.com/repos/sozu-proxy/lapin/commits{/sha}","git_commits_url":"https://api.github.com/repos/sozu-proxy/lapin/git/commits{/sha}","comments_url":"https://api.github.com/repos/sozu-proxy/lapin/comments{/number}","issue_comment_url":"https://api.github.com/repos/sozu-proxy/lapin/issues/comments{/number}","contents_url":"https://api.github.com/repos/sozu-proxy/lapin/contents/{+path}","compare_url":"https://api.github.com/repos/sozu-proxy/lapin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sozu-proxy/lapin/merges","archive_url":"https://api.github.com/repos/sozu-proxy/lapin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sozu-proxy/lapin/downloads","issues_url":"https://api.github.com/repos/sozu-proxy/lapin/issues{/number}","pulls_url":"https://api.github.com/repos/sozu-proxy/lapin/pulls{/number}","milestones_url":"https://api.github.com/repos/sozu-proxy/lapin/milestones{/number}","notifications_url":"https://api.github.com/repos/sozu-proxy/lapin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sozu-proxy/lapin/labels{/name}","releases_url":"https://api.github.com/repos/sozu-proxy/lapin/releases{/id}","deployments_url":"https://api.github.com/repos/sozu-proxy/lapin/deployments","created_at":"2017-03-02T16:10:03Z","updated_at":"2018-04-23T07:01:04Z","pushed_at":"2018-04-23T07:05:30Z","git_url":"git://github.com/sozu-proxy/lapin.git","ssh_url":"git@github.com:sozu-proxy/lapin.git","clone_url":"https://github.com/sozu-proxy/lapin.git","svn_url":"https://github.com/sozu-proxy/lapin","homepage":"","size":448,"stargazers_count":115,"watchers_count":115,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":16,"open_issues":19,"watchers":115,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sozu-proxy/lapin/pulls/97"},"html":{"href":"https://github.com/sozu-proxy/lapin/pull/97"},"issue":{"href":"https://api.github.com/repos/sozu-proxy/lapin/issues/97"},"comments":{"href":"https://api.github.com/repos/sozu-proxy/lapin/issues/97/comments"},"review_comments":{"href":"https://api.github.com/repos/sozu-proxy/lapin/pulls/97/comments"},"review_comment":{"href":"https://api.github.com/repos/sozu-proxy/lapin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sozu-proxy/lapin/pulls/97/commits"},"statuses":{"href":"https://api.github.com/repos/sozu-proxy/lapin/statuses/ed02746062114a7464a058ba836ef2bb73caa3ad"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Keruspe"}}