restbed icon indicating copy to clipboard operation
restbed copied to clipboard

Set_keep_alive(true) - Server terminates connection when body is larger than ~50k bytes

Open MINIONBOTS opened this issue 5 years ago • 0 comments

Hello Ben,

since I updated the lib I had a lot of users who's connection was terminated ( 12030 ERROR_WINHTTP_CONNECTION_ERROR ) when a response was sent to them with a body larger than ~50k bytes. But sending an even smaller amount like 5k bytes worked fine.

It was just a simple get request from the user clients and the server response as simple as this: std::string response = "50k of random chars ;)" session->close(OK, response ); It all started since this commit: https://github.com/Corvusoft/restbed/commit/80ff914bfbb282428a63715f994f42b916f4389c#

The server also throws a lot of aiso Fetch/Catch Error: 121, “The semaphore timeout period has expired when set_keep_alive is 1.

All this does not happen, when I set_keep_alive to false!

Weirdly not all users were experiencing that issue and I cannot reproduce that on my local network either. The one user I finally was able to debug it with, was from Taiwan and the server was in Europe. Server runs on a Windows system.

Any idea why that happens ? Is the keep alive interval too short or something ? is it not updated during the transfer ? maybe related to this Issue: https://github.com/Corvusoft/restbed/issues/410 ?

Thanks a lot for your awesome work <3

MINIONBOTS avatar Apr 22 '20 11:04 MINIONBOTS