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

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

Issue 337093003: QuicServer: Use Chrome's header parsing rather than Balsa (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@quic_server_3
Patch Set: Lowercase SPDY header Created 6 years, 6 months 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698