diff --git a/src/hlua.c b/src/hlua.c index a61809e49..45ed28df4 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -4420,6 +4420,12 @@ __LJMP static int hlua_applet_http_getline_yield(lua_State *L, int status, lua_K } } + /* The message was fully consumed and no more data are expected + * (EOM flag set). + */ + if (htx_is_empty(htx) && (htx->flags & HTX_FL_EOM)) + stop = 1; + htx_to_buf(htx, &req->buf); if (!stop) { si_cant_get(si); @@ -4506,6 +4512,12 @@ __LJMP static int hlua_applet_http_recv_yield(lua_State *L, int status, lua_KCon } } + /* The message was fully consumed and no more data are expected + * (EOM flag set). + */ + if (htx_is_empty(htx) && (htx->flags & HTX_FL_EOM)) + len = 0; + htx_to_buf(htx, &req->buf); /* If we are no other data available, yield waiting for new data. */