]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: http: correctly report request body timeouts
authorWilly Tarreau <w@1wt.eu>
Wed, 7 May 2014 12:24:16 +0000 (14:24 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 May 2014 13:22:27 +0000 (15:22 +0200)
commitb9edf8fbecc9d1b5c82794735adcc367a80a4ae2
tree4793a6399b50b8c78323cb01a3f539f4f05ebf6a
parentb1982e27aaff2a92a389a9f1bc847e3bb8fdb4f2
BUG/MEDIUM: http: correctly report request body timeouts

This is the continuation of previous patch "BUG/MEDIUM: http/session:
disable client-side expiration only after body".

This one takes care of properly reporting the client-side read timeout
when waiting for a body from the client. Since the timeout may happen
before or after the server starts to respond, we have to take care of
the situation in three different ways :
  - if the server does not read our data fast enough, we emit a 504
    if we're waiting for headers, or we simply break the connection
    if headers were already received. We report either sH or sD
    depending on whether we've seen headers or not.

  - if the server has not yet started to respond, but has read all of
    the client's data and we're still waiting for more data from the
    client, we can safely emit a 408 and abort the request ;

  - if the server has already started to respond (thus it's a transfer
    timeout during a bidirectional exchange), then we silently break
    the connection, and only the session flags will indicate in the
    logs that something went wrong with client or server side.

This bug is tagged MEDIUM because it touches very sensible areas, however
its impact is very low. It might be worth performing a careful backport
to 1.4 once it has been confirmed that everything is correct and that it
does not introduce any regression.
src/proto_http.c