It was using the global request_timeout_msecs for the maximum timeout,
which could be different from the per-request timeout set by
http_client_request_set_attempt_timeout_msecs().
if (retry_after < ioloop_time)
return 0; /* delay already expired */
max = (req->client->set.max_auto_retry_delay == 0 ?
- req->client->set.request_timeout_msecs / 1000 :
+ req->attempt_timeout_msecs / 1000 :
req->client->set.max_auto_retry_delay);
if ((unsigned int)(retry_after - ioloop_time) > max)
return -1; /* delay too long */