| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |