mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 07:07:04 +02:00
MINOR: http-client: Try to send request body with headers if possible
There is no reason to yield after sending the request headers, except if the request was fully sent. If there is a payload, it is better to send it as well. However, when the whole request was sent, we can leave the I/O handler.
This commit is contained in:
parent
96aa251d20
commit
c08a0dae30
@ -564,13 +564,12 @@ void httpclient_applet_io_handler(struct appctx *appctx)
|
|||||||
if (htx->flags & HTX_FL_EOM) { /* check if a body need to be added */
|
if (htx->flags & HTX_FL_EOM) { /* check if a body need to be added */
|
||||||
appctx->st0 = HTTPCLIENT_S_RES_STLINE;
|
appctx->st0 = HTTPCLIENT_S_RES_STLINE;
|
||||||
se_fl_set(appctx->sedesc, SE_FL_EOI);
|
se_fl_set(appctx->sedesc, SE_FL_EOI);
|
||||||
break;
|
goto out; /* we need to leave the IO handler once we wrote the request */
|
||||||
}
|
}
|
||||||
|
|
||||||
applet_have_more_data(appctx);
|
applet_have_more_data(appctx);
|
||||||
appctx->st0 = HTTPCLIENT_S_REQ_BODY;
|
appctx->st0 = HTTPCLIENT_S_REQ_BODY;
|
||||||
goto out; /* we need to leave the IO handler once we wrote the request */
|
__fallthrough;
|
||||||
break;
|
|
||||||
|
|
||||||
case HTTPCLIENT_S_REQ_BODY:
|
case HTTPCLIENT_S_REQ_BODY:
|
||||||
/* call the payload callback */
|
/* call the payload callback */
|
||||||
@ -637,11 +636,11 @@ void httpclient_applet_io_handler(struct appctx *appctx)
|
|||||||
if (htx->flags & HTX_FL_EOM) {
|
if (htx->flags & HTX_FL_EOM) {
|
||||||
appctx->st0 = HTTPCLIENT_S_RES_STLINE;
|
appctx->st0 = HTTPCLIENT_S_RES_STLINE;
|
||||||
se_fl_set(appctx->sedesc, SE_FL_EOI);
|
se_fl_set(appctx->sedesc, SE_FL_EOI);
|
||||||
break;
|
goto out; /* we need to leave the IO handler once we wrote the request */
|
||||||
}
|
}
|
||||||
|
|
||||||
applet_have_more_data(appctx);
|
applet_have_more_data(appctx);
|
||||||
goto process_data; /* we need to leave the IO handler once we wrote the request */
|
goto process_data;
|
||||||
|
|
||||||
case HTTPCLIENT_S_RES_STLINE:
|
case HTTPCLIENT_S_RES_STLINE:
|
||||||
/* in HTX mode, don't try to copy the stline
|
/* in HTX mode, don't try to copy the stline
|
||||||
|
Loading…
Reference in New Issue
Block a user