Switch global error menu icon to vectorized MD asset
[chromium-blink-merge.git] / net / tools / quic / test_tools / limited_mtu_test_writer.cc
blob1e9fa7daa7985ce41a7106ce3b5a7f50e040e1ef
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.
5 #include "net/tools/quic/test_tools/limited_mtu_test_writer.h"
7 namespace net {
8 namespace tools {
9 namespace test {
11 LimitedMtuTestWriter::LimitedMtuTestWriter(QuicByteCount mtu) : mtu_(mtu) {}
13 LimitedMtuTestWriter::~LimitedMtuTestWriter() {}
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);
25 return QuicPacketWriterWrapper::WritePacket(buffer, buf_len, self_address,
26 peer_address);
29 } // namespace test
30 } // namespace tools
31 } // namespace net