poco icon indicating copy to clipboard operation
poco copied to clipboard

secure socket receiveTimeout throwing after configured timeout * 2

Open SpitchAG opened this issue 2 years ago • 3 comments

when creating a secure http server, default receiveTimeout for incoming socket is set to 60s. But the timeout is detected after 60*2s.

To reproduce just create a server secure socket, set the timeout to X seconds, call receiveBytes() and observe that the timeout exception is received after X*2s.

Timeout exception shall be received after Xs.

Please add relevant environment information: ubuntu20 poco-1.11.1-release

Additional context looking at code you see that SSL_read blocks during Xs, then there is a mustRetry calls that call socket->poll(Xs, READ) which will aslo block Xs, then exc is thrown

SpitchAG avatar Aug 01 '22 09:08 SpitchAG

I know that this issue was observed on Ubuntu 2020, but I would like to note that I've also seen a timeout problem with SSL connections on Windows, see #3806

jngrb avatar Sep 20 '22 17:09 jngrb

This issue is stale because it has been open for 365 days with no activity.

github-actions[bot] avatar Sep 21 '23 02:09 github-actions[bot]

This issue was closed because it has been inactive for 60 days since being marked as stale.

github-actions[bot] avatar Nov 20 '23 02:11 github-actions[bot]

@aleks-f , as far as I can see from the code, the timeout is used in receiveBytes/sendBytes and then again on failure in mustRetry as an argument to poll.

One of the naïve possibilities to resolve this is to set the timeout internally to half of the requested value in connect. Would that be sufficient?

matejk avatar Mar 25 '24 19:03 matejk