mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
MEDIUM: mux-spop: Announce the pipeling support if possible
Reintroduce the pipelining support. Everyting was alredy in place to be able to multiplex the streams on a SPOP connection. Here, the pipelining support is annonced and checked in the agent replies. A hard-coded limit to 20 streams is set if the pipelining is supported on both sides. Otherwise, it is disabled and only one stream at a time is allowed. The related issue is #2502.
This commit is contained in:
parent
880c037bcf
commit
1755c32949
@ -56,11 +56,6 @@
|
||||
|
||||
#define SPOE_CTX_FL_PROCESS (SPOE_CTX_FL_REQ_PROCESS|SPOE_CTX_FL_RSP_PROCESS)
|
||||
|
||||
/* Flags set on the SPOE applet */
|
||||
#define SPOE_APPCTX_FL_PIPELINING 0x00000001 /* Set if pipelining is supported */
|
||||
/* unused 0x00000002 */
|
||||
/* unused 0x00000004 */
|
||||
|
||||
/* All possible states for a SPOE context */
|
||||
enum spoe_ctx_state {
|
||||
SPOE_CTX_ST_NONE = 0,
|
||||
|
@ -705,6 +705,8 @@ static int spop_init(struct connection *conn, struct proxy *px, struct session *
|
||||
if (sdo) {
|
||||
spop_conn->agent = spoe_appctx_agent(sc_appctx(sdo->sc));
|
||||
spop_conn->max_frame_size = spop_conn->agent->max_frame_size;
|
||||
if (spop_conn->agent->flags & SPOE_FL_PIPELINING)
|
||||
spop_conn->streams_limit = 20;
|
||||
BUG_ON(!spop_conn->agent);
|
||||
}
|
||||
|
||||
@ -1685,11 +1687,11 @@ static int spop_conn_handle_hello(struct spop_conn *spop_conn)
|
||||
/* Skip leading spaces */
|
||||
for (; isspace((unsigned char)*str) && sz; str++, sz--);
|
||||
|
||||
/* if (sz >= 10 && !strncmp(str, "pipelining", 10)) { */
|
||||
/* str += 10; sz -= 10; */
|
||||
/* if (!sz || isspace((unsigned char)*str) || *str == ',') */
|
||||
/* flags |= SPOE_APPCTX_FL_PIPELINING; */
|
||||
/* } */
|
||||
if (sz >= 10 && !strncmp(str, "pipelining", 10)) {
|
||||
str += 10; sz -= 10;
|
||||
if (!sz || isspace((unsigned char)*str) || *str == ',')
|
||||
flags |= SPOE_FL_PIPELINING;
|
||||
}
|
||||
|
||||
/* Get the next comma or break */
|
||||
if (!sz || (delim = memchr(str, ',', sz)) == NULL)
|
||||
@ -1717,14 +1719,9 @@ static int spop_conn_handle_hello(struct spop_conn *spop_conn)
|
||||
spop_conn_error(spop_conn, SPOP_ERR_NO_FRAME_SIZE);
|
||||
goto fail;
|
||||
}
|
||||
/* if (!agent) */
|
||||
/* flags &= ~SPOE_APPCTX_FL_PIPELINING; */
|
||||
/* else { */
|
||||
/* if ((flags & SPOE_APPCTX_FL_PIPELINING) && !(agent->flags & SPOE_FL_PIPELINING)) */
|
||||
/* flags &= ~SPOE_APPCTX_FL_PIPELINING; */
|
||||
/* } */
|
||||
|
||||
/* SPOE_APPCTX(appctx)->flags |= flags; */
|
||||
if (!(flags & SPOE_FL_PIPELINING))
|
||||
spop_conn->streams_limit = 1;
|
||||
spop_conn->max_frame_size = (unsigned int)max_frame_size;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user