Index: net/tools/quic/quic_packet_reader.cc |
diff --git a/net/tools/quic/quic_packet_reader.cc b/net/tools/quic/quic_packet_reader.cc |
index a4ba1be4c544113ad9483a6bae20990466f1f485..3f5f8c8c64c72ff5c49c33007bfee46884b8bd92 100644 |
--- a/net/tools/quic/quic_packet_reader.cc |
+++ b/net/tools/quic/quic_packet_reader.cc |
@@ -60,14 +60,24 @@ void QuicPacketReader::Initialize() { |
QuicPacketReader::~QuicPacketReader() {} |
-// TODO(danzh): write a public method to wrap ReadAndDispatchPackets() and |
-// ReadAndDispatchSinglePacket() based on MMSG_MORE. |
bool QuicPacketReader::ReadAndDispatchPackets( |
int fd, |
int port, |
ProcessPacketInterface* processor, |
QuicPacketCount* packets_dropped) { |
#if MMSG_MORE |
+ return ReadAndDispatchManyPackets(fd, port, processor, packets_dropped); |
+#else |
+ return ReadAndDispatchSinglePacket(fd, port, processor, packets_dropped); |
+#endif |
+} |
+ |
+bool QuicPacketReader::ReadAndDispatchManyPackets( |
+ int fd, |
+ int port, |
+ ProcessPacketInterface* processor, |
+ QuicPacketCount* packets_dropped) { |
+#if MMSG_MORE |
// Re-set the length fields in case recvmmsg has changed them. |
for (int i = 0; i < kNumPacketsPerReadMmsgCall; ++i) { |
DCHECK_EQ(kMaxPacketSize, packets_[i].iov.iov_len); |