diff --git a/src/http_client.c b/src/http_client.c index 29db28f02..c2dec8bbe 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -700,9 +700,14 @@ static void httpclient_applet_io_handler(struct appctx *appctx) uint32_t sz; int ret; - if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR|SE_FL_SHR|SE_FL_SHW)))) + if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR|SE_FL_SHR|SE_FL_SHW)))) { + if (co_data(res)) { + htx = htx_from_buf(&res->buf); + co_htx_skip(res, htx, co_data(res)); + htx_to_buf(htx, &res->buf); + } goto out; - + } /* The IO handler could be called after the release, so we need to * check if hc is still there to run the IO handler */ if (!hc)