haproxy/include/types
Willy Tarreau d8ee85a0a3 [BUG] http: fix content-length handling on 32-bit platforms
Despite much care around handling the content-length as a 64-bit integer,
forwarding was broken on 32-bit platforms due to the 32-bit nature of
the ->to_forward member of the "buffer" struct. The issue is that this
member is declared as a long, so while it works OK on 64-bit platforms,
32-bit truncate the content-length to the lower 32-bits.

One solution could consist in turning to_forward to a long long, but it
is used a lot in the critical path, so it's not acceptable to perform
all buffer size computations on 64-bit there.

The fix consists in changing the to_forward member to a strict 32-bit
integer and ensure in buffer_forward() that only the amount of bytes
that can fit into it is considered. Callers of buffer_forward() are
responsible for checking that their data were taken into account. We
arbitrarily ensure we never consider more than 2G at once.

That's the way it was intended to work on 32-bit platforms except that
it did not.

This issue was tracked down hard at Exosec with Bertrand Jacquin,
Thierry Fournier and Julien Thomas. It remained undetected for a long
time because files larger than 4G are almost always transferred in
chunked-encoded format, and most platforms dealing with huge contents
these days run on 64-bit.

The bug affects all 1.5 and 1.4 versions, and must be backported.
2011-03-28 16:25:16 +02:00
..
acl.h [MINOR] acl: add ability to check for internal response-only parameters 2011-02-23 15:32:20 +01:00
auth.h [REORG] http: move the http-request rules to proto_http 2011-03-13 22:00:24 +01:00
backend.h [MEDIUM] hash: add support for an 'avalanche' hash-type 2010-11-29 07:28:16 +01:00
buffers.h [BUG] http: fix content-length handling on 32-bit platforms 2011-03-28 16:25:16 +02:00
capture.h [MAJOR] last bunch of capture changes for mempool v2 2007-05-13 22:46:04 +02:00
checks.h [MEDIUM] Decrease server health based on http responses / events, version 3 2009-12-16 00:29:27 +01:00
counters.h [MEDIUM] stats: split frontend and backend stats 2011-03-13 22:00:23 +01:00
fd.h [MEDIUM] fd: merge fd_list into fdtab 2009-10-18 08:20:26 +02:00
freq_ctr.h [MINOR] freq_ctr: add new types and functions for periods different from 1s 2010-08-10 14:01:09 +02:00
global.h [MINOR] log: ability to override the syslog tag 2010-12-30 11:43:36 +01:00
hdr_idx.h [BUG] files were missing for hdr_idx in previous commit 2006-12-04 02:20:02 +01:00
httperr.h [MAJOR] udpated the stats page to clearly distinguish FEs and BEs 2007-01-01 21:38:07 +01:00
lb_chash.h [MEDIUM] build: switch ebtree users to use new ebtree version 2009-10-26 21:10:04 +01:00
lb_fwlc.h [MEDIUM] build: switch ebtree users to use new ebtree version 2009-10-26 21:10:04 +01:00
lb_fwrr.h [MEDIUM] build: switch ebtree users to use new ebtree version 2009-10-26 21:10:04 +01:00
lb_map.h [CLEANUP] proxy: move last lb-specific bits to their respective files 2009-10-03 18:41:18 +02:00
log.h [BUILD] fix build on AIX due to recent log changes 2007-12-05 11:11:55 +01:00
pattern.h [BUILD] pattern: use 'int' instead of 'int32_t' 2010-11-14 14:24:27 +01:00
peers.h [MEDIUM] add internal support for IPv6 server addresses 2011-03-13 22:00:12 +01:00
pipe.h [MEDIUM] introduce pipe pools 2009-01-25 13:49:53 +01:00
port_range.h [MEDIUM] add support for binding to source port ranges during connect 2009-06-10 12:23:32 +02:00
proto_http.h [REORG] http: move the http-request rules to proto_http 2011-03-13 22:00:24 +01:00
proto_tcp.h [MINOR] session-counters: use "track-sc{1,2}" instead of "track-{fe,be}-counters" 2010-08-10 18:04:15 +02:00
protocols.h [MEDIUM] Enhance message errors management on binds 2010-11-05 10:34:07 +01:00
proxy.h [REORG] http: move the http-request rules to proto_http 2011-03-13 22:00:24 +01:00
queue.h [MAJOR] ported pendconn to mempools v2 2007-05-13 20:19:55 +02:00
server.h [MEDIUM] server: add support for the "send-proxy" option 2011-03-20 11:53:50 +01:00
session.h [MAJOR] session: remove the ->srv pointer from struct session 2011-03-10 23:32:17 +01:00
signal.h [MEDIUM] signals: add support for registering functions and tasks 2010-08-27 18:00:40 +02:00
stick_table.h [MEDIUM] Manage peers section parsing and stick table registration on peers. 2010-11-11 09:29:08 +01:00
stream_interface.h [MEDIUM] stream_sock: add support for sending the proxy protocol header line 2011-03-20 10:16:46 +01:00
task.h [MEDIUM] signals: add support for registering functions and tasks 2010-08-27 18:00:40 +02:00
template.h [CLEANUP] included common/version.h everywhere 2006-06-29 18:54:54 +02:00