From b40d5cb10fb3f094033083d060397898eaaa022a Mon Sep 17 00:00:00 2001
From: "rch@chromium.org"
 <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Mon, 27 Feb 2012 05:30:18 +0000
Subject: Modify SpdyProxyClientSocket to respond to a 407 Proxy Auth Require
 challenge in the same way that HttpProxyClientSocket does.

BUG=115659


Review URL: http://codereview.chromium.org/9459003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123712 0039d316-1c4b-4281-b951-d872f2087c98
---
 net/spdy/spdy_proxy_client_socket.cc          | 2 +-
 net/spdy/spdy_proxy_client_socket_unittest.cc | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

(limited to 'net/spdy')

diff --git a/net/spdy/spdy_proxy_client_socket.cc b/net/spdy/spdy_proxy_client_socket.cc
index 43195b8..f44bfa1 100644
--- a/net/spdy/spdy_proxy_client_socket.cc
+++ b/net/spdy/spdy_proxy_client_socket.cc
@@ -411,7 +411,7 @@ int SpdyProxyClientSocket::DoReadReplyComplete(int result) {
   if (response_.headers->response_code() == 200) {
     return OK;
   } else if (response_.headers->response_code() == 407) {
-    return ERR_TUNNEL_CONNECTION_FAILED;
+    return HandleProxyAuthChallenge(auth_, &response_, net_log_);
   } else {
     // Immediately hand off our SpdyStream to a newly created SpdyHttpStream
     // so that any subsequent SpdyFrames are processed in the context of
diff --git a/net/spdy/spdy_proxy_client_socket_unittest.cc b/net/spdy/spdy_proxy_client_socket_unittest.cc
index 1c520b9..b6a3d4e 100644
--- a/net/spdy/spdy_proxy_client_socket_unittest.cc
+++ b/net/spdy/spdy_proxy_client_socket_unittest.cc
@@ -450,7 +450,7 @@ TEST_F(SpdyProxyClientSocketTest, ConnectWithAuthRequested) {
 
   Initialize(reads, arraysize(reads), writes, arraysize(writes));
 
-  AssertConnectFails(ERR_TUNNEL_CONNECTION_FAILED);
+  AssertConnectFails(ERR_PROXY_AUTH_REQUESTED);
 
   const HttpResponseInfo* response = sock_->GetConnectResponseInfo();
   ASSERT_TRUE(response != NULL);
@@ -831,7 +831,7 @@ TEST_F(SpdyProxyClientSocketTest, ReadAuthResponseBody) {
 
   Initialize(reads, arraysize(reads), writes, arraysize(writes));
 
-  AssertConnectFails(ERR_TUNNEL_CONNECTION_FAILED);
+  AssertConnectFails(ERR_PROXY_AUTH_REQUESTED);
 
   Run(2);  // SpdySession consumes the next two reads and sends then to
            // sock_ to be buffered.
-- 
cgit v1.1