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_client.h" | 5 #include "net/tools/quic/quic_client.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <netinet/in.h> | 8 #include <netinet/in.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <sys/epoll.h> | 10 #include <sys/epoll.h> |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 DCHECK_EQ(fd, fd_); | 236 DCHECK_EQ(fd, fd_); |
237 | 237 |
238 if (event->in_events & EPOLLIN) { | 238 if (event->in_events & EPOLLIN) { |
239 while (connected() && ReadAndProcessPacket()) { | 239 while (connected() && ReadAndProcessPacket()) { |
240 } | 240 } |
241 } | 241 } |
242 if (connected() && (event->in_events & EPOLLOUT)) { | 242 if (connected() && (event->in_events & EPOLLOUT)) { |
243 session_->connection()->OnCanWrite(); | 243 session_->connection()->OnCanWrite(); |
244 } | 244 } |
245 if (event->in_events & EPOLLERR) { | 245 if (event->in_events & EPOLLERR) { |
246 DLOG(INFO) << "Epollerr"; | 246 DVLOG(0) << "Epollerr"; |
247 } | 247 } |
248 } | 248 } |
249 | 249 |
250 void QuicClient::OnClose(ReliableQuicStream* stream) { | 250 void QuicClient::OnClose(ReliableQuicStream* stream) { |
251 if (!print_response_) { | 251 if (!print_response_) { |
252 return; | 252 return; |
253 } | 253 } |
254 | 254 |
255 QuicReliableClientStream* client_stream = | 255 QuicReliableClientStream* client_stream = |
256 static_cast<QuicReliableClientStream*>(stream); | 256 static_cast<QuicReliableClientStream*>(stream); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 303 |
304 if (bytes_read < 0) { | 304 if (bytes_read < 0) { |
305 return false; | 305 return false; |
306 } | 306 } |
307 | 307 |
308 QuicEncryptedPacket packet(buf, bytes_read, false); | 308 QuicEncryptedPacket packet(buf, bytes_read, false); |
309 QuicGuid our_guid = session_->connection()->guid(); | 309 QuicGuid our_guid = session_->connection()->guid(); |
310 QuicGuid packet_guid; | 310 QuicGuid packet_guid; |
311 | 311 |
312 if (!QuicFramer::ReadGuidFromPacket(packet, &packet_guid)) { | 312 if (!QuicFramer::ReadGuidFromPacket(packet, &packet_guid)) { |
313 DLOG(INFO) << "Could not read GUID from packet"; | 313 DVLOG(0) << "Could not read GUID from packet"; |
314 return true; | 314 return true; |
315 } | 315 } |
316 if (packet_guid != our_guid) { | 316 if (packet_guid != our_guid) { |
317 DLOG(INFO) << "Ignoring packet from unexpected GUID: " | 317 DVLOG(0) << "Ignoring packet from unexpected GUID: " |
318 << packet_guid << " instead of " << our_guid; | 318 << packet_guid << " instead of " << our_guid; |
319 return true; | 319 return true; |
320 } | 320 } |
321 | 321 |
322 IPEndPoint client_address(client_ip, client_address_.port()); | 322 IPEndPoint client_address(client_ip, client_address_.port()); |
323 session_->connection()->ProcessUdpPacket( | 323 session_->connection()->ProcessUdpPacket( |
324 client_address, server_address, packet); | 324 client_address, server_address, packet); |
325 return true; | 325 return true; |
326 } | 326 } |
327 | 327 |
328 } // namespace tools | 328 } // namespace tools |
329 } // namespace net | 329 } // namespace net |
OLD | NEW |