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

Unified Diff: net/quic/quic_connection.cc

Issue 301563006: Add a packet bundler in the internal server so that headers and body go (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection.cc
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
index f34ea5d3f593a738d949b4c8d1e0786c5bebd20b..8162c3c964dc98304587d17590f43edef5b75bcc 100644
--- a/net/quic/quic_connection.cc
+++ b/net/quic/quic_connection.cc
@@ -1944,7 +1944,11 @@ QuicConnection::ScopedPacketBundler::ScopedPacketBundler(
QuicConnection* connection,
AckBundling send_ack)
: connection_(connection),
- already_in_batch_mode_(connection->packet_generator_.InBatchMode()) {
+ already_in_batch_mode_(connection != NULL &&
+ connection->packet_generator_.InBatchMode()) {
+ if (connection_ == NULL) {
+ return;
+ }
// Move generator into batch mode. If caller wants us to include an ack,
// check the delayed-ack timer to see if there's ack info to be sent.
if (!already_in_batch_mode_) {
@@ -1962,6 +1966,9 @@ QuicConnection::ScopedPacketBundler::ScopedPacketBundler(
}
QuicConnection::ScopedPacketBundler::~ScopedPacketBundler() {
+ if (connection_ == NULL) {
+ return;
+ }
// If we changed the generator's batch state, restore original batch state.
if (!already_in_batch_mode_) {
DVLOG(1) << "Leaving Batch Mode.";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698