| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 5 #ifndef NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
| 6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 bool using_proxy_; // True if using a proxy for HTTP (not HTTPS) | 232 bool using_proxy_; // True if using a proxy for HTTP (not HTTPS) |
| 233 bool using_tunnel_; // True if using a tunnel for HTTPS | 233 bool using_tunnel_; // True if using a tunnel for HTTPS |
| 234 | 234 |
| 235 // True while establishing a tunnel. This allows the HTTP CONNECT | 235 // True while establishing a tunnel. This allows the HTTP CONNECT |
| 236 // request/response to reuse the STATE_WRITE_HEADERS, | 236 // request/response to reuse the STATE_WRITE_HEADERS, |
| 237 // STATE_WRITE_HEADERS_COMPLETE, STATE_READ_HEADERS, and | 237 // STATE_WRITE_HEADERS_COMPLETE, STATE_READ_HEADERS, and |
| 238 // STATE_READ_HEADERS_COMPLETE states and allows us to tell them apart from | 238 // STATE_READ_HEADERS_COMPLETE states and allows us to tell them apart from |
| 239 // the real request/response of the transaction. | 239 // the real request/response of the transaction. |
| 240 bool establishing_tunnel_; | 240 bool establishing_tunnel_; |
| 241 | 241 |
| 242 // Only used between the states |
| 243 // STATE_READ_BODY/STATE_DRAIN_BODY_FOR_AUTH and |
| 244 // STATE_READ_BODY_COMPLETE/STATE_DRAIN_BODY_FOR_AUTH_COMPLETE. |
| 245 // |
| 246 // Set to true when DoReadBody or DoDrainBodyForAuthRestart starts to read |
| 247 // the response body from the socket, and set to false when the socket read |
| 248 // call completes. DoReadBodyComplete and DoDrainBodyForAuthRestartComplete |
| 249 // use this boolean to disambiguate a |result| of 0 between a connection |
| 250 // closure (EOF) and reaching the end of the response body (no more data). |
| 251 // |
| 252 // TODO(wtc): this is similar to the |ignore_ok_result_| member of the |
| 253 // SSLClientSocketWin class. We may want to add an internal error code, say |
| 254 // ERR_EOF, to indicate a connection closure, so that 0 simply means 0 bytes |
| 255 // or OK. Note that we already have an ERR_CONNECTION_CLOSED error code, |
| 256 // but it isn't really being used. |
| 257 bool reading_body_from_socket_; |
| 258 |
| 242 SSLConfig ssl_config_; | 259 SSLConfig ssl_config_; |
| 243 | 260 |
| 244 std::string request_headers_; | 261 std::string request_headers_; |
| 245 size_t request_headers_bytes_sent_; | 262 size_t request_headers_bytes_sent_; |
| 246 scoped_ptr<UploadDataStream> request_body_stream_; | 263 scoped_ptr<UploadDataStream> request_body_stream_; |
| 247 | 264 |
| 248 // The read buffer may be larger than it is full. The 'capacity' indicates | 265 // The read buffer may be larger than it is full. The 'capacity' indicates |
| 249 // the allocation size of the buffer, and the 'len' indicates how much data | 266 // the allocation size of the buffer, and the 'len' indicates how much data |
| 250 // is in the buffer already. The 'body offset' indicates the offset of the | 267 // is in the buffer already. The 'body offset' indicates the offset of the |
| 251 // start of the response body within the read buffer. | 268 // start of the response body within the read buffer. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 STATE_DRAIN_BODY_FOR_AUTH_RESTART, | 328 STATE_DRAIN_BODY_FOR_AUTH_RESTART, |
| 312 STATE_DRAIN_BODY_FOR_AUTH_RESTART_COMPLETE, | 329 STATE_DRAIN_BODY_FOR_AUTH_RESTART_COMPLETE, |
| 313 STATE_NONE | 330 STATE_NONE |
| 314 }; | 331 }; |
| 315 State next_state_; | 332 State next_state_; |
| 316 }; | 333 }; |
| 317 | 334 |
| 318 } // namespace net | 335 } // namespace net |
| 319 | 336 |
| 320 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 337 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
| OLD | NEW |