| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_packet_reader.h" | 5 #include "net/tools/quic/quic_packet_reader.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #ifndef __APPLE__ | 8 #ifndef __APPLE__ |
| 9 // This is a GNU header that is not present in /usr/include on MacOS | 9 // This is a GNU header that is not present in /usr/include on MacOS |
| 10 #include <features.h> | 10 #include <features.h> |
| 11 #endif | 11 #endif |
| 12 #include <string.h> | 12 #include <string.h> |
| 13 | 13 |
| 14 #include "base/logging.h" | |
| 15 #include "net/quic/core/quic_bug_tracker.h" | 14 #include "net/quic/core/quic_bug_tracker.h" |
| 16 #include "net/quic/core/quic_flags.h" | 15 #include "net/quic/core/quic_flags.h" |
| 16 #include "net/quic/platform/api/quic_logging.h" |
| 17 #include "net/quic/platform/api/quic_socket_address.h" | 17 #include "net/quic/platform/api/quic_socket_address.h" |
| 18 #include "net/tools/quic/platform/impl/quic_socket_utils.h" | 18 #include "net/tools/quic/platform/impl/quic_socket_utils.h" |
| 19 #include "net/tools/quic/quic_dispatcher.h" | 19 #include "net/tools/quic/quic_dispatcher.h" |
| 20 #include "net/tools/quic/quic_process_packet_interface.h" | 20 #include "net/tools/quic/quic_process_packet_interface.h" |
| 21 | 21 |
| 22 #ifndef SO_RXQ_OVFL | 22 #ifndef SO_RXQ_OVFL |
| 23 #define SO_RXQ_OVFL 40 | 23 #define SO_RXQ_OVFL 40 |
| 24 #endif | 24 #endif |
| 25 | 25 |
| 26 namespace net { | 26 namespace net { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 } | 138 } |
| 139 | 139 |
| 140 if (packets_dropped != nullptr) { | 140 if (packets_dropped != nullptr) { |
| 141 QuicSocketUtils::GetOverflowFromMsghdr(&mmsg_hdr_[0].msg_hdr, | 141 QuicSocketUtils::GetOverflowFromMsghdr(&mmsg_hdr_[0].msg_hdr, |
| 142 packets_dropped); | 142 packets_dropped); |
| 143 } | 143 } |
| 144 | 144 |
| 145 // We may not have read all of the packets available on the socket. | 145 // We may not have read all of the packets available on the socket. |
| 146 return packets_read == kNumPacketsPerReadMmsgCall; | 146 return packets_read == kNumPacketsPerReadMmsgCall; |
| 147 #else | 147 #else |
| 148 LOG(FATAL) << "Unsupported"; | 148 QUIC_LOG(FATAL) << "Unsupported"; |
| 149 return false; | 149 return false; |
| 150 #endif | 150 #endif |
| 151 } | 151 } |
| 152 | 152 |
| 153 /* static */ | 153 /* static */ |
| 154 bool QuicPacketReader::ReadAndDispatchSinglePacket( | 154 bool QuicPacketReader::ReadAndDispatchSinglePacket( |
| 155 int fd, | 155 int fd, |
| 156 int port, | 156 int port, |
| 157 const QuicClock& clock, | 157 const QuicClock& clock, |
| 158 ProcessPacketInterface* processor, | 158 ProcessPacketInterface* processor, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 184 QuicSocketAddress server_address(server_ip, port); | 184 QuicSocketAddress server_address(server_ip, port); |
| 185 processor->ProcessPacket(server_address, client_address, packet); | 185 processor->ProcessPacket(server_address, client_address, packet); |
| 186 | 186 |
| 187 // The socket read was successful, so return true even if packet dispatch | 187 // The socket read was successful, so return true even if packet dispatch |
| 188 // failed. | 188 // failed. |
| 189 return true; | 189 return true; |
| 190 } | 190 } |
| 191 | 191 |
| 192 | 192 |
| 193 } // namespace net | 193 } // namespace net |
| OLD | NEW |