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

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

Issue 1505563002: Close the QUIC connection when non-crypto stream data is written at ENCRYPTION_NONE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 QuicStreamId id, 1105 QuicStreamId id,
1106 QuicIOVector iov, 1106 QuicIOVector iov,
1107 QuicStreamOffset offset, 1107 QuicStreamOffset offset,
1108 bool fin, 1108 bool fin,
1109 FecProtection fec_protection, 1109 FecProtection fec_protection,
1110 QuicAckListenerInterface* listener) { 1110 QuicAckListenerInterface* listener) {
1111 if (!fin && iov.total_length == 0) { 1111 if (!fin && iov.total_length == 0) {
1112 LOG(DFATAL) << "Attempt to send empty stream frame"; 1112 LOG(DFATAL) << "Attempt to send empty stream frame";
1113 return QuicConsumedData(0, false); 1113 return QuicConsumedData(0, false);
1114 } 1114 }
1115 if (FLAGS_quic_never_write_unencrypted_data && id != kCryptoStreamId &&
1116 encryption_level_ == ENCRYPTION_NONE) {
1117 LOG(DFATAL) << "Cannot send stream data without encryption.";
1118 CloseConnection(QUIC_UNENCRYPTED_STREAM_DATA, false);
1119 return QuicConsumedData(0, false);
1120 }
1115 1121
1116 // Opportunistically bundle an ack with every outgoing packet. 1122 // Opportunistically bundle an ack with every outgoing packet.
1117 // Particularly, we want to bundle with handshake packets since we don't know 1123 // Particularly, we want to bundle with handshake packets since we don't know
1118 // which decrypter will be used on an ack packet following a handshake 1124 // which decrypter will be used on an ack packet following a handshake
1119 // packet (a handshake packet from client to server could result in a REJ or a 1125 // packet (a handshake packet from client to server could result in a REJ or a
1120 // SHLO from the server, leading to two different decrypters at the server.) 1126 // SHLO from the server, leading to two different decrypters at the server.)
1121 // 1127 //
1122 // TODO(jri): Note that ConsumeData may cause a response packet to be sent. 1128 // TODO(jri): Note that ConsumeData may cause a response packet to be sent.
1123 // We may end up sending stale ack information if there are undecryptable 1129 // We may end up sending stale ack information if there are undecryptable
1124 // packets hanging around and/or there are revivable packets which may get 1130 // packets hanging around and/or there are revivable packets which may get
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after
2386 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; 2392 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1;
2387 ++mtu_probe_count_; 2393 ++mtu_probe_count_;
2388 2394
2389 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; 2395 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_;
2390 SendMtuDiscoveryPacket(mtu_discovery_target_); 2396 SendMtuDiscoveryPacket(mtu_discovery_target_);
2391 2397
2392 DCHECK(!mtu_discovery_alarm_->IsSet()); 2398 DCHECK(!mtu_discovery_alarm_->IsSet());
2393 } 2399 }
2394 2400
2395 } // namespace net 2401 } // 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