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

Unified Diff: net/quic/quic_client_session.cc

Issue 14083012: QUIC: retransmit packets with the correct encryption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved HandshakeMode enum to MockCryptoClientStream Created 7 years, 8 months 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
« no previous file with comments | « net/quic/quic_client_session.h ('k') | net/quic/quic_client_session_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_client_session.cc
diff --git a/net/quic/quic_client_session.cc b/net/quic/quic_client_session.cc
index b1bcd549fd7481ff3cb3b8fa27b09d3c93133070..54fd62308b407628c7767b20c591854fcb8667fc 100644
--- a/net/quic/quic_client_session.cc
+++ b/net/quic/quic_client_session.cc
@@ -4,6 +4,7 @@
#include "net/quic/quic_client_session.h"
+#include "base/callback_helpers.h"
#include "base/message_loop.h"
#include "base/stl_util.h"
#include "base/string_number_conversions.h"
@@ -50,13 +51,14 @@ QuicClientSession::QuicClientSession(
}
QuicClientSession::~QuicClientSession() {
+ DCHECK(callback_.is_null());
connection()->set_debug_visitor(NULL);
net_log_.EndEvent(NetLog::TYPE_QUIC_SESSION);
}
QuicReliableClientStream* QuicClientSession::CreateOutgoingReliableStream() {
- if (!crypto_stream_->handshake_complete()) {
- DLOG(INFO) << "Crypto handshake not complete, no outgoing stream created.";
+ if (!crypto_stream_->encryption_established()) {
+ DLOG(INFO) << "Encryption not active so no outgoing stream created.";
return NULL;
}
if (GetNumOpenStreams() >= get_max_open_streams()) {
@@ -87,7 +89,7 @@ int QuicClientSession::CryptoConnect(const CompletionCallback& callback) {
return ERR_CONNECTION_FAILED;
}
- if (IsCryptoHandshakeComplete()) {
+ if (IsEncryptionEstablished()) {
return OK;
}
@@ -109,12 +111,21 @@ void QuicClientSession::CloseStream(QuicStreamId stream_id) {
}
}
-void QuicClientSession::OnCryptoHandshakeComplete(QuicErrorCode error) {
+void QuicClientSession::OnCryptoHandshakeEvent(CryptoHandshakeEvent event) {
if (!callback_.is_null()) {
- callback_.Run(error == QUIC_NO_ERROR ? OK : ERR_UNEXPECTED);
+ // TODO(rtenneti): Currently for all CryptoHandshakeEvent events, callback_
+ // could send the data. Change the following code if that changes.
Ryan Hamilton 2013/05/02 17:37:36 I don't understand what this comment means.
ramant (doing other things) 2013/05/02 18:31:51 Updated the comment in the CL https://chromiumcode
+ base::ResetAndReturn(&callback_).Run(OK);
}
}
+void QuicClientSession::ConnectionClose(QuicErrorCode error, bool from_peer) {
+ if (!callback_.is_null()) {
+ base::ResetAndReturn(&callback_).Run(error);
+ }
+ QuicSession::ConnectionClose(error, from_peer);
+}
+
void QuicClientSession::StartReading() {
if (read_pending_) {
return;
@@ -137,6 +148,9 @@ void QuicClientSession::StartReading() {
}
void QuicClientSession::CloseSessionOnError(int error) {
+ if (!callback_.is_null()) {
+ base::ResetAndReturn(&callback_).Run(error);
+ }
while (!streams()->empty()) {
ReliableQuicStream* stream = streams()->begin()->second;
QuicStreamId id = stream->id();
« no previous file with comments | « net/quic/quic_client_session.h ('k') | net/quic/quic_client_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698