-
Notifications
You must be signed in to change notification settings - Fork 844
Return null when do_io_write called on closed stream #6826
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -331,8 +331,12 @@ Http2Stream::do_io_write(Continuation *c, int64_t nbytes, IOBufferReader *abuffe | |||||||||
| write_vio.op = VIO::WRITE; | ||||||||||
| response_reader = abuffer; | ||||||||||
|
|
||||||||||
| update_write_request(abuffer, nbytes, false); | ||||||||||
|
|
||||||||||
| if (c != nullptr && nbytes > 0 && this->is_client_state_writeable()) { | ||||||||||
| update_write_request(abuffer, nbytes, false); | ||||||||||
| } else if (!this->is_client_state_writeable()) { | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you assuming when HttpTunnel::producer_run() calls this do_io_write(), the Http2Stream is closing / closed ? trafficserver/iocore/net/UnixNetVConnection.cc Lines 606 to 609 in fe90339
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that was my assumption, and this does look like a better solution. I will give that one a try. |
||||||||||
| // Cannot start a write on a closed stream | ||||||||||
| return nullptr; | ||||||||||
| } | ||||||||||
| return &write_vio; | ||||||||||
| } | ||||||||||
|
|
||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I'm a bit surprised that we haven't had this check and haven't seen any problems. It looks like this case could happen with HTTP/1.1. Probably, Http2Stream easily falls down this case because of the life cycle.