How to detect interrupted http request #4583
Unanswered
miket-vwif
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
We are implementing an http server using poco net API and are facing problems with one specific use case:
It is important for us to know if the transfer was complete or if it has been interrupted. For chunked transfers, we did not find a good solution so far. After casting the request to
HTTPServerRequestImpl
, we can check the socket state viaselect()
, but this feels rather like a workaround.Actually I expected that the state bits of the istream (obtained from
request.stream()
call) tell us if the transfer was complete. Unfortunately those bits do not seem to be set properly, in both cases (complete transfer, interrupted transfer), only eofbit and failbit are set. Also there is no exception due to disconnecting client.Is this expected? If yes, how can we detect if a chunked transfer was complete?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions