| 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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| 1135 | 1141 |
| 1136 // Opportunistically bundle an ack with every outgoing packet. | 1142 // Opportunistically bundle an ack with every outgoing packet. |
| 1137 // Particularly, we want to bundle with handshake packets since we don't know | 1143 // Particularly, we want to bundle with handshake packets since we don't know |
| 1138 // which decrypter will be used on an ack packet following a handshake | 1144 // which decrypter will be used on an ack packet following a handshake |
| 1139 // packet (a handshake packet from client to server could result in a REJ or a | 1145 // packet (a handshake packet from client to server could result in a REJ or a |
| 1140 // SHLO from the server, leading to two different decrypters at the server.) | 1146 // SHLO from the server, leading to two different decrypters at the server.) |
| 1141 // | 1147 // |
| 1142 // TODO(jri): Note that ConsumeData may cause a response packet to be sent. | 1148 // TODO(jri): Note that ConsumeData may cause a response packet to be sent. |
| 1143 // We may end up sending stale ack information if there are undecryptable | 1149 // We may end up sending stale ack information if there are undecryptable |
| 1144 // packets hanging around and/or there are revivable packets which may get | 1150 // packets hanging around and/or there are revivable packets which may get |
| (...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2314 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; | 2320 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; |
| 2315 ++mtu_probe_count_; | 2321 ++mtu_probe_count_; |
| 2316 | 2322 |
| 2317 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; | 2323 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; |
| 2318 SendMtuDiscoveryPacket(mtu_discovery_target_); | 2324 SendMtuDiscoveryPacket(mtu_discovery_target_); |
| 2319 | 2325 |
| 2320 DCHECK(!mtu_discovery_alarm_->IsSet()); | 2326 DCHECK(!mtu_discovery_alarm_->IsSet()); |
| 2321 } | 2327 } |
| 2322 | 2328 |
| 2323 } // namespace net | 2329 } // namespace net |
| OLD | NEW |