Oops, fix websockets.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4721 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2024-01-01 22:22:03 +00:00
parent 197fca6d3b
commit e4cd5312f1

View File

@ -308,9 +308,12 @@ static void _http_add_body_bytes(tf_http_connection_t* connection, const void* d
connection->fragment_length = 0; connection->fragment_length = 0;
} }
connection->websocket_message_index++; connection->websocket_message_index++;
if (connection->body_length > total_length) if (connection->body_length >= total_length)
{ {
memmove(connection->body, (char*)connection->body + total_length, connection->body_length - total_length); if (connection->body_length > total_length)
{
memmove(connection->body, (char*)connection->body + total_length, connection->body_length - total_length);
}
connection->body_length -= total_length; connection->body_length -= total_length;
} }
} }