Handle unexpected EOF when reading HTTP streams
Throw an exception on EOF before stream is complete. Stream is complete if: Chunked-Encoding: zero-length chunk received Content-Length: N bytes received
Hi, @oandrew! Could you please provide the tests so it were easier to understand what bug you solve? There is the other PR concerning the same code: https://github.com/pocoproject/poco/pull/2998 Do you solve the same issue?
Throwing exception from the StreamBufs looks like a rather bold decision. Are you quite sure this does not break the requirement to leave the stream buffer in valid state (see http://www.cplusplus.com/reference/streambuf/basic_streambuf/underflow/ - Exception safety)? What's going to happen if IO stack above will call readFromDevice once more?