mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-29 23:01:03 +01:00
MAJOR: connection: remove the addr field
Now addresses are dynamically allocated when needed. Each connection is created with src=dst=NULL, these entries are allocated on the fly, and released when the connection is released.
This commit is contained in:
parent
ca79f59365
commit
e71fca81dd
@ -469,8 +469,8 @@ static inline void conn_init(struct connection *conn)
|
|||||||
conn->send_wait = NULL;
|
conn->send_wait = NULL;
|
||||||
conn->recv_wait = NULL;
|
conn->recv_wait = NULL;
|
||||||
conn->idle_time = 0;
|
conn->idle_time = 0;
|
||||||
conn->src = &conn->addr.from;
|
conn->src = NULL;
|
||||||
conn->dst = &conn->addr.to;
|
conn->dst = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sets <owner> as the connection's owner */
|
/* sets <owner> as the connection's owner */
|
||||||
@ -614,6 +614,9 @@ static inline void conn_free(struct connection *conn)
|
|||||||
session_unown_conn(sess, conn);
|
session_unown_conn(sess, conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sockaddr_free(&conn->src);
|
||||||
|
sockaddr_free(&conn->dst);
|
||||||
|
|
||||||
/* By convention we always place a NULL where the ctx points to if the
|
/* By convention we always place a NULL where the ctx points to if the
|
||||||
* mux is null. It may have been used to store the connection as a
|
* mux is null. It may have been used to store the connection as a
|
||||||
* stream_interface's end point for example.
|
* stream_interface's end point for example.
|
||||||
|
|||||||
@ -461,10 +461,6 @@ struct connection {
|
|||||||
void (*destroy_cb)(struct connection *conn); /* callback to notify of imminent death of the connection */
|
void (*destroy_cb)(struct connection *conn); /* callback to notify of imminent death of the connection */
|
||||||
struct sockaddr_storage *src; /* source address (pool), when known, otherwise NULL */
|
struct sockaddr_storage *src; /* source address (pool), when known, otherwise NULL */
|
||||||
struct sockaddr_storage *dst; /* destination address (pool), when known, otherwise NULL */
|
struct sockaddr_storage *dst; /* destination address (pool), when known, otherwise NULL */
|
||||||
struct {
|
|
||||||
struct sockaddr_storage from; /* client address, or address to spoof when connecting to the server */
|
|
||||||
struct sockaddr_storage to; /* address reached by the client, or address to connect to */
|
|
||||||
} addr; /* addresses of the remote side, client for producer and server for consumer */
|
|
||||||
unsigned int idle_time; /* Time the connection was added to the idle list, or 0 if not in the idle list */
|
unsigned int idle_time; /* Time the connection was added to the idle list, or 0 if not in the idle list */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user