mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-23 14:51:27 +02:00
BUG/MEDIUM: http: disable server-side expiration until client has sent the body
It's the final part of the 2 previous patches. We prevent the server from timing out if we still have some data to pass to it. That way, even if the server runs with a short timeout and the client with a large one, the server side timeout will only start to count once the client sends everything. This ensures we don't report a 504 before the server gets the whole request. It is not certain whether the 1.4 state machine is fully compatible with this change. Since the purpose is only to ensure that we never report a server error before a client error if some data are missing from the client and when the server-side timeout is smaller than or equal to the client's, it's probably not worth attempting the backport.
This commit is contained in:
parent
b9edf8fbec
commit
3bed5e9337
@ -5791,6 +5791,12 @@ int http_wait_for_response(struct session *s, struct channel *rep, int an_bit)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* we don't want to expire on the server side first until the client
|
||||
* has sent all the expected message body.
|
||||
*/
|
||||
if (txn->req.msg_state >= HTTP_MSG_BODY && txn->req.msg_state < HTTP_MSG_DONE)
|
||||
rep->flags |= CF_READ_NOEXP;
|
||||
|
||||
channel_dont_close(rep);
|
||||
rep->flags |= CF_READ_DONTWAIT; /* try to get back here ASAP */
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user