mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-11-24 06:16:30 +03:00
h2: Notify delegate about read EOF
So the delegate can close the socket instead of keeping sending data. Read EOF or h2 half-closed (remote) state was introduced in https://codereview.chromium.org/129543002. But StreamSocket doesnt really supports a half closed state, so upon a read EOF the only sane action is to close the socket immediately even if in theory more send is possible.
This commit is contained in:
parent
d5a5e5b50d
commit
5619908d3d
@ -538,6 +538,7 @@ void SpdyStream::OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) {
|
|||||||
if (!buffer) {
|
if (!buffer) {
|
||||||
if (io_state_ == STATE_OPEN) {
|
if (io_state_ == STATE_OPEN) {
|
||||||
io_state_ = STATE_HALF_CLOSED_REMOTE;
|
io_state_ = STATE_HALF_CLOSED_REMOTE;
|
||||||
|
delegate_->OnDataReceived(nullptr);
|
||||||
} else if (io_state_ == STATE_HALF_CLOSED_LOCAL) {
|
} else if (io_state_ == STATE_HALF_CLOSED_LOCAL) {
|
||||||
io_state_ = STATE_CLOSED;
|
io_state_ = STATE_CLOSED;
|
||||||
// Deletes |this|.
|
// Deletes |this|.
|
||||||
|
Loading…
Reference in New Issue
Block a user