You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are implementing an http server using poco net API and are facing problems with one specific use case:
Client connects to server and performs a PUT request.
Client disconnects while transferring body.
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 via select(), 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?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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