poco
poco copied to clipboard
secure socket receiveTimeout throwing after configured timeout * 2
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
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
This issue is stale because it has been open for 365 days with no activity.
This issue was closed because it has been inactive for 60 days since being marked as stale.
@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?