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

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

Issue 1543703002: Drop packets which are larger than kMaxPacketSize, instead of closing the connection with QUIC_PACK… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@110286048
Patch Set: Created 4 years, 12 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/quic/quic_protocol.h ('k') | net/tools/quic/quic_packet_reader.cc » ('j') | 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 // A class to read incoming QUIC packets from the UDP socket. 5 // A class to read incoming QUIC packets from the UDP socket.
6 6
7 #ifndef NET_TOOLS_QUIC_QUIC_PACKET_READER_H_ 7 #ifndef NET_TOOLS_QUIC_QUIC_PACKET_READER_H_
8 #define NET_TOOLS_QUIC_QUIC_PACKET_READER_H_ 8 #define NET_TOOLS_QUIC_QUIC_PACKET_READER_H_
9 9
10 #include <netinet/in.h> 10 #include <netinet/in.h>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 private: 55 private:
56 // Initialize the internal state of the reader. 56 // Initialize the internal state of the reader.
57 void Initialize(); 57 void Initialize();
58 58
59 // Storage only used when recvmmsg is available. 59 // Storage only used when recvmmsg is available.
60 60
61 // cbuf_ is used for ancillary data from the kernel on recvmmsg. 61 // cbuf_ is used for ancillary data from the kernel on recvmmsg.
62 char cbuf_[kSpaceForOverflowAndIp * kNumPacketsPerReadMmsgCall]; 62 char cbuf_[kSpaceForOverflowAndIp * kNumPacketsPerReadMmsgCall];
63 // buf_ is used for the data read from the kernel on recvmmsg. 63 // buf_ is used for the data read from the kernel on recvmmsg.
64 char buf_[2 * kMaxPacketSize * kNumPacketsPerReadMmsgCall]; 64 // TODO(danzh): change it to be a pointer to avoid the allocation on the stack
65 // from exceeding maximum allowed frame size.
66 char buf_[kMaxPacketSize * kNumPacketsPerReadMmsgCall];
65 // iov_ and mmsg_hdr_ are used to supply cbuf and buf to the recvmmsg call. 67 // iov_ and mmsg_hdr_ are used to supply cbuf and buf to the recvmmsg call.
66 iovec iov_[kNumPacketsPerReadMmsgCall]; 68 iovec iov_[kNumPacketsPerReadMmsgCall];
67 mmsghdr mmsg_hdr_[kNumPacketsPerReadMmsgCall]; 69 mmsghdr mmsg_hdr_[kNumPacketsPerReadMmsgCall];
68 // raw_address_ is used for address information provided by the recvmmsg 70 // raw_address_ is used for address information provided by the recvmmsg
69 // call on the packets. 71 // call on the packets.
70 struct sockaddr_storage raw_address_[kNumPacketsPerReadMmsgCall]; 72 struct sockaddr_storage raw_address_[kNumPacketsPerReadMmsgCall];
71 73
72 DISALLOW_COPY_AND_ASSIGN(QuicPacketReader); 74 DISALLOW_COPY_AND_ASSIGN(QuicPacketReader);
73 }; 75 };
74 76
75 } // namespace tools 77 } // namespace tools
76 } // namespace net 78 } // namespace net
77 79
78 #endif // NET_TOOLS_QUIC_QUIC_PACKET_READER_H_ 80 #endif // NET_TOOLS_QUIC_QUIC_PACKET_READER_H_
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/tools/quic/quic_packet_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698