| 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 #include "net/spdy/spdy_proxy_client_socket.h" | 5 #include "net/spdy/spdy_proxy_client_socket.h" |
| 6 | 6 |
| 7 #include <algorithm> // min | 7 #include <algorithm> // min |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 &request_headers); | 360 &request_headers); |
| 361 | 361 |
| 362 net_log_.AddEvent( | 362 net_log_.AddEvent( |
| 363 NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS, | 363 NetLog::TYPE_HTTP_TRANSACTION_SEND_TUNNEL_HEADERS, |
| 364 base::Bind(&HttpRequestHeaders::NetLogCallback, | 364 base::Bind(&HttpRequestHeaders::NetLogCallback, |
| 365 base::Unretained(&request_headers), | 365 base::Unretained(&request_headers), |
| 366 &request_line)); | 366 &request_line)); |
| 367 | 367 |
| 368 request_.extra_headers.MergeFrom(request_headers); | 368 request_.extra_headers.MergeFrom(request_headers); |
| 369 scoped_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock()); | 369 scoped_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock()); |
| 370 CreateSpdyHeadersFromHttpRequest(request_, request_headers, headers.get(), | 370 CreateSpdyHeadersFromHttpRequest(request_, request_headers, |
| 371 spdy_stream_->GetProtocolVersion(), true); | 371 spdy_stream_->GetProtocolVersion(), true, |
| 372 headers.get()); |
| 372 // Reset the URL to be the endpoint of the connection | 373 // Reset the URL to be the endpoint of the connection |
| 373 if (spdy_stream_->GetProtocolVersion() > 2) { | 374 if (spdy_stream_->GetProtocolVersion() > 2) { |
| 374 (*headers)[":path"] = endpoint_.ToString(); | 375 (*headers)[":path"] = endpoint_.ToString(); |
| 375 headers->erase(":scheme"); | 376 headers->erase(":scheme"); |
| 376 } else { | 377 } else { |
| 377 (*headers)["url"] = endpoint_.ToString(); | 378 (*headers)["url"] = endpoint_.ToString(); |
| 378 headers->erase("scheme"); | 379 headers->erase("scheme"); |
| 379 } | 380 } |
| 380 | 381 |
| 381 return spdy_stream_->SendRequestHeaders(headers.Pass(), MORE_DATA_TO_SEND); | 382 return spdy_stream_->SendRequestHeaders(headers.Pass(), MORE_DATA_TO_SEND); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 } else if (!read_callback_.is_null()) { | 527 } else if (!read_callback_.is_null()) { |
| 527 // If we have a read_callback_, the we need to make sure we call it back. | 528 // If we have a read_callback_, the we need to make sure we call it back. |
| 528 OnDataReceived(scoped_ptr<SpdyBuffer>()); | 529 OnDataReceived(scoped_ptr<SpdyBuffer>()); |
| 529 } | 530 } |
| 530 // This may have been deleted by read_callback_, so check first. | 531 // This may have been deleted by read_callback_, so check first. |
| 531 if (weak_ptr.get() && !write_callback.is_null()) | 532 if (weak_ptr.get() && !write_callback.is_null()) |
| 532 write_callback.Run(ERR_CONNECTION_CLOSED); | 533 write_callback.Run(ERR_CONNECTION_CLOSED); |
| 533 } | 534 } |
| 534 | 535 |
| 535 } // namespace net | 536 } // namespace net |
| OLD | NEW |