mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 20:46:11 +02:00
MINOR: Add TO/FROM_SET flags to struct stream_interface
[WT: it will make sense to remove SN_FRT_ADDR_SET and to use these flags everywhere instead ]
This commit is contained in:
parent
64559c565f
commit
0bc0c2426c
@ -73,6 +73,8 @@ enum {
|
||||
SI_FL_INDEP_STR = 0x0040, /* independant streams = don't update rex on write */
|
||||
SI_FL_NOLINGER = 0x0080, /* may close without lingering. One-shot. */
|
||||
SI_FL_SRC_ADDR = 0x1000, /* get the source ip/port with getsockname */
|
||||
SI_FL_TO_SET = 0x2000, /* addr.to is set */
|
||||
SI_FL_FROM_SET = 0x4000, /* addr.from is set */
|
||||
};
|
||||
|
||||
/* target types */
|
||||
|
||||
@ -54,6 +54,7 @@ void get_frt_addr(struct session *s)
|
||||
|
||||
if (get_original_dst(s->si[0].fd, (struct sockaddr_in *)&s->si[0].addr.to, &namelen) == -1)
|
||||
getsockname(s->si[0].fd, (struct sockaddr *)&s->si[0].addr.to, &namelen);
|
||||
s->si[0].flags |= SI_FL_TO_SET;
|
||||
s->flags |= SN_FRT_ADDR_SET;
|
||||
}
|
||||
|
||||
|
||||
@ -443,6 +443,7 @@ int tcp_connect_server(struct stream_interface *si)
|
||||
if (getsockname(fd, (struct sockaddr *)&si->addr.from, &addrlen) == -1) {
|
||||
Warning("Cannot get source address for logging.\n");
|
||||
}
|
||||
si->flags |= SI_FL_FROM_SET;
|
||||
}
|
||||
|
||||
fdtab[fd].owner = si;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user