Fix async races in gbmcweb's http_client
In Boost.Asio, calling timer.cancel() only cancels timers that are still waiting in the timer queue. If an operation completes at the exact instant the 30-second timer fires, the reactor has already posted the timeout handler (onTimeout) to the io_context event queue with a success/expired error code. Without generation tracking, onTimeout would invoke waitAndRetry() for an operation that already succeeded, closing the connection, triggering duplicate retries, or corrupting subsequent requests on that connection.
Also fixes issues with SSL shutdown and non-keepalive handling in ConnectionPool::sendNext
Google-Bug-Id:545239300
PiperOrigin-RevId: 964234422
Change-Id: Ifc4df31c32b3156173e1e28c80b607a9cc17fd5d
1 file changed