mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 07:07:04 +02:00
BUG/MINOR: hlua: Skip headers when a receive is performed on an HTTP applet
When an HTTP applet tries to retrieve data, the request headers are still in the buffer. But, instead of being silently removed, their size is removed from the amount of data retrieved. When the request payload is fully retrieved, it is not an issue. But it is a problem when a length is specified. The data are shorten from the headers size. So now, we take care to silently remove headers. This patch must be backported to all stable versions.
This commit is contained in:
parent
8258c8166a
commit
5b5ecf848d
@ -5987,6 +5987,8 @@ __LJMP static int hlua_applet_http_recv_yield(lua_State *L, int status, lua_KCon
|
||||
case HTX_BLK_DATA:
|
||||
v = htx_get_blk_value(htx, blk);
|
||||
luaL_addlstring(&luactx->b, v.ptr, vlen);
|
||||
if (len > 0)
|
||||
len -= vlen;
|
||||
break;
|
||||
|
||||
case HTX_BLK_TLR:
|
||||
@ -6000,8 +6002,6 @@ __LJMP static int hlua_applet_http_recv_yield(lua_State *L, int status, lua_KCon
|
||||
|
||||
c_rew(req, vlen);
|
||||
count -= vlen;
|
||||
if (len > 0)
|
||||
len -= vlen;
|
||||
if (sz == vlen)
|
||||
blk = htx_remove_blk(htx, blk);
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user