mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-16 02:30:46 +00:00
MINOR: channel: Report EOI on the input channel if it was reached in the mux
The flag CF_EOI is now set on the input channel when the flag CS_FL_EOI is set on the corresponding conn_stream. In addition, if a read activity is reported when this flag is set, the stream is woken up. This patch should be backported to 1.9.
This commit is contained in:
parent
5311a9255d
commit
297d3e2e0f
@ -117,7 +117,7 @@
|
|||||||
|
|
||||||
#define CF_WAKE_ONCE 0x10000000 /* pretend there is activity on this channel (one-shoot) */
|
#define CF_WAKE_ONCE 0x10000000 /* pretend there is activity on this channel (one-shoot) */
|
||||||
#define CF_FLT_ANALYZE 0x20000000 /* at least one filter is still analyzing this channel */
|
#define CF_FLT_ANALYZE 0x20000000 /* at least one filter is still analyzing this channel */
|
||||||
/* unused: 0x40000000 */
|
#define CF_EOI 0x40000000 /* end-of-input has been reached */
|
||||||
#define CF_ISRESP 0x80000000 /* 0 = request channel, 1 = response channel */
|
#define CF_ISRESP 0x80000000 /* 0 = request channel, 1 = response channel */
|
||||||
|
|
||||||
/* Masks which define input events for stream analysers */
|
/* Masks which define input events for stream analysers */
|
||||||
|
@ -5382,6 +5382,7 @@ int http_msg_forward_body(struct stream *s, struct http_msg *msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
msg->msg_state = HTTP_MSG_ENDING;
|
msg->msg_state = HTTP_MSG_ENDING;
|
||||||
|
chn->flags |= CF_EOI;
|
||||||
|
|
||||||
ending:
|
ending:
|
||||||
/* we may have some pending data starting at res->buf.p such as a last
|
/* we may have some pending data starting at res->buf.p such as a last
|
||||||
@ -5517,6 +5518,8 @@ int http_msg_forward_chunked_body(struct stream *s, struct http_msg *msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
msg->msg_state = HTTP_MSG_ENDING;
|
msg->msg_state = HTTP_MSG_ENDING;
|
||||||
|
chn->flags |= CF_EOI;
|
||||||
|
|
||||||
ending:
|
ending:
|
||||||
/* we may have some pending data starting at res->buf.p such as a last
|
/* we may have some pending data starting at res->buf.p such as a last
|
||||||
* chunk of data or trailers. */
|
* chunk of data or trailers. */
|
||||||
|
@ -530,7 +530,7 @@ static void stream_int_notify(struct stream_interface *si)
|
|||||||
(si->state != SI_ST_EST && si->state != SI_ST_CON) ||
|
(si->state != SI_ST_EST && si->state != SI_ST_CON) ||
|
||||||
(si->flags & SI_FL_ERR) ||
|
(si->flags & SI_FL_ERR) ||
|
||||||
((ic->flags & CF_READ_PARTIAL) &&
|
((ic->flags & CF_READ_PARTIAL) &&
|
||||||
(!ic->to_forward || sio->state != SI_ST_EST)) ||
|
((ic->flags & CF_EOI) || !ic->to_forward || sio->state != SI_ST_EST)) ||
|
||||||
|
|
||||||
/* changes on the consumption side */
|
/* changes on the consumption side */
|
||||||
(oc->flags & (CF_WRITE_NULL|CF_WRITE_ERROR)) ||
|
(oc->flags & (CF_WRITE_NULL|CF_WRITE_ERROR)) ||
|
||||||
@ -604,6 +604,10 @@ static int si_cs_process(struct conn_stream *cs)
|
|||||||
si->flags |= SI_FL_READ_NULL;
|
si->flags |= SI_FL_READ_NULL;
|
||||||
ic->flags |= CF_READ_NULL;
|
ic->flags |= CF_READ_NULL;
|
||||||
}
|
}
|
||||||
|
/* Report EOI on the channel if it was reached from the mux point of
|
||||||
|
* view. */
|
||||||
|
if ((cs->flags & CS_FL_EOI) && !(ic->flags & CF_EOI))
|
||||||
|
ic->flags |= CF_EOI;
|
||||||
|
|
||||||
/* Second step : update the stream-int and channels, try to forward any
|
/* Second step : update the stream-int and channels, try to forward any
|
||||||
* pending data, then possibly wake the stream up based on the new
|
* pending data, then possibly wake the stream up based on the new
|
||||||
|
Loading…
Reference in New Issue
Block a user