mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-05 04:56:10 +02:00
MEDIUM: proto_htx: Reintroduce the infinite forwarding on data
This commit was reverted because of bugs. Now it should be ok. Difference with
the commit f52170d2f ("MEDIUM: proto_htx: Switch to infinite forwarding if there
is no data filte") is that when the infinite forwarding is enabled, the message
is switched to the state HTTP_MSG_DONE if the flag CF_EOI is set.
This commit is contained in:
parent
87a8f353f1
commit
66af0b2b99
@ -1212,9 +1212,18 @@ int htx_request_forward_body(struct stream *s, struct channel *req, int an_bit)
|
||||
channel_auto_close(req);
|
||||
|
||||
if (req->to_forward) {
|
||||
/* We can't process the buffer's contents yet */
|
||||
req->flags |= CF_WAKE_WRITE;
|
||||
goto missing_data_or_waiting;
|
||||
if (req->to_forward == CHN_INFINITE_FORWARD) {
|
||||
if (req->flags & (CF_SHUTR|CF_EOI)) {
|
||||
msg->msg_state = HTTP_MSG_DONE;
|
||||
req->to_forward = 0;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* We can't process the buffer's contents yet */
|
||||
req->flags |= CF_WAKE_WRITE;
|
||||
goto missing_data_or_waiting;
|
||||
}
|
||||
}
|
||||
|
||||
if (msg->msg_state >= HTTP_MSG_DONE)
|
||||
@ -1233,14 +1242,8 @@ int htx_request_forward_body(struct stream *s, struct channel *req, int an_bit)
|
||||
}
|
||||
else {
|
||||
c_adv(req, htx->data - co_data(req));
|
||||
|
||||
/* To let the function channel_forward work as expected we must update
|
||||
* the channel's buffer to pretend there is no more input data. The
|
||||
* right length is then restored. We must do that, because when an HTX
|
||||
* message is stored into a buffer, it appears as full.
|
||||
*/
|
||||
if ((msg->flags & HTTP_MSGF_XFER_LEN) && htx->extra)
|
||||
htx->extra -= channel_htx_forward(req, htx, htx->extra);
|
||||
if (msg->flags & HTTP_MSGF_XFER_LEN)
|
||||
channel_htx_forward_forever(req, htx);
|
||||
}
|
||||
|
||||
/* Check if the end-of-message is reached and if so, switch the message
|
||||
@ -2130,9 +2133,18 @@ int htx_response_forward_body(struct stream *s, struct channel *res, int an_bit)
|
||||
channel_auto_close(res);
|
||||
|
||||
if (res->to_forward) {
|
||||
/* We can't process the buffer's contents yet */
|
||||
res->flags |= CF_WAKE_WRITE;
|
||||
goto missing_data_or_waiting;
|
||||
if (res->to_forward == CHN_INFINITE_FORWARD) {
|
||||
if (res->flags & (CF_SHUTR|CF_EOI)) {
|
||||
msg->msg_state = HTTP_MSG_DONE;
|
||||
res->to_forward = 0;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* We can't process the buffer's contents yet */
|
||||
res->flags |= CF_WAKE_WRITE;
|
||||
goto missing_data_or_waiting;
|
||||
}
|
||||
}
|
||||
|
||||
if (msg->msg_state >= HTTP_MSG_DONE)
|
||||
@ -2152,14 +2164,8 @@ int htx_response_forward_body(struct stream *s, struct channel *res, int an_bit)
|
||||
}
|
||||
else {
|
||||
c_adv(res, htx->data - co_data(res));
|
||||
|
||||
/* To let the function channel_forward work as expected we must update
|
||||
* the channel's buffer to pretend there is no more input data. The
|
||||
* right length is then restored. We must do that, because when an HTX
|
||||
* message is stored into a buffer, it appears as full.
|
||||
*/
|
||||
if ((msg->flags & HTTP_MSGF_XFER_LEN) && htx->extra)
|
||||
htx->extra -= channel_htx_forward(res, htx, htx->extra);
|
||||
if (msg->flags & HTTP_MSGF_XFER_LEN)
|
||||
channel_htx_forward_forever(res, htx);
|
||||
}
|
||||
|
||||
if (!(msg->flags & HTTP_MSGF_XFER_LEN)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user