Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix readableStream unexpected end while waiting response #109
recently while using createReadStream() to pipe response in AWS.S3, under Node v0.10.1
After checking the source of createReadStream(),
What happened here, is because when the read method on stream is called, it will set a reading flag to true, until the stream.push is called, it will block next read call until the previous read finished. Therefore when httpStream is still waiting for response, the readStream will block itself because of the missing push call.
Further details is in the source of issac/readable-stream
So the pipe is also working now under 0.10.x,
Let me know is this solves the problem, also I made some hack on helper to emulate empty read call. Probably will have better way to emulate it.