From: Willy Tarreau Date: Tue, 11 Dec 2018 17:01:38 +0000 (+0100) Subject: CLEANUP: stream: remove SF_TUNNEL, SF_INITIALIZED, SF_CONN_TAR X-Git-Tag: v1.9-dev11~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0007d0afbc937c13f94e4724cdd0015602db714b;p=thirdparty%2Fhaproxy.git CLEANUP: stream: remove SF_TUNNEL, SF_INITIALIZED, SF_CONN_TAR These flags haven't been used for a while. SF_TUNNEL was reintroduced by commit d62b98c6e ("MINOR: stream: don't set backend's nor response analysers on SF_TUNNEL") to handle the two-level streams needed to deal with the first model for H2, and was not removed after this model was abandonned. SF_INITIALIZED was only set. SF_CONN_TAR was never referenced at all. --- diff --git a/contrib/debug/flags.c b/contrib/debug/flags.c index f8a4d03ee8..6c57143b94 100644 --- a/contrib/debug/flags.c +++ b/contrib/debug/flags.c @@ -360,11 +360,8 @@ void show_strm_flags(unsigned int f) case SF_ERR_CHK_PORT: f &= ~SF_ERR_MASK ; printf("SF_ERR_CHK_PORT%s", f ? " | " : ""); break; } - SHOW_FLAG(f, SF_TUNNEL); SHOW_FLAG(f, SF_REDIRECTABLE); - SHOW_FLAG(f, SF_CONN_TAR); SHOW_FLAG(f, SF_REDISP); - SHOW_FLAG(f, SF_INITIALIZED); SHOW_FLAG(f, SF_CURR_SESS); SHOW_FLAG(f, SF_MONITOR); SHOW_FLAG(f, SF_FORCE_PRST); diff --git a/include/types/stream.h b/include/types/stream.h index 6dee432144..8cee760d9e 100644 --- a/include/types/stream.h +++ b/include/types/stream.h @@ -54,11 +54,11 @@ #define SF_FORCE_PRST 0x00000010 /* force persistence here, even if server is down */ #define SF_MONITOR 0x00000020 /* this stream comes from a monitoring system */ #define SF_CURR_SESS 0x00000040 /* a connection is currently being counted on the server */ -#define SF_INITIALIZED 0x00000080 /* the stream was fully initialized */ +/* unused: 0x00000080 */ #define SF_REDISP 0x00000100 /* set if this stream was redispatched from one server to another */ -#define SF_CONN_TAR 0x00000200 /* set if this stream is turning around before reconnecting */ +/* unused: 0x00000200 */ #define SF_REDIRECTABLE 0x00000400 /* set if this stream is redirectable (GET or HEAD) */ -#define SF_TUNNEL 0x00000800 /* tunnel-mode stream, nothing to catch after data */ +/* unused: 0x00000800 */ /* stream termination conditions, bits values 0x1000 to 0x7000 (0-9 shift 12) */ #define SF_ERR_NONE 0x00000000 /* normal end of request */ diff --git a/src/stream.c b/src/stream.c index 7add3dcc95..2e8d75562e 100644 --- a/src/stream.c +++ b/src/stream.c @@ -199,7 +199,6 @@ struct stream *stream_new(struct session *sess, enum obj_type *origin) s->buffer_wait.target = s; s->buffer_wait.wakeup_cb = stream_buf_available; - s->flags |= SF_INITIALIZED; s->pcli_next_pid = 0; s->pcli_flags = 0; s->unique_id = NULL; @@ -859,14 +858,12 @@ static void sess_establish(struct stream *s) rep->flags |= CF_READ_DONTWAIT; /* a single read is enough to get response headers */ } - if (!(s->flags & SF_TUNNEL)) { - rep->analysers |= strm_fe(s)->fe_rsp_ana | s->be->be_rsp_ana; + rep->analysers |= strm_fe(s)->fe_rsp_ana | s->be->be_rsp_ana; - /* Be sure to filter response headers if the backend is an HTTP proxy - * and if there are filters attached to the stream. */ - if (s->be->mode == PR_MODE_HTTP && HAS_FILTERS(s)) - rep->analysers |= AN_RES_FLT_HTTP_HDRS; - } + /* Be sure to filter response headers if the backend is an HTTP proxy + * and if there are filters attached to the stream. */ + if (s->be->mode == PR_MODE_HTTP && HAS_FILTERS(s)) + rep->analysers |= AN_RES_FLT_HTTP_HDRS; si_rx_endp_more(si); rep->flags |= CF_READ_ATTACHED; /* producer is now attached */