MINOR: stream-int: Remove SI_FL_SRC_ADDR to rely on stream flags instead

Flag to get the source ip/port with getsockname is now handled at the stream
level. Thus SI_FL_SRC_ADDR stream-int flag is replaced by SF_SRC_ADDR stream
flag.
This commit is contained in:
Christopher Faulet 2022-03-30 16:26:39 +02:00
parent a728518c15
commit d139138bbc
5 changed files with 4 additions and 4 deletions

View File

@ -269,7 +269,6 @@ void show_si_flags(unsigned int f)
SHOW_FLAG(f, SI_FL_WAIT_DATA);
SHOW_FLAG(f, SI_FL_ISBACK);
SHOW_FLAG(f, SI_FL_SRC_ADDR);
SHOW_FLAG(f, SI_FL_WANT_GET);
SHOW_FLAG(f, SI_FL_CLEAN_ABRT);
SHOW_FLAG(f, SI_FL_RXBLK_CHAN);
@ -380,6 +379,7 @@ void show_strm_flags(unsigned int f)
return;
}
SHOW_FLAG(f, SF_SRC_ADDR);
SHOW_FLAG(f, SF_WEBSOCKET);
SHOW_FLAG(f, SF_SRV_REUSED_ANTICIPATED);
SHOW_FLAG(f, SF_SRV_REUSED);

View File

@ -82,6 +82,7 @@
#define SF_SRV_REUSED 0x00100000 /* the server-side connection was reused */
#define SF_SRV_REUSED_ANTICIPATED 0x00200000 /* the connection was reused but the mux is not ready yet */
#define SF_WEBSOCKET 0x00400000 /* websocket stream */ // TODO: must be removed
#define SF_SRC_ADDR 0x00800000 /* get the source ip/port with getsockname */
/* flags for the proxy of the master CLI */
/* 0x0001.. to 0x8000 are reserved for ACCESS_* flags from cli-t.h */

View File

@ -86,7 +86,6 @@ enum {
/* unused: 0x00000001, 0x00000002 */
SI_FL_WAIT_DATA = 0x00000008, /* stream-int waits for more outgoing data to send */
SI_FL_ISBACK = 0x00000010, /* 0 for front-side SI, 1 for back-side */
SI_FL_SRC_ADDR = 0x00001000, /* get the source ip/port with getsockname */
/* unused: 0x00000200 */
SI_FL_WANT_GET = 0x00004000, /* a stream-int would like to get some data from the buffer */
SI_FL_CLEAN_ABRT = 0x00008000, /* SI_FL_ERR is used to report aborts, and not SHUTR */

View File

@ -387,7 +387,7 @@ static inline int si_connect(struct stream_interface *si, struct connection *con
}
/* needs src ip/port for logging */
if (si->flags & SI_FL_SRC_ADDR)
if (si_strm(si)->flags & SF_SRC_ADDR)
conn_get_src(conn);
return ret;

View File

@ -1637,7 +1637,7 @@ skip_reuse:
/* flag for logging source ip/port */
if (strm_fe(s)->options2 & PR_O2_SRC_ADDR)
cs_si(s->csb)->flags |= SI_FL_SRC_ADDR;
s->flags |= SF_SRC_ADDR;
/* disable lingering */
if (s->be->options & PR_O_TCP_NOLING)