[email protected] | e92fa7e1 | 2012-02-16 23:31:22 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "net/spdy/spdy_proxy_client_socket.h" |
| 6 | |
| 7 | #include <algorithm> // min |
diannahu | 9904e27 | 2017-02-03 14:40:08 | [diff] [blame] | 8 | #include <memory> |
dcheng | c7eeda42 | 2015-12-26 03:56:48 | [diff] [blame] | 9 | #include <utility> |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 10 | |
[email protected] | 49639fa | 2011-12-20 23:22:41 | [diff] [blame] | 11 | #include "base/bind.h" |
| 12 | #include "base/bind_helpers.h" |
[email protected] | aa19cfc | 2013-05-23 16:41:38 | [diff] [blame] | 13 | #include "base/callback_helpers.h" |
skyostil | 4891b25b | 2015-06-11 11:43:45 | [diff] [blame] | 14 | #include "base/location.h" |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 15 | #include "base/logging.h" |
skyostil | 4891b25b | 2015-06-11 11:43:45 | [diff] [blame] | 16 | #include "base/single_thread_task_runner.h" |
[email protected] | fc9be580 | 2013-06-11 10:56:51 | [diff] [blame] | 17 | #include "base/strings/string_util.h" |
gab | f767595f | 2016-05-11 18:50:35 | [diff] [blame] | 18 | #include "base/threading/thread_task_runner_handle.h" |
[email protected] | f6c63db5 | 2013-02-02 00:35:22 | [diff] [blame] | 19 | #include "base/values.h" |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 20 | #include "net/base/auth.h" |
| 21 | #include "net/base/io_buffer.h" |
[email protected] | fe3b7dc | 2012-02-03 19:52:09 | [diff] [blame] | 22 | #include "net/http/http_auth_cache.h" |
| 23 | #include "net/http/http_auth_handler_factory.h" |
rch | c5c07de | 2015-04-08 07:28:18 | [diff] [blame] | 24 | #include "net/http/http_request_info.h" |
[email protected] | b104b50 | 2010-10-18 20:21:31 | [diff] [blame] | 25 | #include "net/http/http_response_headers.h" |
[email protected] | 57d2dfa | 2013-06-24 06:04:12 | [diff] [blame] | 26 | #include "net/http/proxy_connect_redirect_http_stream.h" |
mikecirone | 8b85c43 | 2016-09-08 19:11:00 | [diff] [blame] | 27 | #include "net/log/net_log_event_type.h" |
mikecirone | 8b85c43 | 2016-09-08 19:11:00 | [diff] [blame] | 28 | #include "net/log/net_log_source_type.h" |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 29 | #include "net/spdy/spdy_http_utils.h" |
[email protected] | f89276a7 | 2013-07-12 06:41:54 | [diff] [blame] | 30 | #include "url/gurl.h" |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 31 | |
| 32 | namespace net { |
| 33 | |
| 34 | SpdyProxyClientSocket::SpdyProxyClientSocket( |
[email protected] | d26ff35 | 2013-05-13 08:48:28 | [diff] [blame] | 35 | const base::WeakPtr<SpdyStream>& spdy_stream, |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 36 | const std::string& user_agent, |
| 37 | const HostPortPair& endpoint, |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 38 | const HostPortPair& proxy_server, |
tfarina | 4283411 | 2016-09-22 13:38:20 | [diff] [blame] | 39 | const NetLogWithSource& source_net_log, |
mmenke | 2a1781d | 2015-10-07 19:25:33 | [diff] [blame] | 40 | HttpAuthController* auth_controller) |
[email protected] | 49639fa | 2011-12-20 23:22:41 | [diff] [blame] | 41 | : next_state_(STATE_DISCONNECTED), |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 42 | spdy_stream_(spdy_stream), |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 43 | endpoint_(endpoint), |
mmenke | 2a1781d | 2015-10-07 19:25:33 | [diff] [blame] | 44 | auth_(auth_controller), |
rch | ecd3c55 | 2015-04-07 20:53:54 | [diff] [blame] | 45 | user_agent_(user_agent), |
[email protected] | ca690b0 | 2013-04-17 10:38:43 | [diff] [blame] | 46 | user_buffer_len_(0), |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 47 | write_buffer_len_(0), |
[email protected] | 57d2dfa | 2013-06-24 06:04:12 | [diff] [blame] | 48 | was_ever_used_(false), |
| 49 | redirect_has_load_timing_info_(false), |
tfarina | 4283411 | 2016-09-22 13:38:20 | [diff] [blame] | 50 | net_log_(NetLogWithSource::Make(spdy_stream->net_log().net_log(), |
| 51 | NetLogSourceType::PROXY_CLIENT_SOCKET)), |
bnc | 3d95ca9 | 2017-03-29 13:20:34 | [diff] [blame^] | 52 | source_dependency_(source_net_log.source()), |
[email protected] | 0a428c2 | 2014-06-14 02:26:37 | [diff] [blame] | 53 | weak_factory_(this), |
| 54 | write_callback_weak_factory_(this) { |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 55 | request_.method = "CONNECT"; |
rch | ecd3c55 | 2015-04-07 20:53:54 | [diff] [blame] | 56 | request_.url = GURL("https://" + endpoint.ToString()); |
mikecirone | 8b85c43 | 2016-09-08 19:11:00 | [diff] [blame] | 57 | net_log_.BeginEvent(NetLogEventType::SOCKET_ALIVE, |
[email protected] | f6c63db5 | 2013-02-02 00:35:22 | [diff] [blame] | 58 | source_net_log.source().ToEventParametersCallback()); |
| 59 | net_log_.AddEvent( |
mikecirone | 8b85c43 | 2016-09-08 19:11:00 | [diff] [blame] | 60 | NetLogEventType::HTTP2_PROXY_CLIENT_SESSION, |
[email protected] | f6c63db5 | 2013-02-02 00:35:22 | [diff] [blame] | 61 | spdy_stream->net_log().source().ToEventParametersCallback()); |
| 62 | |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 63 | spdy_stream_->SetDelegate(this); |
| 64 | was_ever_used_ = spdy_stream_->WasEverUsed(); |
| 65 | } |
| 66 | |
| 67 | SpdyProxyClientSocket::~SpdyProxyClientSocket() { |
| 68 | Disconnect(); |
mikecirone | 8b85c43 | 2016-09-08 19:11:00 | [diff] [blame] | 69 | net_log_.EndEvent(NetLogEventType::SOCKET_ALIVE); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 70 | } |
| 71 | |
[email protected] | be1a48b | 2011-01-20 00:12:13 | [diff] [blame] | 72 | const HttpResponseInfo* SpdyProxyClientSocket::GetConnectResponseInfo() const { |
[email protected] | 9049948 | 2013-06-01 00:39:50 | [diff] [blame] | 73 | return response_.headers.get() ? &response_ : NULL; |
[email protected] | be1a48b | 2011-01-20 00:12:13 | [diff] [blame] | 74 | } |
| 75 | |
[email protected] | c0fe941d | 2012-02-25 00:15:32 | [diff] [blame] | 76 | const scoped_refptr<HttpAuthController>& |
| 77 | SpdyProxyClientSocket::GetAuthController() const { |
| 78 | return auth_; |
| 79 | } |
| 80 | |
| 81 | int SpdyProxyClientSocket::RestartWithAuth(const CompletionCallback& callback) { |
| 82 | // A SPDY Stream can only handle a single request, so the underlying |
| 83 | // stream may not be reused and a new SpdyProxyClientSocket must be |
| 84 | // created (possibly on top of the same SPDY Session). |
| 85 | next_state_ = STATE_DISCONNECTED; |
[email protected] | 0c5fb72 | 2012-02-28 11:50:35 | [diff] [blame] | 86 | return OK; |
[email protected] | c0fe941d | 2012-02-25 00:15:32 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | bool SpdyProxyClientSocket::IsUsingSpdy() const { |
| 90 | return true; |
| 91 | } |
| 92 | |
bnc | 6227b26e | 2016-08-12 02:00:43 | [diff] [blame] | 93 | NextProto SpdyProxyClientSocket::GetProxyNegotiatedProtocol() const { |
bnc | 4cb660c | 2016-08-11 19:43:12 | [diff] [blame] | 94 | return spdy_stream_->GetNegotiatedProtocol(); |
[email protected] | c0fe941d | 2012-02-25 00:15:32 | [diff] [blame] | 95 | } |
| 96 | |
[email protected] | 511f6f5 | 2010-12-17 03:58:29 | [diff] [blame] | 97 | HttpStream* SpdyProxyClientSocket::CreateConnectResponseStream() { |
[email protected] | 57d2dfa | 2013-06-24 06:04:12 | [diff] [blame] | 98 | return new ProxyConnectRedirectHttpStream( |
| 99 | redirect_has_load_timing_info_ ? &redirect_load_timing_info_ : NULL); |
[email protected] | 511f6f5 | 2010-12-17 03:58:29 | [diff] [blame] | 100 | } |
| 101 | |
bnc | 4233140 | 2016-07-25 13:36:15 | [diff] [blame] | 102 | // Sends a HEADERS frame to the proxy with a CONNECT request |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 103 | // for the specified endpoint. Waits for the server to send back |
bnc | 4233140 | 2016-07-25 13:36:15 | [diff] [blame] | 104 | // a HEADERS frame. OK will be returned if the status is 200. |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 105 | // ERR_TUNNEL_CONNECTION_FAILED will be returned for any other status. |
| 106 | // In any of these cases, Read() may be called to retrieve the HTTP |
| 107 | // response body. Any other return values should be considered fatal. |
[email protected] | fe3b7dc | 2012-02-03 19:52:09 | [diff] [blame] | 108 | // TODO(rch): handle 407 proxy auth requested correctly, perhaps |
| 109 | // by creating a new stream for the subsequent request. |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 110 | // TODO(rch): create a more appropriate error code to disambiguate |
| 111 | // the HTTPS Proxy tunnel failure from an HTTP Proxy tunnel failure. |
[email protected] | dbf036f | 2011-12-06 23:33:24 | [diff] [blame] | 112 | int SpdyProxyClientSocket::Connect(const CompletionCallback& callback) { |
[email protected] | 83039bb | 2011-12-09 18:43:55 | [diff] [blame] | 113 | DCHECK(read_callback_.is_null()); |
[email protected] | d9da5fe | 2010-10-13 22:37:16 | [diff] [blame] | 114 | if (next_state_ == STATE_OPEN) |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 115 | return OK; |
| 116 | |
[email protected] | d9da5fe | 2010-10-13 22:37:16 | [diff] [blame] | 117 | DCHECK_EQ(STATE_DISCONNECTED, next_state_); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 118 | next_state_ = STATE_GENERATE_AUTH_TOKEN; |
| 119 | |
| 120 | int rv = DoLoop(OK); |
| 121 | if (rv == ERR_IO_PENDING) |
| 122 | read_callback_ = callback; |
| 123 | return rv; |
| 124 | } |
| 125 | |
| 126 | void SpdyProxyClientSocket::Disconnect() { |
[email protected] | ca690b0 | 2013-04-17 10:38:43 | [diff] [blame] | 127 | read_buffer_queue_.Clear(); |
[email protected] | d9da5fe | 2010-10-13 22:37:16 | [diff] [blame] | 128 | user_buffer_ = NULL; |
[email protected] | ca690b0 | 2013-04-17 10:38:43 | [diff] [blame] | 129 | user_buffer_len_ = 0; |
[email protected] | dbf036f | 2011-12-06 23:33:24 | [diff] [blame] | 130 | read_callback_.Reset(); |
[email protected] | d9da5fe | 2010-10-13 22:37:16 | [diff] [blame] | 131 | |
| 132 | write_buffer_len_ = 0; |
[email protected] | 83039bb | 2011-12-09 18:43:55 | [diff] [blame] | 133 | write_callback_.Reset(); |
[email protected] | 0a428c2 | 2014-06-14 02:26:37 | [diff] [blame] | 134 | write_callback_weak_factory_.InvalidateWeakPtrs(); |
[email protected] | d9da5fe | 2010-10-13 22:37:16 | [diff] [blame] | 135 | |
| 136 | next_state_ = STATE_DISCONNECTED; |
| 137 | |
[email protected] | 11fbca0b | 2013-06-02 23:37:21 | [diff] [blame] | 138 | if (spdy_stream_.get()) { |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 139 | // This will cause OnClose to be invoked, which takes care of |
| 140 | // cleaning up all the internal state. |
| 141 | spdy_stream_->Cancel(); |
[email protected] | 11fbca0b | 2013-06-02 23:37:21 | [diff] [blame] | 142 | DCHECK(!spdy_stream_.get()); |
[email protected] | f6a7829 | 2013-03-09 14:36:34 | [diff] [blame] | 143 | } |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | bool SpdyProxyClientSocket::IsConnected() const { |
[email protected] | 194c7a9 | 2011-12-03 04:54:18 | [diff] [blame] | 147 | return next_state_ == STATE_OPEN; |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 148 | } |
| 149 | |
| 150 | bool SpdyProxyClientSocket::IsConnectedAndIdle() const { |
[email protected] | ca690b0 | 2013-04-17 10:38:43 | [diff] [blame] | 151 | return IsConnected() && read_buffer_queue_.IsEmpty() && |
[email protected] | 5ff0ed3 | 2014-02-12 17:48:51 | [diff] [blame] | 152 | spdy_stream_->IsOpen(); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 153 | } |
| 154 | |
tfarina | 4283411 | 2016-09-22 13:38:20 | [diff] [blame] | 155 | const NetLogWithSource& SpdyProxyClientSocket::NetLog() const { |
[email protected] | e4be2dd | 2010-12-14 00:44:39 | [diff] [blame] | 156 | return net_log_; |
| 157 | } |
| 158 | |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 159 | void SpdyProxyClientSocket::SetSubresourceSpeculation() { |
| 160 | // TODO(rch): what should this implementation be? |
| 161 | } |
| 162 | |
| 163 | void SpdyProxyClientSocket::SetOmniboxSpeculation() { |
| 164 | // TODO(rch): what should this implementation be? |
| 165 | } |
| 166 | |
| 167 | bool SpdyProxyClientSocket::WasEverUsed() const { |
[email protected] | 11fbca0b | 2013-06-02 23:37:21 | [diff] [blame] | 168 | return was_ever_used_ || (spdy_stream_.get() && spdy_stream_->WasEverUsed()); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 169 | } |
| 170 | |
tfarina | 2846404c | 2016-12-25 14:31:37 | [diff] [blame] | 171 | bool SpdyProxyClientSocket::WasAlpnNegotiated() const { |
[email protected] | 2d88e7d | 2012-07-19 17:55:17 | [diff] [blame] | 172 | return false; |
| 173 | } |
| 174 | |
[email protected] | 33661e48 | 2012-04-03 16:16:26 | [diff] [blame] | 175 | NextProto SpdyProxyClientSocket::GetNegotiatedProtocol() const { |
| 176 | return kProtoUnknown; |
| 177 | } |
| 178 | |
[email protected] | 2d88e7d | 2012-07-19 17:55:17 | [diff] [blame] | 179 | bool SpdyProxyClientSocket::GetSSLInfo(SSLInfo* ssl_info) { |
bnc | 4cb660c | 2016-08-11 19:43:12 | [diff] [blame] | 180 | return spdy_stream_->GetSSLInfo(ssl_info); |
[email protected] | 2d88e7d | 2012-07-19 17:55:17 | [diff] [blame] | 181 | } |
| 182 | |
ttuttle | 23fdb7b | 2015-05-15 01:28:03 | [diff] [blame] | 183 | void SpdyProxyClientSocket::GetConnectionAttempts( |
| 184 | ConnectionAttempts* out) const { |
| 185 | out->clear(); |
| 186 | } |
| 187 | |
tbansal | f82cc8e | 2015-10-14 20:05:49 | [diff] [blame] | 188 | int64_t SpdyProxyClientSocket::GetTotalReceivedBytes() const { |
| 189 | NOTIMPLEMENTED(); |
| 190 | return 0; |
| 191 | } |
| 192 | |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 193 | int SpdyProxyClientSocket::Read(IOBuffer* buf, int buf_len, |
[email protected] | 3f55aa1 | 2011-12-07 02:03:33 | [diff] [blame] | 194 | const CompletionCallback& callback) { |
[email protected] | 83039bb | 2011-12-09 18:43:55 | [diff] [blame] | 195 | DCHECK(read_callback_.is_null()); |
[email protected] | 9049948 | 2013-06-01 00:39:50 | [diff] [blame] | 196 | DCHECK(!user_buffer_.get()); |
[email protected] | 3f55aa1 | 2011-12-07 02:03:33 | [diff] [blame] | 197 | |
| 198 | if (next_state_ == STATE_DISCONNECTED) |
| 199 | return ERR_SOCKET_NOT_CONNECTED; |
| 200 | |
[email protected] | ca690b0 | 2013-04-17 10:38:43 | [diff] [blame] | 201 | if (next_state_ == STATE_CLOSED && read_buffer_queue_.IsEmpty()) { |
[email protected] | 3f55aa1 | 2011-12-07 02:03:33 | [diff] [blame] | 202 | return 0; |
| 203 | } |
| 204 | |
| 205 | DCHECK(next_state_ == STATE_OPEN || next_state_ == STATE_CLOSED); |
| 206 | DCHECK(buf); |
[email protected] | ca690b0 | 2013-04-17 10:38:43 | [diff] [blame] | 207 | size_t result = PopulateUserReadBuffer(buf->data(), buf_len); |
[email protected] | 3f55aa1 | 2011-12-07 02:03:33 | [diff] [blame] | 208 | if (result == 0) { |
[email protected] | ca690b0 | 2013-04-17 10:38:43 | [diff] [blame] | 209 | user_buffer_ = buf; |
| 210 | user_buffer_len_ = static_cast<size_t>(buf_len); |
[email protected] | 3f55aa1 | 2011-12-07 02:03:33 | [diff] [blame] | 211 | DCHECK(!callback.is_null()); |
| 212 | read_callback_ = callback; |
| 213 | return ERR_IO_PENDING; |
| 214 | } |
| 215 | user_buffer_ = NULL; |
| 216 | return result; |
| 217 | } |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 218 | |
[email protected] | ca690b0 | 2013-04-17 10:38:43 | [diff] [blame] | 219 | size_t SpdyProxyClientSocket::PopulateUserReadBuffer(char* data, size_t len) { |
[email protected] | 09a8d917 | 2013-04-17 19:23:49 | [diff] [blame] | 220 | return read_buffer_queue_.Dequeue(data, len); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | int SpdyProxyClientSocket::Write(IOBuffer* buf, int buf_len, |
[email protected] | 83039bb | 2011-12-09 18:43:55 | [diff] [blame] | 224 | const CompletionCallback& callback) { |
| 225 | DCHECK(write_callback_.is_null()); |
[email protected] | 194c7a9 | 2011-12-03 04:54:18 | [diff] [blame] | 226 | if (next_state_ != STATE_OPEN) |
[email protected] | d9da5fe | 2010-10-13 22:37:16 | [diff] [blame] | 227 | return ERR_SOCKET_NOT_CONNECTED; |
| 228 | |
[email protected] | 11fbca0b | 2013-06-02 23:37:21 | [diff] [blame] | 229 | DCHECK(spdy_stream_.get()); |
[email protected] | edbfa8c | 2013-05-29 00:22:33 | [diff] [blame] | 230 | spdy_stream_->SendData(buf, buf_len, MORE_DATA_TO_SEND); |
mikecirone | 8b85c43 | 2016-09-08 19:11:00 | [diff] [blame] | 231 | net_log_.AddByteTransferEvent(NetLogEventType::SOCKET_BYTES_SENT, buf_len, |
| 232 | buf->data()); |
[email protected] | aa19cfc | 2013-05-23 16:41:38 | [diff] [blame] | 233 | write_callback_ = callback; |
| 234 | write_buffer_len_ = buf_len; |
| 235 | return ERR_IO_PENDING; |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 236 | } |
| 237 | |
Avi Drissman | 13fc893 | 2015-12-20 04:40:46 | [diff] [blame] | 238 | int SpdyProxyClientSocket::SetReceiveBufferSize(int32_t size) { |
[email protected] | 3268023f | 2011-05-05 00:08:10 | [diff] [blame] | 239 | // Since this StreamSocket sits on top of a shared SpdySession, it |
[email protected] | 28b96d1c | 2014-04-09 12:21:15 | [diff] [blame] | 240 | // is not safe for callers to change this underlying socket. |
| 241 | return ERR_NOT_IMPLEMENTED; |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 242 | } |
| 243 | |
Avi Drissman | 13fc893 | 2015-12-20 04:40:46 | [diff] [blame] | 244 | int SpdyProxyClientSocket::SetSendBufferSize(int32_t size) { |
[email protected] | 3268023f | 2011-05-05 00:08:10 | [diff] [blame] | 245 | // Since this StreamSocket sits on top of a shared SpdySession, it |
[email protected] | 28b96d1c | 2014-04-09 12:21:15 | [diff] [blame] | 246 | // is not safe for callers to change this underlying socket. |
| 247 | return ERR_NOT_IMPLEMENTED; |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 248 | } |
| 249 | |
[email protected] | a352869 | 2012-06-08 00:11:42 | [diff] [blame] | 250 | int SpdyProxyClientSocket::GetPeerAddress(IPEndPoint* address) const { |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 251 | if (!IsConnected()) |
[email protected] | 88e03fa | 2010-10-05 03:09:04 | [diff] [blame] | 252 | return ERR_SOCKET_NOT_CONNECTED; |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 253 | return spdy_stream_->GetPeerAddress(address); |
| 254 | } |
| 255 | |
[email protected] | e7f74da | 2011-04-19 23:49:35 | [diff] [blame] | 256 | int SpdyProxyClientSocket::GetLocalAddress(IPEndPoint* address) const { |
| 257 | if (!IsConnected()) |
| 258 | return ERR_SOCKET_NOT_CONNECTED; |
| 259 | return spdy_stream_->GetLocalAddress(address); |
| 260 | } |
| 261 | |
[email protected] | 4eddbc73 | 2012-08-09 05:40:17 | [diff] [blame] | 262 | void SpdyProxyClientSocket::LogBlockedTunnelResponse() const { |
| 263 | ProxyClientSocket::LogBlockedTunnelResponse( |
| 264 | response_.headers->response_code(), |
[email protected] | 4eddbc73 | 2012-08-09 05:40:17 | [diff] [blame] | 265 | /* is_https_proxy = */ true); |
| 266 | } |
| 267 | |
[email protected] | 0a428c2 | 2014-06-14 02:26:37 | [diff] [blame] | 268 | void SpdyProxyClientSocket::RunCallback(const CompletionCallback& callback, |
| 269 | int result) const { |
| 270 | callback.Run(result); |
| 271 | } |
| 272 | |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 273 | void SpdyProxyClientSocket::OnIOComplete(int result) { |
[email protected] | d9da5fe | 2010-10-13 22:37:16 | [diff] [blame] | 274 | DCHECK_NE(STATE_DISCONNECTED, next_state_); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 275 | int rv = DoLoop(result); |
| 276 | if (rv != ERR_IO_PENDING) { |
[email protected] | 83039bb | 2011-12-09 18:43:55 | [diff] [blame] | 277 | CompletionCallback c = read_callback_; |
| 278 | read_callback_.Reset(); |
| 279 | c.Run(rv); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 280 | } |
| 281 | } |
| 282 | |
| 283 | int SpdyProxyClientSocket::DoLoop(int last_io_result) { |
[email protected] | d9da5fe | 2010-10-13 22:37:16 | [diff] [blame] | 284 | DCHECK_NE(next_state_, STATE_DISCONNECTED); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 285 | int rv = last_io_result; |
| 286 | do { |
| 287 | State state = next_state_; |
[email protected] | d9da5fe | 2010-10-13 22:37:16 | [diff] [blame] | 288 | next_state_ = STATE_DISCONNECTED; |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 289 | switch (state) { |
| 290 | case STATE_GENERATE_AUTH_TOKEN: |
| 291 | DCHECK_EQ(OK, rv); |
| 292 | rv = DoGenerateAuthToken(); |
| 293 | break; |
| 294 | case STATE_GENERATE_AUTH_TOKEN_COMPLETE: |
| 295 | rv = DoGenerateAuthTokenComplete(rv); |
| 296 | break; |
| 297 | case STATE_SEND_REQUEST: |
| 298 | DCHECK_EQ(OK, rv); |
mikecirone | 8b85c43 | 2016-09-08 19:11:00 | [diff] [blame] | 299 | net_log_.BeginEvent( |
| 300 | NetLogEventType::HTTP_TRANSACTION_TUNNEL_SEND_REQUEST); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 301 | rv = DoSendRequest(); |
| 302 | break; |
| 303 | case STATE_SEND_REQUEST_COMPLETE: |
[email protected] | d7fd178 | 2011-02-08 19:16:43 | [diff] [blame] | 304 | net_log_.EndEventWithNetErrorCode( |
mikecirone | 8b85c43 | 2016-09-08 19:11:00 | [diff] [blame] | 305 | NetLogEventType::HTTP_TRANSACTION_TUNNEL_SEND_REQUEST, rv); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 306 | rv = DoSendRequestComplete(rv); |
[email protected] | f6c63db5 | 2013-02-02 00:35:22 | [diff] [blame] | 307 | if (rv >= 0 || rv == ERR_IO_PENDING) { |
| 308 | // Emit extra event so can use the same events as |
| 309 | // HttpProxyClientSocket. |
| 310 | net_log_.BeginEvent( |
mikecirone | 8b85c43 | 2016-09-08 19:11:00 | [diff] [blame] | 311 | NetLogEventType::HTTP_TRANSACTION_TUNNEL_READ_HEADERS); |
[email protected] | f6c63db5 | 2013-02-02 00:35:22 | [diff] [blame] | 312 | } |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 313 | break; |
| 314 | case STATE_READ_REPLY_COMPLETE: |
| 315 | rv = DoReadReplyComplete(rv); |
[email protected] | d7fd178 | 2011-02-08 19:16:43 | [diff] [blame] | 316 | net_log_.EndEventWithNetErrorCode( |
mikecirone | 8b85c43 | 2016-09-08 19:11:00 | [diff] [blame] | 317 | NetLogEventType::HTTP_TRANSACTION_TUNNEL_READ_HEADERS, rv); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 318 | break; |
| 319 | default: |
| 320 | NOTREACHED() << "bad state"; |
| 321 | rv = ERR_UNEXPECTED; |
| 322 | break; |
| 323 | } |
[email protected] | d9da5fe | 2010-10-13 22:37:16 | [diff] [blame] | 324 | } while (rv != ERR_IO_PENDING && next_state_ != STATE_DISCONNECTED && |
| 325 | next_state_ != STATE_OPEN); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 326 | return rv; |
| 327 | } |
| 328 | |
| 329 | int SpdyProxyClientSocket::DoGenerateAuthToken() { |
| 330 | next_state_ = STATE_GENERATE_AUTH_TOKEN_COMPLETE; |
[email protected] | 49639fa | 2011-12-20 23:22:41 | [diff] [blame] | 331 | return auth_->MaybeGenerateAuthToken( |
| 332 | &request_, |
[email protected] | f6a7829 | 2013-03-09 14:36:34 | [diff] [blame] | 333 | base::Bind(&SpdyProxyClientSocket::OnIOComplete, |
| 334 | weak_factory_.GetWeakPtr()), |
[email protected] | 49639fa | 2011-12-20 23:22:41 | [diff] [blame] | 335 | net_log_); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 336 | } |
| 337 | |
| 338 | int SpdyProxyClientSocket::DoGenerateAuthTokenComplete(int result) { |
| 339 | DCHECK_NE(ERR_IO_PENDING, result); |
| 340 | if (result == OK) |
| 341 | next_state_ = STATE_SEND_REQUEST; |
| 342 | return result; |
| 343 | } |
| 344 | |
| 345 | int SpdyProxyClientSocket::DoSendRequest() { |
| 346 | next_state_ = STATE_SEND_REQUEST_COMPLETE; |
| 347 | |
| 348 | // Add Proxy-Authentication header if necessary. |
| 349 | HttpRequestHeaders authorization_headers; |
| 350 | if (auth_->HaveAuth()) { |
| 351 | auth_->AddAuthorizationHeader(&authorization_headers); |
| 352 | } |
| 353 | |
| 354 | std::string request_line; |
rch | ecd3c55 | 2015-04-07 20:53:54 | [diff] [blame] | 355 | BuildTunnelRequest(endpoint_, authorization_headers, user_agent_, |
| 356 | &request_line, &request_.extra_headers); |
[email protected] | 3abacd6 | 2012-06-10 20:20:32 | [diff] [blame] | 357 | |
| 358 | net_log_.AddEvent( |
mikecirone | 8b85c43 | 2016-09-08 19:11:00 | [diff] [blame] | 359 | NetLogEventType::HTTP_TRANSACTION_SEND_TUNNEL_HEADERS, |
[email protected] | 3abacd6 | 2012-06-10 20:20:32 | [diff] [blame] | 360 | base::Bind(&HttpRequestHeaders::NetLogCallback, |
rch | ecd3c55 | 2015-04-07 20:53:54 | [diff] [blame] | 361 | base::Unretained(&request_.extra_headers), &request_line)); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 362 | |
bnc | 1d1d8646 | 2016-07-20 16:51:55 | [diff] [blame] | 363 | SpdyHeaderBlock headers; |
bnc | bca843ba | 2016-07-14 13:05:48 | [diff] [blame] | 364 | CreateSpdyHeadersFromHttpRequest(request_, request_.extra_headers, true, |
bnc | 1d1d8646 | 2016-07-20 16:51:55 | [diff] [blame] | 365 | &headers); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 366 | |
dcheng | c7eeda42 | 2015-12-26 03:56:48 | [diff] [blame] | 367 | return spdy_stream_->SendRequestHeaders(std::move(headers), |
| 368 | MORE_DATA_TO_SEND); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 369 | } |
| 370 | |
| 371 | int SpdyProxyClientSocket::DoSendRequestComplete(int result) { |
| 372 | if (result < 0) |
| 373 | return result; |
| 374 | |
bnc | 4233140 | 2016-07-25 13:36:15 | [diff] [blame] | 375 | // Wait for HEADERS frame from the server |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 376 | next_state_ = STATE_READ_REPLY_COMPLETE; |
| 377 | return ERR_IO_PENDING; |
| 378 | } |
| 379 | |
| 380 | int SpdyProxyClientSocket::DoReadReplyComplete(int result) { |
| 381 | // We enter this method directly from DoSendRequestComplete, since |
bnc | 4233140 | 2016-07-25 13:36:15 | [diff] [blame] | 382 | // we are notified by a callback when the HEADERS frame arrives. |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 383 | |
| 384 | if (result < 0) |
| 385 | return result; |
| 386 | |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 387 | // Require the "HTTP/1.x" status line for SSL CONNECT. |
bnc | be0f6af | 2015-10-15 17:49:56 | [diff] [blame] | 388 | if (response_.headers->GetHttpVersion() < HttpVersion(1, 0)) |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 389 | return ERR_TUNNEL_CONNECTION_FAILED; |
| 390 | |
[email protected] | 3abacd6 | 2012-06-10 20:20:32 | [diff] [blame] | 391 | net_log_.AddEvent( |
mikecirone | 8b85c43 | 2016-09-08 19:11:00 | [diff] [blame] | 392 | NetLogEventType::HTTP_TRANSACTION_READ_TUNNEL_RESPONSE_HEADERS, |
[email protected] | 3abacd6 | 2012-06-10 20:20:32 | [diff] [blame] | 393 | base::Bind(&HttpResponseHeaders::NetLogCallback, response_.headers)); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 394 | |
[email protected] | 4eddbc73 | 2012-08-09 05:40:17 | [diff] [blame] | 395 | switch (response_.headers->response_code()) { |
| 396 | case 200: // OK |
| 397 | next_state_ = STATE_OPEN; |
| 398 | return OK; |
| 399 | |
| 400 | case 302: // Found / Moved Temporarily |
| 401 | // Try to return a sanitized response so we can follow auth redirects. |
| 402 | // If we can't, fail the tunnel connection. |
ttuttle | 7933c11 | 2015-01-06 00:55:24 | [diff] [blame] | 403 | if (!SanitizeProxyRedirect(&response_)) { |
[email protected] | 4eddbc73 | 2012-08-09 05:40:17 | [diff] [blame] | 404 | LogBlockedTunnelResponse(); |
| 405 | return ERR_TUNNEL_CONNECTION_FAILED; |
| 406 | } |
| 407 | |
ttuttle | 7933c11 | 2015-01-06 00:55:24 | [diff] [blame] | 408 | redirect_has_load_timing_info_ = |
| 409 | spdy_stream_->GetLoadTimingInfo(&redirect_load_timing_info_); |
diannahu | 9904e27 | 2017-02-03 14:40:08 | [diff] [blame] | 410 | // Note that this triggers a ERROR_CODE_CANCEL. |
ttuttle | 7933c11 | 2015-01-06 00:55:24 | [diff] [blame] | 411 | spdy_stream_->DetachDelegate(); |
| 412 | next_state_ = STATE_DISCONNECTED; |
| 413 | return ERR_HTTPS_PROXY_TUNNEL_RESPONSE; |
| 414 | |
[email protected] | 4eddbc73 | 2012-08-09 05:40:17 | [diff] [blame] | 415 | case 407: // Proxy Authentication Required |
| 416 | next_state_ = STATE_OPEN; |
ttuttle | 7933c11 | 2015-01-06 00:55:24 | [diff] [blame] | 417 | if (!SanitizeProxyAuth(&response_)) { |
| 418 | LogBlockedTunnelResponse(); |
| 419 | return ERR_TUNNEL_CONNECTION_FAILED; |
| 420 | } |
[email protected] | 9049948 | 2013-06-01 00:39:50 | [diff] [blame] | 421 | return HandleProxyAuthChallenge(auth_.get(), &response_, net_log_); |
[email protected] | 4eddbc73 | 2012-08-09 05:40:17 | [diff] [blame] | 422 | |
| 423 | default: |
| 424 | // Ignore response to avoid letting the proxy impersonate the target |
| 425 | // server. (See http://crbug.com/137891.) |
| 426 | LogBlockedTunnelResponse(); |
| 427 | return ERR_TUNNEL_CONNECTION_FAILED; |
[email protected] | 511f6f5 | 2010-12-17 03:58:29 | [diff] [blame] | 428 | } |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 429 | } |
| 430 | |
| 431 | // SpdyStream::Delegate methods: |
| 432 | // Called when SYN frame has been sent. |
| 433 | // Returns true if no more data to be sent after SYN frame. |
bnc | 4c21431 | 2016-11-28 16:49:15 | [diff] [blame] | 434 | void SpdyProxyClientSocket::OnHeadersSent() { |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 435 | DCHECK_EQ(next_state_, STATE_SEND_REQUEST_COMPLETE); |
| 436 | |
[email protected] | d46715c | 2013-04-15 00:21:42 | [diff] [blame] | 437 | OnIOComplete(OK); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 438 | } |
| 439 | |
bnc | 4c21431 | 2016-11-28 16:49:15 | [diff] [blame] | 440 | void SpdyProxyClientSocket::OnHeadersReceived( |
[email protected] | 6d116e1a | 2013-06-24 07:42:15 | [diff] [blame] | 441 | const SpdyHeaderBlock& response_headers) { |
[email protected] | d0835850 | 2010-12-03 22:04:03 | [diff] [blame] | 442 | // If we've already received the reply, existing headers are too late. |
| 443 | // TODO(mbelshe): figure out a way to make HEADERS frames useful after the |
| 444 | // initial response. |
| 445 | if (next_state_ != STATE_READ_REPLY_COMPLETE) |
bnc | 4c21431 | 2016-11-28 16:49:15 | [diff] [blame] | 446 | return; |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 447 | |
[email protected] | d0835850 | 2010-12-03 22:04:03 | [diff] [blame] | 448 | // Save the response |
bnc | 4c21431 | 2016-11-28 16:49:15 | [diff] [blame] | 449 | const bool headers_valid = |
| 450 | SpdyHeadersToHttpResponse(response_headers, &response_); |
| 451 | DCHECK(headers_valid); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 452 | |
[email protected] | 6d116e1a | 2013-06-24 07:42:15 | [diff] [blame] | 453 | OnIOComplete(OK); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 454 | } |
| 455 | |
[email protected] | ca690b0 | 2013-04-17 10:38:43 | [diff] [blame] | 456 | // Called when data is received or on EOF (if |buffer| is NULL). |
danakj | aee3e1ec | 2016-04-16 00:23:18 | [diff] [blame] | 457 | void SpdyProxyClientSocket::OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) { |
[email protected] | ca690b0 | 2013-04-17 10:38:43 | [diff] [blame] | 458 | if (buffer) { |
mikecirone | 8b85c43 | 2016-09-08 19:11:00 | [diff] [blame] | 459 | net_log_.AddByteTransferEvent(NetLogEventType::SOCKET_BYTES_RECEIVED, |
[email protected] | ca690b0 | 2013-04-17 10:38:43 | [diff] [blame] | 460 | buffer->GetRemainingSize(), |
| 461 | buffer->GetRemainingData()); |
dcheng | c7eeda42 | 2015-12-26 03:56:48 | [diff] [blame] | 462 | read_buffer_queue_.Enqueue(std::move(buffer)); |
[email protected] | ca690b0 | 2013-04-17 10:38:43 | [diff] [blame] | 463 | } else { |
mikecirone | 8b85c43 | 2016-09-08 19:11:00 | [diff] [blame] | 464 | net_log_.AddByteTransferEvent(NetLogEventType::SOCKET_BYTES_RECEIVED, 0, |
| 465 | NULL); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 466 | } |
| 467 | |
[email protected] | 83039bb | 2011-12-09 18:43:55 | [diff] [blame] | 468 | if (!read_callback_.is_null()) { |
[email protected] | ca690b0 | 2013-04-17 10:38:43 | [diff] [blame] | 469 | int rv = PopulateUserReadBuffer(user_buffer_->data(), user_buffer_len_); |
[email protected] | dbf036f | 2011-12-06 23:33:24 | [diff] [blame] | 470 | CompletionCallback c = read_callback_; |
| 471 | read_callback_.Reset(); |
| 472 | user_buffer_ = NULL; |
[email protected] | ca690b0 | 2013-04-17 10:38:43 | [diff] [blame] | 473 | user_buffer_len_ = 0; |
[email protected] | dbf036f | 2011-12-06 23:33:24 | [diff] [blame] | 474 | c.Run(rv); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 475 | } |
| 476 | } |
| 477 | |
[email protected] | aa19cfc | 2013-05-23 16:41:38 | [diff] [blame] | 478 | void SpdyProxyClientSocket::OnDataSent() { |
[email protected] | 83039bb | 2011-12-09 18:43:55 | [diff] [blame] | 479 | DCHECK(!write_callback_.is_null()); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 480 | |
[email protected] | aa19cfc | 2013-05-23 16:41:38 | [diff] [blame] | 481 | int rv = write_buffer_len_; |
| 482 | write_buffer_len_ = 0; |
[email protected] | 89d4d79 | 2014-04-06 16:27:15 | [diff] [blame] | 483 | |
| 484 | // Proxy write callbacks result in deep callback chains. Post to allow the |
| 485 | // stream's write callback chain to unwind (see crbug.com/355511). |
skyostil | 4891b25b | 2015-06-11 11:43:45 | [diff] [blame] | 486 | base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 487 | FROM_HERE, base::Bind(&SpdyProxyClientSocket::RunCallback, |
| 488 | write_callback_weak_factory_.GetWeakPtr(), |
tzik | 2ac7d80 | 2016-02-04 01:57:17 | [diff] [blame] | 489 | base::ResetAndReturn(&write_callback_), rv)); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 490 | } |
| 491 | |
xunjieli | 294da72 | 2015-08-11 19:15:02 | [diff] [blame] | 492 | void SpdyProxyClientSocket::OnTrailers(const SpdyHeaderBlock& trailers) { |
| 493 | // |spdy_stream_| is of type SPDY_BIDIRECTIONAL_STREAM, so trailers are |
| 494 | // combined with response headers and this method will not be calld. |
| 495 | NOTREACHED(); |
| 496 | } |
| 497 | |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 498 | void SpdyProxyClientSocket::OnClose(int status) { |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 499 | was_ever_used_ = spdy_stream_->WasEverUsed(); |
[email protected] | d26ff35 | 2013-05-13 08:48:28 | [diff] [blame] | 500 | spdy_stream_.reset(); |
[email protected] | d9da5fe | 2010-10-13 22:37:16 | [diff] [blame] | 501 | |
| 502 | bool connecting = next_state_ != STATE_DISCONNECTED && |
| 503 | next_state_ < STATE_OPEN; |
| 504 | if (next_state_ == STATE_OPEN) |
| 505 | next_state_ = STATE_CLOSED; |
| 506 | else |
| 507 | next_state_ = STATE_DISCONNECTED; |
| 508 | |
[email protected] | 6af4e41 | 2011-11-29 23:39:18 | [diff] [blame] | 509 | base::WeakPtr<SpdyProxyClientSocket> weak_ptr = weak_factory_.GetWeakPtr(); |
[email protected] | 83039bb | 2011-12-09 18:43:55 | [diff] [blame] | 510 | CompletionCallback write_callback = write_callback_; |
| 511 | write_callback_.Reset(); |
[email protected] | d9da5fe | 2010-10-13 22:37:16 | [diff] [blame] | 512 | write_buffer_len_ = 0; |
[email protected] | d9da5fe | 2010-10-13 22:37:16 | [diff] [blame] | 513 | |
| 514 | // If we're in the middle of connecting, we need to make sure |
| 515 | // we invoke the connect callback. |
| 516 | if (connecting) { |
[email protected] | 83039bb | 2011-12-09 18:43:55 | [diff] [blame] | 517 | DCHECK(!read_callback_.is_null()); |
| 518 | CompletionCallback read_callback = read_callback_; |
| 519 | read_callback_.Reset(); |
| 520 | read_callback.Run(status); |
| 521 | } else if (!read_callback_.is_null()) { |
[email protected] | 6af4e41 | 2011-11-29 23:39:18 | [diff] [blame] | 522 | // If we have a read_callback_, the we need to make sure we call it back. |
danakj | aee3e1ec | 2016-04-16 00:23:18 | [diff] [blame] | 523 | OnDataReceived(std::unique_ptr<SpdyBuffer>()); |
[email protected] | d9da5fe | 2010-10-13 22:37:16 | [diff] [blame] | 524 | } |
[email protected] | 6af4e41 | 2011-11-29 23:39:18 | [diff] [blame] | 525 | // This may have been deleted by read_callback_, so check first. |
[email protected] | 11fbca0b | 2013-06-02 23:37:21 | [diff] [blame] | 526 | if (weak_ptr.get() && !write_callback.is_null()) |
[email protected] | 83039bb | 2011-12-09 18:43:55 | [diff] [blame] | 527 | write_callback.Run(ERR_CONNECTION_CLOSED); |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 528 | } |
| 529 | |
bnc | 3d95ca9 | 2017-03-29 13:20:34 | [diff] [blame^] | 530 | NetLogSource SpdyProxyClientSocket::source_dependency() const { |
| 531 | return source_dependency_; |
| 532 | } |
| 533 | |
[email protected] | fe2f62a | 2010-10-01 03:34:07 | [diff] [blame] | 534 | } // namespace net |