summaryrefslogtreecommitdiffstats
path: root/net/flip
diff options
context:
space:
mode:
authorwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-09 19:09:01 +0000
committerwtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-09 19:09:01 +0000
commitdcc6bbbd32061a542a481f2131578eb23f76aa71 (patch)
treed044db471d6910d40db917c1b77e686e52ff51f9 /net/flip
parent17e7fcae1a25970a547ce4713eb98ceee437a2d0 (diff)
downloadchromium_src-dcc6bbbd32061a542a481f2131578eb23f76aa71.zip
chromium_src-dcc6bbbd32061a542a481f2131578eb23f76aa71.tar.gz
chromium_src-dcc6bbbd32061a542a481f2131578eb23f76aa71.tar.bz2
FlipSession should save the SSLInfo in the HttpResponseInfo before
passing the HttpResponseInfo (containing the response headers) to FlipStream. R=mbelshe BUG=none TEST=The DCHECK in GetCertID() in resource_dispatcher_host.cc should not fail when you visit an HTTPS site using SPDY. Review URL: http://codereview.chromium.org/471007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34169 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/flip')
-rw-r--r--net/flip/flip_session.cc14
-rw-r--r--net/flip/flip_session.h6
2 files changed, 19 insertions, 1 deletions
diff --git a/net/flip/flip_session.cc b/net/flip/flip_session.cc
index 05065b0..891d1cd 100644
--- a/net/flip/flip_session.cc
+++ b/net/flip/flip_session.cc
@@ -178,6 +178,7 @@ FlipSession::FlipSession(const std::string& host, HttpNetworkSession* session)
stream_hi_water_mark_(1), // Always start at 1 for the first stream id.
write_pending_(false),
delayed_write_pending_(false),
+ is_secure_(false),
error_(OK),
state_(IDLE) {
// TODO(mbelshe): consider randomization of the stream_hi_water_mark.
@@ -406,6 +407,7 @@ void FlipSession::OnTCPConnect(int result) {
socket = session_->socket_factory()->CreateSSLClientSocket(
socket, "" /* request_->url.HostNoBrackets() */ , ssl_config_);
connection_.set_socket(socket);
+ is_secure_ = true;
// TODO(willchan): Plumb LoadLog into FLIP code.
int status = connection_.socket()->Connect(&ssl_connect_callback_, NULL);
if (status != ERR_IO_PENDING)
@@ -721,6 +723,14 @@ scoped_refptr<FlipStream> FlipSession::GetPushStream(const std::string& path) {
return stream;
}
+void FlipSession::GetSSLInfo(SSLInfo* ssl_info) {
+ if (is_secure_) {
+ SSLClientSocket* ssl_socket =
+ reinterpret_cast<SSLClientSocket*>(connection_.socket());
+ ssl_socket->GetSSLInfo(ssl_info);
+ }
+}
+
void FlipSession::OnError(flip::FlipFramer* framer) {
LOG(ERROR) << "FlipSession error: " << framer->error_code();
CloseSession(net::ERR_UNEXPECTED);
@@ -807,6 +817,7 @@ void FlipSession::OnSyn(const flip::FlipSynStreamControlFrame* frame,
// is a bit rigid for its http (non-flip) design.
HttpResponseInfo response;
if (FlipHeadersToHttpResponse(*headers, &response)) {
+ GetSSLInfo(&response.ssl_info);
stream->OnResponseReceived(response);
} else {
stream->OnClose(ERR_INVALID_RESPONSE);
@@ -830,7 +841,7 @@ void FlipSession::OnSynReply(const flip::FlipSynReplyControlFrame* frame,
return;
}
- LOG(INFO) << "FLIP SYN_REPLY RESPONSE HEADERS for stream: " << stream_id;
+ LOG(INFO) << "FLIP SYN_REPLY RESPONSE HEADERS for stream: " << stream_id;
DumpFlipHeaders(*headers);
// We record content declared as being pushed so that we don't
@@ -865,6 +876,7 @@ void FlipSession::OnSynReply(const flip::FlipSynReplyControlFrame* frame,
CHECK(stream->stream_id() == stream_id);
HttpResponseInfo response;
if (FlipHeadersToHttpResponse(*headers, &response)) {
+ GetSSLInfo(&response.ssl_info);
stream->OnResponseReceived(response);
} else {
stream->OnClose(ERR_INVALID_RESPONSE);
diff --git a/net/flip/flip_session.h b/net/flip/flip_session.h
index 965f515..d1090ce 100644
--- a/net/flip/flip_session.h
+++ b/net/flip/flip_session.h
@@ -33,6 +33,7 @@ class HttpNetworkSession;
class HttpRequestInfo;
class HttpResponseInfo;
class LoadLog;
+class SSLInfo;
class FlipSession : public base::RefCounted<FlipSession>,
public flip::FlipFramerVisitorInterface {
@@ -149,6 +150,8 @@ class FlipSession : public base::RefCounted<FlipSession>,
// list), returns NULL otherwise.
scoped_refptr<FlipStream> GetPushStream(const std::string& url);
+ void GetSSLInfo(SSLInfo* ssl_info);
+
// Callbacks for the Flip session.
CompletionCallbackImpl<FlipSession> connect_callback_;
CompletionCallbackImpl<FlipSession> ssl_connect_callback_;
@@ -202,6 +205,9 @@ class FlipSession : public base::RefCounted<FlipSession>,
// Flag if we have a pending message scheduled for WriteSocket.
bool delayed_write_pending_;
+ // Flag if we're using an SSL connection for this FlipSession.
+ bool is_secure_;
+
// Flip Frame state.
flip::FlipFramer flip_framer_;