Honor proxy server timeout with one second buffer
This commit is contained in:
src
@ -399,8 +399,9 @@ int proxy_init(proxy_ctx_t **proxy_ptr, http_req *req, http_res *res, http_statu
|
||||
if (!retry)
|
||||
return -1;
|
||||
|
||||
// honor server timeout with one second buffer
|
||||
if (!proxy->initialized || sock_has_pending(&proxy->proxy, SOCK_DONTWAIT) != 0 || srv_error ||
|
||||
(proxy->http_timeout != 0 && (clock_micros() - proxy->proxy.ts_last) >= proxy->http_timeout))
|
||||
(proxy->http_timeout != 0 && (clock_micros() - proxy->proxy.ts_last_send) >= proxy->http_timeout - 1000000))
|
||||
{
|
||||
if (proxy->initialized)
|
||||
proxy_close(proxy);
|
||||
|
Reference in New Issue
Block a user