if (hc->ops.res_stline)
hc->ops.res_stline(hc);
- htx_to_buf(htx, &res->buf);
-
/* if there is no HTX data anymore and the EOM flag is
* set, leave (no body) */
if (htx_is_empty(htx) && htx->flags & HTX_FL_EOM)
else
appctx->st0 = HTTPCLIENT_S_RES_HDR;
+ htx_to_buf(htx, &res->buf);
break;
case HTTPCLIENT_S_RES_HDR:
}
blk = htx_remove_blk(htx, blk);
}
- htx_to_buf(htx, &res->buf);
if (hdr_num) {
/* alloc and copy the headers in the httpclient struct */
appctx->st0 = HTTPCLIENT_S_RES_BODY;
}
}
+ htx_to_buf(htx, &res->buf);
break;
case HTTPCLIENT_S_RES_BODY:
}
}
- htx_to_buf(htx, &res->buf);
-
/* if not finished, should be called again */
- if (!(htx_is_empty(htx) && (htx->flags & HTX_FL_EOM)))
- goto out;
+ if ((htx_is_empty(htx) && (htx->flags & HTX_FL_EOM)))
+ appctx->st0 = HTTPCLIENT_S_RES_END;
+ htx_to_buf(htx, &res->buf);
- /* end of message, we should quit */
- appctx->st0 = HTTPCLIENT_S_RES_END;
break;
case HTTPCLIENT_S_RES_END: