haproxy/include/proto
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 [CLEANUP] tcp: move some non tcp-specific layer6 processing out of proto_tcp 2010-06-14 10:53:09 +02:00
auth.h [REORG] http: move the http-request rules to proto_http 2011-03-13 22:00:24 +01:00
backend.h [MINOR]: stats: add show-legends to report additional informations 2010-01-06 00:28:06 +01:00
buffers.h [BUG] http: fix content-length handling on 32-bit platforms 2011-03-28 16:25:16 +02:00
checks.h [MEDIUM] add a maintenance mode to servers 2010-01-31 23:33:18 +01:00
cttproxy.h
dumpstats.h [REORG] session: move the data_ctx struct to the stream interface's applet 2011-03-10 23:32:16 +01:00
fd.h [MEDIUM] Fix memory freeing at exit 2008-05-30 07:07:19 +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
frontend.h [MINOR] frontend: add a make_proxy_line function 2011-03-20 10:15:22 +01:00
hdr_idx.h
httperr.h
lb_chash.h [MEDIUM] backend: implement consistent hashing variation 2009-10-09 07:17:58 +02:00
lb_fwlc.h [CLEANUP] backend: move LB algos to individual files 2009-10-01 11:19:37 +02:00
lb_fwrr.h [CLEANUP] backend: move LB algos to individual files 2009-10-01 11:19:37 +02:00
lb_map.h [MINOR] lb_map: reorder code in order to ease integration of new hash functions 2009-10-01 21:11:15 +02:00
log.h [BUILD] add format(printf) to printf-like functions 2009-04-03 12:01:47 +02:00
pattern.h [MEDIUM] Create new protected pattern types CONSTSTRING and CONSTDATA to force memcpy if data from protected areas need to be manipulated. 2010-11-11 09:29:07 +01:00
peers.h [MAJOR] Add new files src/peer.c, include/proto/peers.h and include/types/peers.h for sync stick table management 2010-11-11 09:29:08 +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 [MEDIUM] add internal support for IPv6 server addresses 2011-03-13 22:00:12 +01:00
proto_uxst.h [MEDIUM] separate protocol-level accept() from the frontend's 2010-06-14 10:53:11 +02:00
protocols.h [MEDIUM] Enhance message errors management on binds 2010-11-05 10:34:07 +01:00
proxy.h [MEDIUM] stats: split frontend and backend stats 2011-03-13 22:00:23 +01:00
queue.h [BUG] do not dequeue the backend's pending connections on a dead server 2008-12-07 23:51:12 +01:00
server.h [OPTIM] counters: move some max numbers to the counters struct 2009-10-04 23:26:19 +02:00
session.h [MEDIUM] session-counters: correctly unbind the counters tracked by the backend 2010-08-10 18:04:16 +02:00
signal.h [MEDIUM] signals: support redistribution of signal zero when stopping 2010-08-27 18:26:11 +02:00
stick_table.h [MEDIUM] Create updates tree on stick table to manage sync. 2010-11-11 09:29:08 +01:00
stream_interface.h [MAJOR] session: remove the ->srv pointer from struct session 2011-03-10 23:32:17 +01:00
stream_sock.h [MEDIUM] backend: initialize the server stream_interface upon connect() 2010-06-14 10:53:15 +02:00
task.h [MEDIUM] signals: add support for registering functions and tasks 2010-08-27 18:00:40 +02:00
template.h