-
Notifications
You must be signed in to change notification settings - Fork 672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection::stream_send() reports Err::Done for finished streams #1695
Comments
Thanks for the detailed report. Thatspecific sequence would lead to the stream being collected, and hence always get_or_create will return Done. For stream_recv we return a InvalidStreamState if the stream doesn't exist Line 4476 in d4e5ed6
We could do similar for stream_send, capture the Done and convert it to InvalidStreamState at Line 4619 in d4e5ed6
|
Yes, an It would be great if there were a solution for #1299 too, but I suppose quiche has no mode where we can instruct it to explicitly keep streams alive until they are manually collected with a method call (Connection::stream_free()) or such. |
Oh thanks for the reminder on that. I guess if we're considering g changing the API, we might want to follow through with a solution that can satisfy both. |
This case occurs with streams closed with STOP_SENDING, then a fin bit being received too, then the data being read via
Connection::stream_recv()
.In high-level terms:
As far as I gathered from the documentation,
Err::Done
is supposed to be returned when no data could be written because of no capacity andErr::StreamStopped
returned when the stream has been closed by the peer.In this specific case though, the stream seems to already have been freed by quiche, thus
StreamMap::get_or_create()
returnsErr::Done
, whichConnection::stream_send()
simply forwards.I would expect an
Err::StreamStopped
, or at least anErr::InvalidStreamState
(signaling that a stream with that id could not be created, in that case, obviously, because the stream id is not matching what's allowed for the client/server).Currently I'm working around it with an extra check of
Connection::stream_writable()
forErr::InvalidStreamState
wheneverErr::Done
is reported, but that seems unnecessary/wrong to me, why would that be needed?In case this is the expected behaviour though, I would like to ask for a note in the documentation to check stream_writable() explicitly if
Err::Done
is returned.The text was updated successfully, but these errors were encountered: