mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-11 09:37:20 +02:00
BUG/MINOR: lua: set buffer if it is nnot avalaible.
Check if the buffer is avalaible because HAProxy doesn't allocate the request buffer if its not required. Sometimes, the Lua need to write some data to the server before that the client send his data.
This commit is contained in:
parent
bd1f1325e1
commit
3e3a608f19
10
src/hlua.c
10
src/hlua.c
@ -2195,6 +2195,16 @@ __LJMP static int _hlua_channel_send(lua_State *L)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check if the buffer is avalaible because HAProxy doesn't allocate
|
||||||
|
* the request buffer if its not required.
|
||||||
|
*/
|
||||||
|
if (chn->chn->buf->size == 0) {
|
||||||
|
if (!session_alloc_recv_buffer(chn->s, &chn->chn->buf)) {
|
||||||
|
chn->chn->prod->flags |= SI_FL_WAIT_ROOM;
|
||||||
|
WILL_LJMP(hlua_yieldk(L, 0, 0, _hlua_channel_send, TICK_ETERNITY, 0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
max = channel_recv_limit(chn->chn) - buffer_len(chn->chn->buf);
|
max = channel_recv_limit(chn->chn) - buffer_len(chn->chn->buf);
|
||||||
if (max > len - l)
|
if (max > len - l)
|
||||||
max = len - l;
|
max = len - l;
|
||||||
|
Loading…
Reference in New Issue
Block a user