OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // TODO(ukai): code is similar with http_network_transaction.cc. We should | 5 // TODO(ukai): code is similar with http_network_transaction.cc. We should |
6 // think about ways to share code, if possible. | 6 // think about ways to share code, if possible. |
7 | 7 |
8 #include "net/socket_stream/socket_stream.h" | 8 #include "net/socket_stream/socket_stream.h" |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1060 next_state_ = STATE_CLOSE; | 1060 next_state_ = STATE_CLOSE; |
1061 } | 1061 } |
1062 return result; | 1062 return result; |
1063 } | 1063 } |
1064 | 1064 |
1065 int SocketStream::DoReadWrite(int result) { | 1065 int SocketStream::DoReadWrite(int result) { |
1066 if (result < OK) { | 1066 if (result < OK) { |
1067 next_state_ = STATE_CLOSE; | 1067 next_state_ = STATE_CLOSE; |
1068 return result; | 1068 return result; |
1069 } | 1069 } |
1070 if (!socket_.get() || !socket_->IsConnected()) { | 1070 //if (!socket_.get() || !socket_->IsConnected()) { |
Ryan Sleevi
2012/12/15 01:03:04
I have to agree with Wan-Teh: I think this functio
Takashi Toyoshima
2012/12/21 07:43:03
Yes. Removing IsConnected() check is easy and righ
|
tyoshino (SeeGerritForStatus)
2012/12/14 15:13:54
To be removed before submission?
Takashi Toyoshima
2012/12/21 06:39:03
Oops, this change is not expected, but just for te
|
1071 if (!socket_.get()) { | |
1071 next_state_ = STATE_CLOSE; | 1072 next_state_ = STATE_CLOSE; |
1072 return ERR_CONNECTION_CLOSED; | 1073 return ERR_CONNECTION_CLOSED; |
1073 } | 1074 } |
1074 | 1075 |
1075 // If client has requested close(), and there's nothing to write, then | 1076 // If client has requested close(), and there's nothing to write, then |
1076 // let's close the socket. | 1077 // let's close the socket. |
1077 // We don't care about receiving data after the socket is closed. | 1078 // We don't care about receiving data after the socket is closed. |
1078 if (closing_ && !write_buf_ && pending_write_bufs_.empty()) { | 1079 if (closing_ && !write_buf_ && pending_write_bufs_.empty()) { |
1079 socket_->Disconnect(); | 1080 socket_->Disconnect(); |
1080 next_state_ = STATE_CLOSE; | 1081 next_state_ = STATE_CLOSE; |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1273 | 1274 |
1274 SSLConfigService* SocketStream::ssl_config_service() const { | 1275 SSLConfigService* SocketStream::ssl_config_service() const { |
1275 return context_->ssl_config_service(); | 1276 return context_->ssl_config_service(); |
1276 } | 1277 } |
1277 | 1278 |
1278 ProxyService* SocketStream::proxy_service() const { | 1279 ProxyService* SocketStream::proxy_service() const { |
1279 return context_->proxy_service(); | 1280 return context_->proxy_service(); |
1280 } | 1281 } |
1281 | 1282 |
1282 } // namespace net | 1283 } // namespace net |
OLD | NEW |