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

Unified Diff: net/spdy/spdy_proxy_client_socket.cc

Issue 4935001: Allow a non-200 (or non-407) response for a CONNECT request from an HTTPS pro... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove stray reference to connect_response_http_stream.h Created 10 years 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
Index: net/spdy/spdy_proxy_client_socket.cc
===================================================================
--- net/spdy/spdy_proxy_client_socket.cc (revision 68026)
+++ net/spdy/spdy_proxy_client_socket.cc (working copy)
@@ -59,6 +59,14 @@
Disconnect();
}
+// In the event of a non-200 response to the CONNECT request, this
+// method may be called to return an HttpStream in order to read
+// the response body.
+HttpStream* SpdyProxyClientSocket::GetConnectResponseStream() {
+ DCHECK(response_stream_.get());
+ return response_stream_.release();
+}
+
// Sends a SYN_STREAM frame to the proxy with a CONNECT request
// for the specified endpoint. Waits for the server to send back
// a SYN_REPLY frame. OK will be returned if the status is 200.
@@ -353,10 +361,20 @@
make_scoped_refptr(new NetLogHttpResponseParameter(response_.headers)));
}
- if (response_.headers->response_code() == 200)
+ if (response_.headers->response_code() == 200) {
return OK;
- else
+ } else if (response_.headers->response_code() == 407) {
return ERR_TUNNEL_CONNECTION_FAILED;
+ } else {
+ // Immediately hand off our SpdyStream to a newly created SpdyHttpStream
+ // so that any subsequent SpdyFrames are processed in the context of
+ // the HttpStream, not the socket.
+ DCHECK(spdy_stream_);
+ SpdyStream* stream = spdy_stream_;
+ spdy_stream_ = NULL;
+ response_stream_.reset(new SpdyHttpStream(stream));
+ return ERR_HTTPS_PROXY_TUNNEL_CONNECTION_RESPONSE;
+ }
}
// SpdyStream::Delegate methods:

Powered by Google App Engine
This is Rietveld 408576698