From 3172eac8df930a6d41cd133c147b063f2ecfd70a Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 21 Jul 2024 13:43:21 +1000 Subject: [PATCH] PINE: Disable nagle buffering --- src/core/pine_server.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/pine_server.cpp b/src/core/pine_server.cpp index 67f8926fe..4ebde72cc 100644 --- a/src/core/pine_server.cpp +++ b/src/core/pine_server.cpp @@ -204,12 +204,16 @@ PINEServer::PINESocket::~PINESocket() = default; void PINEServer::PINESocket::OnConnected() { - INFO_LOG("PINE: New client at {} connected.", GetRemoteAddress().ToString()); + INFO_LOG("New client at {} connected.", GetRemoteAddress().ToString()); + + Error error; + if (GetLocalAddress().IsIPAddress() && !SetNagleBuffering(false, &error)) + ERROR_LOG("Failed to disable nagle buffering: {}", error.GetDescription()); } void PINEServer::PINESocket::OnDisconnected(const Error& error) { - INFO_LOG("PINE: Client {} disconnected: {}", GetRemoteAddress().ToString(), error.GetDescription()); + INFO_LOG("Client {} disconnected: {}", GetRemoteAddress().ToString(), error.GetDescription()); } void PINEServer::PINESocket::OnRead()