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

Side by Side Diff: net/tools/quic/test_tools/limited_mtu_test_writer.cc

Issue 1240953002: Allow QuicClient to set connection MTU before the handshake is sent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Cleanup_changes_97160447
Patch Set: Created 5 years, 5 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/test_tools/limited_mtu_test_writer.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
(Empty)
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/tools/quic/test_tools/limited_mtu_test_writer.h"
6
7 namespace net {
8 namespace tools {
9 namespace test {
10
11 LimitedMtuTestWriter::LimitedMtuTestWriter(QuicByteCount mtu) : mtu_(mtu) {}
12
13 LimitedMtuTestWriter::~LimitedMtuTestWriter() {}
14
15 WriteResult LimitedMtuTestWriter::WritePacket(
16 const char* buffer,
17 size_t buf_len,
18 const IPAddressNumber& self_address,
19 const IPEndPoint& peer_address) {
20 if (buf_len > mtu_) {
21 // Drop the packet.
22 return WriteResult(WRITE_STATUS_OK, buf_len);
23 }
24
25 return QuicPacketWriterWrapper::WritePacket(buffer, buf_len, self_address,
26 peer_address);
27 }
28
29 } // namespace test
30 } // namespace tools
31 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/test_tools/limited_mtu_test_writer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698