summaryrefslogtreecommitdiff
path: root/chromium/net/tools/quic/quic_simple_server.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/net/tools/quic/quic_simple_server.cc
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-c30a6232df03e1efbd9f3b226777b07e087a1122.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/net/tools/quic/quic_simple_server.cc')
-rw-r--r--chromium/net/tools/quic/quic_simple_server.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/chromium/net/tools/quic/quic_simple_server.cc b/chromium/net/tools/quic/quic_simple_server.cc
index 9c397b57c98..01c3e63a084 100644
--- a/chromium/net/tools/quic/quic_simple_server.cc
+++ b/chromium/net/tools/quic/quic_simple_server.cc
@@ -125,6 +125,7 @@ bool QuicSimpleServer::Listen(const IPEndPoint& address) {
}
void QuicSimpleServer::Shutdown() {
+ LOG(WARNING) << "QuicSimpleServer is shutting down";
// Before we shut down the epoll server, give all active sessions a chance to
// notify clients that they're closing.
dispatcher_->Shutdown();
@@ -177,20 +178,24 @@ void QuicSimpleServer::StartReading() {
void QuicSimpleServer::OnReadComplete(int result) {
read_pending_ = false;
- if (result == 0)
- result = ERR_CONNECTION_CLOSED;
- if (result < 0) {
+ if (result > 0) {
+ quic::QuicReceivedPacket packet(read_buffer_->data(), result,
+ helper_->GetClock()->Now(), false);
+ dispatcher_->ProcessPacket(ToQuicSocketAddress(server_address_),
+ ToQuicSocketAddress(client_address_), packet);
+ } else {
LOG(ERROR) << "QuicSimpleServer read failed: " << ErrorToString(result);
- Shutdown();
- return;
+ // Do not act on ERR_MSG_TOO_BIG as that indicates that we received a UDP
+ // packet whose payload is larger than our receive buffer. Do not act on 0
+ // as that indicates that we received a UDP packet with an empty payload.
+ // In both cases, the socket should still be usable.
+ if (result != ERR_MSG_TOO_BIG && result != 0) {
+ Shutdown();
+ return;
+ }
}
- quic::QuicReceivedPacket packet(read_buffer_->data(), result,
- helper_->GetClock()->Now(), false);
- dispatcher_->ProcessPacket(ToQuicSocketAddress(server_address_),
- ToQuicSocketAddress(client_address_), packet);
-
StartReading();
}