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

Side by Side Diff: net/quic/quic_connection.cc

Issue 1519723002: Revert of Close the QUIC connection when non-crypto stream data is written at ENCRYPTION_NONE. Flag protected… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2526
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/quic/quic_connection_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_connection.h" 5 #include "net/quic/quic_connection.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 #include <sys/types.h> 8 #include <sys/types.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 QuicStreamId id, 1125 QuicStreamId id,
1126 const QuicIOVector& iov, 1126 const QuicIOVector& iov,
1127 QuicStreamOffset offset, 1127 QuicStreamOffset offset,
1128 bool fin, 1128 bool fin,
1129 FecProtection fec_protection, 1129 FecProtection fec_protection,
1130 QuicAckNotifier::DelegateInterface* delegate) { 1130 QuicAckNotifier::DelegateInterface* delegate) {
1131 if (!fin && iov.total_length == 0) { 1131 if (!fin && iov.total_length == 0) {
1132 LOG(DFATAL) << "Attempt to send empty stream frame"; 1132 LOG(DFATAL) << "Attempt to send empty stream frame";
1133 return QuicConsumedData(0, false); 1133 return QuicConsumedData(0, false);
1134 } 1134 }
1135 if (FLAGS_quic_never_write_unencrypted_data && id != kCryptoStreamId &&
1136 encryption_level_ == ENCRYPTION_NONE) {
1137 LOG(DFATAL) << "Cannot send stream data without encryption.";
1138 CloseConnection(QUIC_UNENCRYPTED_STREAM_DATA, false);
1139 return QuicConsumedData(0, false);
1140 }
1141 1135
1142 // Opportunistically bundle an ack with every outgoing packet. 1136 // Opportunistically bundle an ack with every outgoing packet.
1143 // Particularly, we want to bundle with handshake packets since we don't know 1137 // Particularly, we want to bundle with handshake packets since we don't know
1144 // which decrypter will be used on an ack packet following a handshake 1138 // which decrypter will be used on an ack packet following a handshake
1145 // packet (a handshake packet from client to server could result in a REJ or a 1139 // packet (a handshake packet from client to server could result in a REJ or a
1146 // SHLO from the server, leading to two different decrypters at the server.) 1140 // SHLO from the server, leading to two different decrypters at the server.)
1147 // 1141 //
1148 // TODO(jri): Note that ConsumeData may cause a response packet to be sent. 1142 // TODO(jri): Note that ConsumeData may cause a response packet to be sent.
1149 // We may end up sending stale ack information if there are undecryptable 1143 // We may end up sending stale ack information if there are undecryptable
1150 // packets hanging around and/or there are revivable packets which may get 1144 // packets hanging around and/or there are revivable packets which may get
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after
2320 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; 2314 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1;
2321 ++mtu_probe_count_; 2315 ++mtu_probe_count_;
2322 2316
2323 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; 2317 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_;
2324 SendMtuDiscoveryPacket(mtu_discovery_target_); 2318 SendMtuDiscoveryPacket(mtu_discovery_target_);
2325 2319
2326 DCHECK(!mtu_discovery_alarm_->IsSet()); 2320 DCHECK(!mtu_discovery_alarm_->IsSet());
2327 } 2321 }
2328 2322
2329 } // namespace net 2323 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698