Closed AlexanderKotliar closed 7 years ago
At the next request, after the server disconnects, the client will reconnect the connection. See https://github.com/eidheim/Simple-Web-Server/blob/master/client_http.hpp#L489.
I have to add that the client reconnect feature was added a month or so ago. Do you have this issue with latest master?
I was wrong with my suggestion, indeed, the socket is reopened. The problem is with https client: if the full setup (create_connection()) is not invoked just socket reopened, then handshake fails with error code 2.
The way to reproduce: connect to https server (I load curl's ca-bundle.crt). Wait about 60 seconds and connect again.
Thank you, I managed to reproduce this on Linux. I could not create a decent fix for the master branch, due to the static functions that are used there, but this issue should be fixed on the v3 branch. I'll probably merge this branch in a week or so though, but feel free to try it out.
If there is a sighnificant amount of time between successive requests to one host (~ 60 seconds and more), free connection in pool is timed out on server side, but client use it for next request. It needs to drop such connection after config.time_to_live.