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/tools/quic/quic_time_wait_list_manager.h" | 5 #include "net/tools/quic/quic_time_wait_list_manager.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 } | 233 } |
234 | 234 |
235 bool QuicTimeWaitListManager::WriteToWire(QueuedPacket* queued_packet) { | 235 bool QuicTimeWaitListManager::WriteToWire(QueuedPacket* queued_packet) { |
236 if (writer_->IsWriteBlocked()) { | 236 if (writer_->IsWriteBlocked()) { |
237 visitor_->OnWriteBlocked(this); | 237 visitor_->OnWriteBlocked(this); |
238 return false; | 238 return false; |
239 } | 239 } |
240 WriteResult result = writer_->WritePacket( | 240 WriteResult result = writer_->WritePacket( |
241 queued_packet->packet()->data(), queued_packet->packet()->length(), | 241 queued_packet->packet()->data(), queued_packet->packet()->length(), |
242 queued_packet->server_address().address().bytes(), | 242 queued_packet->server_address().address().bytes(), |
243 queued_packet->client_address()); | 243 queued_packet->client_address(), nullptr); |
244 if (result.status == WRITE_STATUS_BLOCKED) { | 244 if (result.status == WRITE_STATUS_BLOCKED) { |
245 // If blocked and unbuffered, return false to retry sending. | 245 // If blocked and unbuffered, return false to retry sending. |
246 DCHECK(writer_->IsWriteBlocked()); | 246 DCHECK(writer_->IsWriteBlocked()); |
247 visitor_->OnWriteBlocked(this); | 247 visitor_->OnWriteBlocked(this); |
248 return writer_->IsWriteBlockedDataBuffered(); | 248 return writer_->IsWriteBlockedDataBuffered(); |
249 } else if (result.status == WRITE_STATUS_ERROR) { | 249 } else if (result.status == WRITE_STATUS_ERROR) { |
250 LOG(WARNING) << "Received unknown error while sending reset packet to " | 250 LOG(WARNING) << "Received unknown error while sending reset packet to " |
251 << queued_packet->client_address().ToString() << ": " | 251 << queued_packet->client_address().ToString() << ": " |
252 << strerror(result.error_code); | 252 << strerror(result.error_code); |
253 } | 253 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 QuicTime time_added_, | 321 QuicTime time_added_, |
322 bool connection_rejected_statelessly) | 322 bool connection_rejected_statelessly) |
323 : num_packets(num_packets_), | 323 : num_packets(num_packets_), |
324 version(version_), | 324 version(version_), |
325 time_added(time_added_), | 325 time_added(time_added_), |
326 connection_rejected_statelessly(connection_rejected_statelessly) {} | 326 connection_rejected_statelessly(connection_rejected_statelessly) {} |
327 | 327 |
328 QuicTimeWaitListManager::ConnectionIdData::~ConnectionIdData() {} | 328 QuicTimeWaitListManager::ConnectionIdData::~ConnectionIdData() {} |
329 | 329 |
330 } // namespace net | 330 } // namespace net |
OLD | NEW |