From 6832fccfb6d8d83c20a2a667cdea9f8ee5524267 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Thu, 25 Jan 2018 12:58:24 +0800 Subject: [PATCH] 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. --- net/spdy/chromium/spdy_stream.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/net/spdy/chromium/spdy_stream.cc b/net/spdy/chromium/spdy_stream.cc index ecb411713a..299f34a0f2 100644 --- a/net/spdy/chromium/spdy_stream.cc +++ b/net/spdy/chromium/spdy_stream.cc @@ -514,6 +514,7 @@ void SpdyStream::OnDataReceived(std::unique_ptr buffer) { if (!buffer) { if (io_state_ == STATE_OPEN) { io_state_ = STATE_HALF_CLOSED_REMOTE; + delegate_->OnDataReceived(nullptr); } else if (io_state_ == STATE_HALF_CLOSED_LOCAL) { io_state_ = STATE_CLOSED; // Deletes |this|.