MINOR: lua: properly process the contents of the content-length field
authorWilly Tarreau <w@1wt.eu>
Wed, 23 Aug 2017 07:32:06 +0000 (09:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 23 Aug 2017 14:11:38 +0000 (16:11 +0200)
commitc9f4ea0f61665a840fcce6d64edbf64a3b7ab3e1
tree3bfcd616b6604c8b2ff2871fd2d0c74007e91528
parent06c75fec1783f1641b11f627be06f7df26e9d282
MINOR: lua: properly process the contents of the content-length field

The header's value was parsed with atoi() then compared against -1,
meaning that all the unparsable stuff returning zero was not considered
and that all multiples of 2^32 + 0xFFFFFFFF would continue to emit a
chunk.

Now instead we parse the value using a long long, only accept positive
values and consider all unparsable values as incorrect and switch to
either close or chunked encoding. This is more in line with what a
client (including haproxy's parser) would expect.

This may be backported as a cleanup to stable versions, though it's
really unlikely that Lua applications are facing side effects of this.
src/hlua.c