| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_time_wait_list_manager.h" | 5 #include "net/quic/quic_time_wait_list_manager.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 | 8 |
| 9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // pending_packets_queue takes the ownership of the queued packet. | 220 // pending_packets_queue takes the ownership of the queued packet. |
| 221 pending_packets_queue_.push_back(packet); | 221 pending_packets_queue_.push_back(packet); |
| 222 } | 222 } |
| 223 } | 223 } |
| 224 | 224 |
| 225 bool QuicTimeWaitListManager::WriteToWire(QueuedPacket* queued_packet) { | 225 bool QuicTimeWaitListManager::WriteToWire(QueuedPacket* queued_packet) { |
| 226 if (writer_->IsWriteBlocked()) { | 226 if (writer_->IsWriteBlocked()) { |
| 227 visitor_->OnWriteBlocked(this); | 227 visitor_->OnWriteBlocked(this); |
| 228 return false; | 228 return false; |
| 229 } | 229 } |
| 230 WriteResult result = writer_->WritePacket( | 230 WriteResult result = |
| 231 queued_packet->packet()->data(), | 231 writer_->WritePacket(queued_packet->packet()->data(), |
| 232 queued_packet->packet()->length(), | 232 queued_packet->packet()->length(), |
| 233 queued_packet->server_address().address(), | 233 queued_packet->server_address().address(), |
| 234 queued_packet->client_address()); | 234 queued_packet->client_address()); |
| 235 if (result.status == WRITE_STATUS_BLOCKED) { | 235 if (result.status == WRITE_STATUS_BLOCKED) { |
| 236 // If blocked and unbuffered, return false to retry sending. | 236 // If blocked and unbuffered, return false to retry sending. |
| 237 DCHECK(writer_->IsWriteBlocked()); | 237 DCHECK(writer_->IsWriteBlocked()); |
| 238 visitor_->OnWriteBlocked(this); | 238 visitor_->OnWriteBlocked(this); |
| 239 return writer_->IsWriteBlockedDataBuffered(); | 239 return writer_->IsWriteBlockedDataBuffered(); |
| 240 } else if (result.status == WRITE_STATUS_ERROR) { | 240 } else if (result.status == WRITE_STATUS_ERROR) { |
| 241 LOG(WARNING) << "Received unknown error while sending reset packet to " | 241 LOG(WARNING) << "Received unknown error while sending reset packet to " |
| 242 << queued_packet->client_address().ToString() << ": " | 242 << queued_packet->client_address().ToString() << ": " |
| 243 << strerror(result.error_code); | 243 << strerror(result.error_code); |
| 244 } | 244 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 274 break; | 274 break; |
| 275 } | 275 } |
| 276 // This connection_id has lived its age, retire it now. | 276 // This connection_id has lived its age, retire it now. |
| 277 delete it->second.close_packet; | 277 delete it->second.close_packet; |
| 278 connection_id_map_.erase(it); | 278 connection_id_map_.erase(it); |
| 279 } | 279 } |
| 280 SetConnectionIdCleanUpAlarm(); | 280 SetConnectionIdCleanUpAlarm(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace net | 283 } // namespace net |
| OLD | NEW |