From 28cd13c3e1dd5dd851671056a0fe4ffaeb3b67d4 Mon Sep 17 00:00:00 2001 From: kkanag314 Date: Mon, 23 Sep 2024 16:38:10 +0000 Subject: [PATCH] when app sends large message to their backend, network inspect agent sends the message to RWI which results in the busy loop blocking webkit main thread.Because it takes a while to read and transmit the message. --- Source/WTF/wtf/glib/SocketConnection.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/WTF/wtf/glib/SocketConnection.cpp b/Source/WTF/wtf/glib/SocketConnection.cpp index 1e12d5b53ad0a..c92db0c48e53a 100644 --- a/Source/WTF/wtf/glib/SocketConnection.cpp +++ b/Source/WTF/wtf/glib/SocketConnection.cpp @@ -124,8 +124,10 @@ bool SocketConnection::readMessage() memcpy(&flags, messageData, sizeof(MessageFlags)); messageData += sizeof(MessageFlags); auto messageSize = sizeof(uint32_t) + sizeof(MessageFlags) + bodySize; - if (m_readBuffer.size() < messageSize) + if (m_readBuffer.size() < messageSize) { + m_readBuffer.reserveCapacity(messageSize); return false; + } Checked messageNameLength = strlen(messageData); messageNameLength++;