mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 17:17:06 +02:00
MINOR: stconn/channel: Move CF_EXPECT_MORE into the SC and rename it
The channel flag CF_EXPECT_MORE is renamed to SC_FL_SND_EXP_MORE and moved into the stream-connector.
This commit is contained in:
parent
68ef218a72
commit
84d3ef982c
@ -110,8 +110,7 @@
|
|||||||
#define CF_AUTO_CONNECT 0x00800000 /* consumer may attempt to establish a new connection */
|
#define CF_AUTO_CONNECT 0x00800000 /* consumer may attempt to establish a new connection */
|
||||||
|
|
||||||
#define CF_DONT_READ 0x01000000 /* disable reading for now */
|
#define CF_DONT_READ 0x01000000 /* disable reading for now */
|
||||||
#define CF_EXPECT_MORE 0x02000000 /* more data expected to be sent very soon (one-shoot) */
|
/* unused 0x02000000 - 0x08000000 */
|
||||||
/* unused 0x04000000 - 0x08000000 */
|
|
||||||
|
|
||||||
#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 */
|
||||||
@ -140,9 +139,9 @@ static forceinline char *chn_show_flags(char *buf, size_t len, const char *delim
|
|||||||
_(CF_WAKE_WRITE, _(CF_SHUTW, _(CF_SHUTW_NOW, _(CF_AUTO_CLOSE,
|
_(CF_WAKE_WRITE, _(CF_SHUTW, _(CF_SHUTW_NOW, _(CF_AUTO_CLOSE,
|
||||||
_(CF_STREAMER, _(CF_STREAMER_FAST, _(CF_WROTE_DATA,
|
_(CF_STREAMER, _(CF_STREAMER_FAST, _(CF_WROTE_DATA,
|
||||||
_(CF_KERN_SPLICING,
|
_(CF_KERN_SPLICING,
|
||||||
_(CF_AUTO_CONNECT, _(CF_DONT_READ, _(CF_EXPECT_MORE,
|
_(CF_AUTO_CONNECT, _(CF_DONT_READ,
|
||||||
_(CF_WAKE_ONCE, _(CF_FLT_ANALYZE,
|
_(CF_WAKE_ONCE, _(CF_FLT_ANALYZE,
|
||||||
_(CF_EOI, _(CF_ISRESP)))))))))))))))))))));
|
_(CF_EOI, _(CF_ISRESP))))))))))))))))))));
|
||||||
/* epilogue */
|
/* epilogue */
|
||||||
_(~0U);
|
_(~0U);
|
||||||
return buf;
|
return buf;
|
||||||
|
@ -129,6 +129,7 @@ enum sc_flags {
|
|||||||
SC_FL_RCV_ONCE = 0x00000400, /* Don't loop to receive data. cleared after a sucessful receive */
|
SC_FL_RCV_ONCE = 0x00000400, /* Don't loop to receive data. cleared after a sucessful receive */
|
||||||
SC_FL_SND_ASAP = 0x00000800, /* Don't wait for sending. cleared when all data were sent */
|
SC_FL_SND_ASAP = 0x00000800, /* Don't wait for sending. cleared when all data were sent */
|
||||||
SC_FL_SND_NEVERWAIT = 0x00001000, /* Never wait for sending (permanent) */
|
SC_FL_SND_NEVERWAIT = 0x00001000, /* Never wait for sending (permanent) */
|
||||||
|
SC_FL_SND_EXP_MORE = 0x00001000, /* More data expected to be sent very soon. cleared when all data were sent */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* This function is used to report flags in debugging tools. Please reflect
|
/* This function is used to report flags in debugging tools. Please reflect
|
||||||
@ -144,7 +145,7 @@ static forceinline char *sc_show_flags(char *buf, size_t len, const char *delim,
|
|||||||
_(SC_FL_ISBACK, _(SC_FL_NOLINGER, _(SC_FL_NOHALF,
|
_(SC_FL_ISBACK, _(SC_FL_NOLINGER, _(SC_FL_NOHALF,
|
||||||
_(SC_FL_DONT_WAKE, _(SC_FL_INDEP_STR, _(SC_FL_WONT_READ,
|
_(SC_FL_DONT_WAKE, _(SC_FL_INDEP_STR, _(SC_FL_WONT_READ,
|
||||||
_(SC_FL_NEED_BUFF, _(SC_FL_NEED_ROOM,
|
_(SC_FL_NEED_BUFF, _(SC_FL_NEED_ROOM,
|
||||||
_(SC_FL_RCV_ONCE, _(SC_FL_SND_ASAP, _(SC_FL_SND_NEVERWAIT)))))))))));
|
_(SC_FL_RCV_ONCE, _(SC_FL_SND_ASAP, _(SC_FL_SND_NEVERWAIT, _(SC_FL_SND_EXP_MORE))))))))))));
|
||||||
/* epilogue */
|
/* epilogue */
|
||||||
_(~0U);
|
_(~0U);
|
||||||
return buf;
|
return buf;
|
||||||
|
@ -958,7 +958,7 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit)
|
|||||||
msg->msg_state = HTTP_MSG_ENDING;
|
msg->msg_state = HTTP_MSG_ENDING;
|
||||||
|
|
||||||
ending:
|
ending:
|
||||||
req->flags &= ~CF_EXPECT_MORE; /* no more data are expected */
|
s->scb->flags &= ~SC_FL_SND_EXP_MORE; /* no more data are expected to be send */
|
||||||
|
|
||||||
/* other states, ENDING...TUNNEL */
|
/* other states, ENDING...TUNNEL */
|
||||||
if (msg->msg_state >= HTTP_MSG_DONE)
|
if (msg->msg_state >= HTTP_MSG_DONE)
|
||||||
@ -1040,7 +1040,7 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit)
|
|||||||
channel_dont_close(req);
|
channel_dont_close(req);
|
||||||
|
|
||||||
/* We know that more data are expected, but we couldn't send more that
|
/* We know that more data are expected, but we couldn't send more that
|
||||||
* what we did. So we always set the CF_EXPECT_MORE flag so that the
|
* what we did. So we always set the SC_FL_SND_EXP_MORE flag so that the
|
||||||
* system knows it must not set a PUSH on this first part. Interactive
|
* system knows it must not set a PUSH on this first part. Interactive
|
||||||
* modes are already handled by the stream sock layer. We must not do
|
* modes are already handled by the stream sock layer. We must not do
|
||||||
* this in content-length mode because it could present the MSG_MORE
|
* this in content-length mode because it could present the MSG_MORE
|
||||||
@ -1048,7 +1048,7 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit)
|
|||||||
* additional delay to be observed by the receiver.
|
* additional delay to be observed by the receiver.
|
||||||
*/
|
*/
|
||||||
if (HAS_REQ_DATA_FILTERS(s))
|
if (HAS_REQ_DATA_FILTERS(s))
|
||||||
req->flags |= CF_EXPECT_MORE;
|
s->scb->flags |= SC_FL_SND_EXP_MORE;
|
||||||
|
|
||||||
DBG_TRACE_DEVEL("waiting for more data to forward",
|
DBG_TRACE_DEVEL("waiting for more data to forward",
|
||||||
STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn);
|
STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn);
|
||||||
@ -1638,7 +1638,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
|
|||||||
txn->status = 0;
|
txn->status = 0;
|
||||||
s->logs.logwait = 0;
|
s->logs.logwait = 0;
|
||||||
s->logs.level = 0;
|
s->logs.level = 0;
|
||||||
s->res.flags &= ~CF_EXPECT_MORE; /* speed up sending a previous response */
|
s->scf->flags &= ~SC_FL_SND_EXP_MORE; /* speed up sending a previous response */
|
||||||
http_reply_and_close(s, txn->status, NULL);
|
http_reply_and_close(s, txn->status, NULL);
|
||||||
DBG_TRACE_DEVEL("leaving by closing K/A connection",
|
DBG_TRACE_DEVEL("leaving by closing K/A connection",
|
||||||
STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn);
|
STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA, s, txn);
|
||||||
@ -2072,7 +2072,7 @@ int http_response_forward_body(struct stream *s, struct channel *res, int an_bit
|
|||||||
msg->msg_state = HTTP_MSG_ENDING;
|
msg->msg_state = HTTP_MSG_ENDING;
|
||||||
|
|
||||||
ending:
|
ending:
|
||||||
res->flags &= ~CF_EXPECT_MORE; /* no more data are expected */
|
s->scf->flags &= ~SC_FL_SND_EXP_MORE; /* no more data are expected to be sent */
|
||||||
|
|
||||||
/* other states, ENDING...TUNNEL */
|
/* other states, ENDING...TUNNEL */
|
||||||
if (msg->msg_state >= HTTP_MSG_DONE)
|
if (msg->msg_state >= HTTP_MSG_DONE)
|
||||||
@ -2143,7 +2143,7 @@ int http_response_forward_body(struct stream *s, struct channel *res, int an_bit
|
|||||||
channel_dont_close(res);
|
channel_dont_close(res);
|
||||||
|
|
||||||
/* We know that more data are expected, but we couldn't send more that
|
/* We know that more data are expected, but we couldn't send more that
|
||||||
* what we did. So we always set the CF_EXPECT_MORE flag so that the
|
* what we did. So we always set the SC_FL_SND_EXP_MORE flag so that the
|
||||||
* system knows it must not set a PUSH on this first part. Interactive
|
* system knows it must not set a PUSH on this first part. Interactive
|
||||||
* modes are already handled by the stream sock layer. We must not do
|
* modes are already handled by the stream sock layer. We must not do
|
||||||
* this in content-length mode because it could present the MSG_MORE
|
* this in content-length mode because it could present the MSG_MORE
|
||||||
@ -2151,7 +2151,7 @@ int http_response_forward_body(struct stream *s, struct channel *res, int an_bit
|
|||||||
* additional delay to be observed by the receiver.
|
* additional delay to be observed by the receiver.
|
||||||
*/
|
*/
|
||||||
if (HAS_RSP_DATA_FILTERS(s))
|
if (HAS_RSP_DATA_FILTERS(s))
|
||||||
res->flags |= CF_EXPECT_MORE;
|
s->scf->flags |= SC_FL_SND_EXP_MORE;
|
||||||
|
|
||||||
/* the stream handler will take care of timeouts and errors */
|
/* the stream handler will take care of timeouts and errors */
|
||||||
DBG_TRACE_DEVEL("waiting for more data to forward",
|
DBG_TRACE_DEVEL("waiting for more data to forward",
|
||||||
|
@ -1066,7 +1066,7 @@ static void sc_notify(struct stconn *sc)
|
|||||||
*/
|
*/
|
||||||
if (!channel_is_empty(ic) &&
|
if (!channel_is_empty(ic) &&
|
||||||
sc_ep_test(sco, SE_FL_WAIT_DATA) &&
|
sc_ep_test(sco, SE_FL_WAIT_DATA) &&
|
||||||
(!(ic->flags & CF_EXPECT_MORE) || c_full(ic) || ci_data(ic) == 0 || ic->pipe)) {
|
(!(sc->flags & SC_FL_SND_EXP_MORE) || c_full(ic) || ci_data(ic) == 0 || ic->pipe)) {
|
||||||
int new_len, last_len;
|
int new_len, last_len;
|
||||||
|
|
||||||
last_len = co_data(ic);
|
last_len = co_data(ic);
|
||||||
@ -1593,7 +1593,7 @@ static int sc_conn_send(struct stconn *sc)
|
|||||||
|
|
||||||
if ((!(sc->flags & (SC_FL_SND_ASAP|SC_FL_SND_NEVERWAIT)) &&
|
if ((!(sc->flags & (SC_FL_SND_ASAP|SC_FL_SND_NEVERWAIT)) &&
|
||||||
((oc->to_forward && oc->to_forward != CHN_INFINITE_FORWARD) ||
|
((oc->to_forward && oc->to_forward != CHN_INFINITE_FORWARD) ||
|
||||||
(oc->flags & CF_EXPECT_MORE) ||
|
(sc->flags & SC_FL_SND_EXP_MORE) ||
|
||||||
(IS_HTX_STRM(s) &&
|
(IS_HTX_STRM(s) &&
|
||||||
(!(oc->flags & (CF_EOI|CF_SHUTR)) && htx_expect_more(htxbuf(&oc->buf)))))) ||
|
(!(oc->flags & (CF_EOI|CF_SHUTR)) && htx_expect_more(htxbuf(&oc->buf)))))) ||
|
||||||
((oc->flags & CF_ISRESP) &&
|
((oc->flags & CF_ISRESP) &&
|
||||||
@ -1637,8 +1637,7 @@ static int sc_conn_send(struct stconn *sc)
|
|||||||
|
|
||||||
if (!co_data(oc)) {
|
if (!co_data(oc)) {
|
||||||
/* Always clear both flags once everything has been sent, they're one-shot */
|
/* Always clear both flags once everything has been sent, they're one-shot */
|
||||||
oc->flags &= ~CF_EXPECT_MORE;
|
sc->flags &= ~(SC_FL_SND_ASAP|SC_FL_SND_EXP_MORE);
|
||||||
sc->flags &= ~SC_FL_SND_ASAP;
|
|
||||||
}
|
}
|
||||||
/* if some data remain in the buffer, it's only because the
|
/* if some data remain in the buffer, it's only because the
|
||||||
* system buffers are full, we will try next time.
|
* system buffers are full, we will try next time.
|
||||||
|
Loading…
Reference in New Issue
Block a user