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

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

Issue 1424043003: Cleanup: Call OnWriteError instead of directly closing the connection when failing to send a QUIC v… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@106394664
Patch Set: Created 5 years, 1 month 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 | no next file » | 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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 DVLOG(1) << ENDPOINT << "Sending version negotiation packet: {" 1096 DVLOG(1) << ENDPOINT << "Sending version negotiation packet: {"
1097 << QuicVersionVectorToString(framer_.supported_versions()) << "}"; 1097 << QuicVersionVectorToString(framer_.supported_versions()) << "}";
1098 scoped_ptr<QuicEncryptedPacket> version_packet( 1098 scoped_ptr<QuicEncryptedPacket> version_packet(
1099 packet_generator_.SerializeVersionNegotiationPacket( 1099 packet_generator_.SerializeVersionNegotiationPacket(
1100 framer_.supported_versions())); 1100 framer_.supported_versions()));
1101 WriteResult result = writer_->WritePacket( 1101 WriteResult result = writer_->WritePacket(
1102 version_packet->data(), version_packet->length(), 1102 version_packet->data(), version_packet->length(),
1103 self_address().address(), peer_address()); 1103 self_address().address(), peer_address());
1104 1104
1105 if (result.status == WRITE_STATUS_ERROR) { 1105 if (result.status == WRITE_STATUS_ERROR) {
1106 // We can't send an error as the socket is presumably borked. 1106 OnWriteError(result.error_code);
1107 CloseConnection(QUIC_PACKET_WRITE_ERROR, false);
1108 return; 1107 return;
1109 } 1108 }
1110 if (result.status == WRITE_STATUS_BLOCKED) { 1109 if (result.status == WRITE_STATUS_BLOCKED) {
1111 visitor_->OnWriteBlocked(); 1110 visitor_->OnWriteBlocked();
1112 if (writer_->IsWriteBlockedDataBuffered()) { 1111 if (writer_->IsWriteBlockedDataBuffered()) {
1113 pending_version_negotiation_packet_ = false; 1112 pending_version_negotiation_packet_ = false;
1114 } 1113 }
1115 return; 1114 return;
1116 } 1115 }
1117 1116
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
2299 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; 2298 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1;
2300 ++mtu_probe_count_; 2299 ++mtu_probe_count_;
2301 2300
2302 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; 2301 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_;
2303 SendMtuDiscoveryPacket(mtu_discovery_target_); 2302 SendMtuDiscoveryPacket(mtu_discovery_target_);
2304 2303
2305 DCHECK(!mtu_discovery_alarm_->IsSet()); 2304 DCHECK(!mtu_discovery_alarm_->IsSet());
2306 } 2305 }
2307 2306
2308 } // namespace net 2307 } // namespace net
OLDNEW
« 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