{"action":"created","issue":{"url":"https://api.github.com/repos/hjr3/alacrity/issues/33","repository_url":"https://api.github.com/repos/hjr3/alacrity","labels_url":"https://api.github.com/repos/hjr3/alacrity/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/hjr3/alacrity/issues/33/comments","events_url":"https://api.github.com/repos/hjr3/alacrity/issues/33/events","html_url":"https://github.com/hjr3/alacrity/pull/33","id":191337962,"number":33,"title":"add more logs when the body is incomplete","user":{"login":"yanns","id":51669,"avatar_url":"https://avatars.githubusercontent.com/u/51669?v=3","gravatar_id":"","url":"https://api.github.com/users/yanns","html_url":"https://github.com/yanns","followers_url":"https://api.github.com/users/yanns/followers","following_url":"https://api.github.com/users/yanns/following{/other_user}","gists_url":"https://api.github.com/users/yanns/gists{/gist_id}","starred_url":"https://api.github.com/users/yanns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yanns/subscriptions","organizations_url":"https://api.github.com/users/yanns/orgs","repos_url":"https://api.github.com/users/yanns/repos","events_url":"https://api.github.com/users/yanns/events{/privacy}","received_events_url":"https://api.github.com/users/yanns/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-23T17:37:29Z","updated_at":"2016-11-23T22:14:31Z","closed_at":"2016-11-23T17:41:26Z","pull_request":{"url":"https://api.github.com/repos/hjr3/alacrity/pulls/33","html_url":"https://github.com/hjr3/alacrity/pull/33","diff_url":"https://github.com/hjr3/alacrity/pull/33.diff","patch_url":"https://github.com/hjr3/alacrity/pull/33.patch"},"body":"For example, simply getting a javascript with a Play application logs the following error:\r\n```\r\nDEBUG:alacrity::http::parser: Body contains 0 bytes and we need 93868 bytes\r\nTRACE:alacrity::http::parser: response till now: Some(Response { head: ResponseHead { version: Http11, status: 200, reason: \"OK\", headers: [Header { name: \"ETag\", value: \"\\\"efab29516dc38c40118a01a7888ffd6b30e8b971\\\"\" }, Header { name: \"Cache-Control\", value: \"no-cache\" }, Header { name: \"Last-Modified\", value: \"Tue, 08 Mar 2016 10:25:02 GMT\" }, Header { name: \"Content-Length\", value: \"93868\" }, Header { name: \"Content-Type\", value: \"application/javascript; charset=utf-8\" }, Header { name: \"Date\", value: \"Wed, 23 Nov 2016 17:34:00 GMT\" }] }, body: [] })\r\nthread 'main' panicked at 'Not enough bytes to parse response', src/backend.rs:31\r\n```\r\n\r\nIt is not a chunked response. I guess the body is send later in the pipeline."},"comment":{"url":"https://api.github.com/repos/hjr3/alacrity/issues/comments/262643041","html_url":"https://github.com/hjr3/alacrity/pull/33#issuecomment-262643041","issue_url":"https://api.github.com/repos/hjr3/alacrity/issues/33","id":262643041,"user":{"login":"hjr3","id":33318,"avatar_url":"https://avatars.githubusercontent.com/u/33318?v=3","gravatar_id":"","url":"https://api.github.com/users/hjr3","html_url":"https://github.com/hjr3","followers_url":"https://api.github.com/users/hjr3/followers","following_url":"https://api.github.com/users/hjr3/following{/other_user}","gists_url":"https://api.github.com/users/hjr3/gists{/gist_id}","starred_url":"https://api.github.com/users/hjr3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hjr3/subscriptions","organizations_url":"https://api.github.com/users/hjr3/orgs","repos_url":"https://api.github.com/users/hjr3/repos","events_url":"https://api.github.com/users/hjr3/events{/privacy}","received_events_url":"https://api.github.com/users/hjr3/received_events","type":"User","site_admin":false},"created_at":"2016-11-23T22:14:31Z","updated_at":"2016-11-23T22:14:31Z","body":"For now we buffer it. Next steps are to make `HttpParser` contain instances of both `RequestParser` and `ResponseParser`. We then track the parsing state. That way if we parse the head of a request, we can start sending that upstream to the backend. If we are in a chunked transfer, we can start sending the chunks as they come in too.\r\n\r\nFor a normal content length body, we can optimize it to send it in some sort of _chunked_ form. Especially if the body is large (as is with the case of downloads). I meany really, when it comes to the body, we can literally copy from one socket into the other."}}
{"actor":{"display_login":"hjr3"}}