diff options
Diffstat (limited to 'chromium/net/third_party/quiche/src/quic/qbone/bonnet/tun_device_packet_exchanger.cc')
-rw-r--r-- | chromium/net/third_party/quiche/src/quic/qbone/bonnet/tun_device_packet_exchanger.cc | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/chromium/net/third_party/quiche/src/quic/qbone/bonnet/tun_device_packet_exchanger.cc b/chromium/net/third_party/quiche/src/quic/qbone/bonnet/tun_device_packet_exchanger.cc index 37fd2c0163b..4e7c93b1fe7 100644 --- a/chromium/net/third_party/quiche/src/quic/qbone/bonnet/tun_device_packet_exchanger.cc +++ b/chromium/net/third_party/quiche/src/quic/qbone/bonnet/tun_device_packet_exchanger.cc @@ -6,7 +6,7 @@ #include <utility> -#include "net/third_party/quiche/src/quic/platform/api/quic_str_cat.h" +#include "net/third_party/quiche/src/common/platform/api/quiche_str_cat.h" namespace quic { @@ -26,10 +26,11 @@ TunDevicePacketExchanger::TunDevicePacketExchanger( bool TunDevicePacketExchanger::WritePacket(const char* packet, size_t size, bool* blocked, - string* error) { + std::string* error) { *blocked = false; if (fd_ < 0) { - *error = QuicStrCat("Invalid file descriptor of the TUN device: ", fd_); + *error = quiche::QuicheStrCat("Invalid file descriptor of the TUN device: ", + fd_); stats_->OnWriteError(error); return false; } @@ -40,22 +41,25 @@ bool TunDevicePacketExchanger::WritePacket(const char* packet, // The tunnel is blocked. Note that this does not mean the receive buffer // of a TCP connection is filled. This simply means the TUN device itself // is blocked on handing packets to the rest part of the kernel. - *error = QuicStrCat("Write to the TUN device was blocked: ", errno); + *error = + quiche::QuicheStrCat("Write to the TUN device was blocked: ", errno); *blocked = true; stats_->OnWriteError(error); } return false; } - stats_->OnPacketWritten(); + stats_->OnPacketWritten(result); return true; } -std::unique_ptr<QuicData> TunDevicePacketExchanger::ReadPacket(bool* blocked, - string* error) { +std::unique_ptr<QuicData> TunDevicePacketExchanger::ReadPacket( + bool* blocked, + std::string* error) { *blocked = false; if (fd_ < 0) { - *error = QuicStrCat("Invalid file descriptor of the TUN device: ", fd_); + *error = quiche::QuicheStrCat("Invalid file descriptor of the TUN device: ", + fd_); stats_->OnReadError(error); return nullptr; } @@ -67,13 +71,14 @@ std::unique_ptr<QuicData> TunDevicePacketExchanger::ReadPacket(bool* blocked, // is no end of file. Therefore 0 also indicates error. if (result <= 0) { if (errno == EAGAIN || errno == EWOULDBLOCK) { - *error = QuicStrCat("Read from the TUN device was blocked: ", errno); + *error = + quiche::QuicheStrCat("Read from the TUN device was blocked: ", errno); *blocked = true; stats_->OnReadError(error); } return nullptr; } - stats_->OnPacketRead(); + stats_->OnPacketRead(result); return std::make_unique<QuicData>(read_buffer.release(), result, true); } |