{"action":"created","issue":{"url":"https://api.github.com/repos/wzrdtales/socket-io-sticky-session/issues/20","repository_url":"https://api.github.com/repos/wzrdtales/socket-io-sticky-session","labels_url":"https://api.github.com/repos/wzrdtales/socket-io-sticky-session/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/wzrdtales/socket-io-sticky-session/issues/20/comments","events_url":"https://api.github.com/repos/wzrdtales/socket-io-sticky-session/issues/20/events","html_url":"https://github.com/wzrdtales/socket-io-sticky-session/issues/20","id":174173736,"number":20,"title":"Does this work with large requests?","user":{"login":"kevinresol","id":1103788,"avatar_url":"https://avatars.githubusercontent.com/u/1103788?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinresol","html_url":"https://github.com/kevinresol","followers_url":"https://api.github.com/users/kevinresol/followers","following_url":"https://api.github.com/users/kevinresol/following{/other_user}","gists_url":"https://api.github.com/users/kevinresol/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinresol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinresol/subscriptions","organizations_url":"https://api.github.com/users/kevinresol/orgs","repos_url":"https://api.github.com/users/kevinresol/repos","events_url":"https://api.github.com/users/kevinresol/events{/privacy}","received_events_url":"https://api.github.com/users/kevinresol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-31T03:03:04Z","updated_at":"2016-08-31T08:54:08Z","closed_at":null,"body":"TL;DR;\r\nI have a large HTTP request (e.g. file upload)\r\n1. `resume()` the incoming socket, handle a single `data` event, process the header, `pause()` the socket again\r\n2. pass the socket between processes\r\n3. republish the packet using `fd._handle.onread(1, new Buffer(data))`\r\n4. `resume()` the socket again, but only one `data` event is fired. But I expect more, because the request is large\r\n\r\nI see that some [private node API](https://github.com/wzrdtales/socket-io-sticky-session/blob/afae46f/lib/sticky-session.js#L43) are used to republish the packet which is already read. I would like to clarify what that piece of code does. Does it push the read packet back to the beginning of the connection socket, or it just replace the whole connection content?\r\n\r\nWhy I ask this is that I am experiencing a problem that I have a large request (e.g. file upload) that can't be fully read in a single `data` event after `resume()`. After republishing, when I tried to read from the socket again, it only gives me the read packet from the first round, but the remaining data are not showing up.\r\n\r\n\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/37434629-does-this-work-with-large-requests?utm_campaign=plugin&utm_content=tracker%2F10408799&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F10408799&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/wzrdtales/socket-io-sticky-session/issues/comments/243701027","html_url":"https://github.com/wzrdtales/socket-io-sticky-session/issues/20#issuecomment-243701027","issue_url":"https://api.github.com/repos/wzrdtales/socket-io-sticky-session/issues/20","id":243701027,"user":{"login":"wzrdtales","id":1786821,"avatar_url":"https://avatars.githubusercontent.com/u/1786821?v=3","gravatar_id":"","url":"https://api.github.com/users/wzrdtales","html_url":"https://github.com/wzrdtales","followers_url":"https://api.github.com/users/wzrdtales/followers","following_url":"https://api.github.com/users/wzrdtales/following{/other_user}","gists_url":"https://api.github.com/users/wzrdtales/gists{/gist_id}","starred_url":"https://api.github.com/users/wzrdtales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wzrdtales/subscriptions","organizations_url":"https://api.github.com/users/wzrdtales/orgs","repos_url":"https://api.github.com/users/wzrdtales/repos","events_url":"https://api.github.com/users/wzrdtales/events{/privacy}","received_events_url":"https://api.github.com/users/wzrdtales/received_events","type":"User","site_admin":false},"created_at":"2016-08-31T08:54:08Z","updated_at":"2016-08-31T08:54:08Z","body":"So actually what happens:\r\n\r\nMaster gets connection -> socket passed to slave 1 -> slave 1 reads first packet -> slave 1 sends socket and data of first packet to master -> master receives the data, but the socket is lost -> master passes the data with the non existent socket to slave 2 -> slave 2 terminates the request, b/c the socket is null"}}
{"actor":{"display_login":"wzrdtales"}}