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

Side by Side Diff: net/tools/quic/quic_packet_reader.cc

Issue 1633373002: relnote: moves ProcessPacketInterface from quic_dispatcher.h to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « net/tools/quic/quic_packet_reader.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 hdr->msg_iov = &iov_[i]; 50 hdr->msg_iov = &iov_[i];
51 hdr->msg_iovlen = 1; 51 hdr->msg_iovlen = 1;
52 52
53 hdr->msg_control = cbuf_ + kSpaceForOverflowAndIp * i; 53 hdr->msg_control = cbuf_ + kSpaceForOverflowAndIp * i;
54 hdr->msg_controllen = kSpaceForOverflowAndIp; 54 hdr->msg_controllen = kSpaceForOverflowAndIp;
55 } 55 }
56 } 56 }
57 57
58 QuicPacketReader::~QuicPacketReader() {} 58 QuicPacketReader::~QuicPacketReader() {}
59 59
60 // TODO(danzh): write a public method to wrap ReadAndDispatchPackets() and
61 // ReadAndDispatchSinglePacket() based on MMSG_MORE.
60 bool QuicPacketReader::ReadAndDispatchPackets( 62 bool QuicPacketReader::ReadAndDispatchPackets(
61 int fd, 63 int fd,
62 int port, 64 int port,
63 ProcessPacketInterface* processor, 65 ProcessPacketInterface* processor,
64 QuicPacketCount* packets_dropped) { 66 QuicPacketCount* packets_dropped) {
65 #if MMSG_MORE 67 #if MMSG_MORE
66 // Re-set the length fields in case recvmmsg has changed them. 68 // Re-set the length fields in case recvmmsg has changed them.
67 for (int i = 0; i < kNumPacketsPerReadMmsgCall; ++i) { 69 for (int i = 0; i < kNumPacketsPerReadMmsgCall; ++i) {
68 iov_[i].iov_len = kMaxPacketSize; 70 iov_[i].iov_len = kMaxPacketSize;
69 mmsg_hdr_[i].msg_len = 0; 71 mmsg_hdr_[i].msg_len = 0;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 processor->ProcessPacket(server_address, client_address, packet); 136 processor->ProcessPacket(server_address, client_address, packet);
135 137
136 // The socket read was successful, so return true even if packet dispatch 138 // The socket read was successful, so return true even if packet dispatch
137 // failed. 139 // failed.
138 return true; 140 return true;
139 } 141 }
140 142
141 } // namespace tools 143 } // namespace tools
142 144
143 } // namespace net 145 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_packet_reader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698