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

Unified Diff: net/socket_stream/socket_stream.cc

Issue 355022: Minor fixes in SocketStream. (Closed)
Patch Set: Created 11 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket_stream/socket_stream.cc
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc
index 6ef8c331dd61b1fce340021a25967643221592ca..62aad61969b84d522be873af873b38133f0934e2 100644
--- a/net/socket_stream/socket_stream.cc
+++ b/net/socket_stream/socket_stream.cc
@@ -638,7 +638,7 @@ int SocketStream::DoSOCKSConnectComplete(int result) {
if (is_secure())
next_state_ = STATE_SSL_CONNECT;
else
- DidEstablishConnection();
+ result = DidEstablishConnection();
}
return result;
}
@@ -688,7 +688,7 @@ int SocketStream::DoReadWrite(int result) {
return ERR_CONNECTION_CLOSED;
}
// If read is pending, try write as well.
- // Otherwise, return the result and do next loop.
+ // Otherwise, return the result and do next loop (to close the connection).
if (result != ERR_IO_PENDING) {
next_state_ = STATE_CLOSE;
return result;
@@ -708,6 +708,12 @@ int SocketStream::DoReadWrite(int result) {
DidSendData(result);
return OK;
}
+ // If write is not pending, return the result and do next loop (to close
+ // the connection).
+ if (result != 0 && result != ERR_IO_PENDING) {
+ next_state_ = STATE_CLOSE;
+ return result;
+ }
return result;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698