Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Unified Diff: net/spdy/spdy_stream.cc

Issue 2852029: Revert "Streams send a Rst frame upon being closed by client. Some minor editorial fixes." (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_stream.h ('k') | net/spdy/spdy_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_stream.cc
diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc
index ea4152d867f31517c2f192bfabb9968f15c1528f..1166cd5f6b01c259c078903705b105e061bef274 100644
--- a/net/spdy/spdy_stream.cc
+++ b/net/spdy/spdy_stream.cc
@@ -28,9 +28,7 @@ SpdyStream::SpdyStream(
cancelled_(false),
send_bytes_(0),
recv_bytes_(0),
- histograms_recorded_(false),
- half_closed_client_side_(false),
- half_closed_server_side_(false) {}
+ histograms_recorded_(false) {}
SpdyStream::~SpdyStream() {
DLOG(INFO) << "Deleting SpdyStream for stream " << stream_id_;
@@ -60,8 +58,8 @@ void SpdyStream::SetDelegate(Delegate* delegate) {
void SpdyStream::DetachDelegate() {
delegate_ = NULL;
- if (!half_closed_client_side())
- session_->CloseStream(stream_id_, ERR_ABORTED);
+ if (!cancelled())
+ Cancel();
}
const linked_ptr<spdy::SpdyHeaderBlock>& SpdyStream::spdy_headers() const {
@@ -131,8 +129,6 @@ void SpdyStream::OnDataReceived(const char* data, int length) {
// received.
if (response_->empty()) {
session_->CloseStream(stream_id_, ERR_SYN_REPLY_NOT_RECEIVED);
- //session_->CloseStreamAndSendRst(stream_id_, ERR_SYN_REPLY_NOT_RECEIVED);
- // TODO(erikchen): We should close the session here.
return;
}
@@ -163,13 +159,11 @@ void SpdyStream::OnDataReceived(const char* data, int length) {
}
void SpdyStream::OnWriteComplete(int status) {
- // Behavior for status==0 is undefined, and should never happen. This should
- // have already been checked prior to calling this function.
- DCHECK_NE(status, 0);
+ // TODO(mbelshe): Check for cancellation here. If we're cancelled, we
+ // should discontinue the DoLoop.
- // It is possible that this stream was closed or cancelled while we had a
- // write pending.
- if (response_complete_ || cancelled_)
+ // It is possible that this stream was closed while we had a write pending.
+ if (response_complete_)
return;
if (status > 0)
@@ -190,8 +184,7 @@ void SpdyStream::OnClose(int status) {
void SpdyStream::Cancel() {
cancelled_ = true;
- if (!half_closed_client_side())
- session_->CloseStreamAndSendRst(stream_id_, ERR_ABORTED);
+ session_->CloseStream(stream_id_, ERR_ABORTED);
}
int SpdyStream::DoSendRequest(bool has_upload_data) {
« no previous file with comments | « net/spdy/spdy_stream.h ('k') | net/spdy/spdy_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698