mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-30 08:32:05 +00:00
MINOR: sock: add interface and namespace length to xfer_sock_list
This will ease and speed up comparisons in FD lookups.
This commit is contained in:
parent
063d47d136
commit
a6473ede5c
@ -33,6 +33,8 @@ struct xfer_sock_list {
|
|||||||
int options; /* socket options as LI_O_* */
|
int options; /* socket options as LI_O_* */
|
||||||
char *iface;
|
char *iface;
|
||||||
char *namespace;
|
char *namespace;
|
||||||
|
int if_namelen;
|
||||||
|
int ns_namelen;
|
||||||
struct xfer_sock_list *prev;
|
struct xfer_sock_list *prev;
|
||||||
struct xfer_sock_list *next;
|
struct xfer_sock_list *next;
|
||||||
struct sockaddr_storage addr;
|
struct sockaddr_storage addr;
|
||||||
|
@ -1275,6 +1275,7 @@ static int get_old_sockets(const char *unixsocket)
|
|||||||
}
|
}
|
||||||
memcpy(xfer_sock->namespace, &tmpbuf[curoff], len);
|
memcpy(xfer_sock->namespace, &tmpbuf[curoff], len);
|
||||||
xfer_sock->namespace[len] = 0;
|
xfer_sock->namespace[len] = 0;
|
||||||
|
xfer_sock->ns_namelen = len;
|
||||||
curoff += len;
|
curoff += len;
|
||||||
}
|
}
|
||||||
if (curoff >= maxoff) {
|
if (curoff >= maxoff) {
|
||||||
@ -1295,6 +1296,7 @@ static int get_old_sockets(const char *unixsocket)
|
|||||||
}
|
}
|
||||||
memcpy(xfer_sock->iface, &tmpbuf[curoff], len);
|
memcpy(xfer_sock->iface, &tmpbuf[curoff], len);
|
||||||
xfer_sock->iface[len] = 0;
|
xfer_sock->iface[len] = 0;
|
||||||
|
xfer_sock->if_namelen = len;
|
||||||
curoff += len;
|
curoff += len;
|
||||||
}
|
}
|
||||||
if (curoff + sizeof(int) > maxoff) {
|
if (curoff + sizeof(int) > maxoff) {
|
||||||
|
Loading…
Reference in New Issue
Block a user