mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
CLEANUP: connection: remove the now unused conn_get_{from,to}_addr()
These functions are not used anymore. They didn't report failures and as such were often misused. conn_get_src() and conn_get_dst() now replaced them everywhere.
This commit is contained in:
parent
cd7ca79e6c
commit
cc4df3b3de
@ -629,38 +629,6 @@ static inline struct connection *cs_conn(const struct conn_stream *cs)
|
|||||||
return cs ? cs->conn : NULL;
|
return cs ? cs->conn : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Retrieves the connection's source address */
|
|
||||||
static inline void conn_get_from_addr(struct connection *conn)
|
|
||||||
{
|
|
||||||
if (conn->flags & CO_FL_ADDR_FROM_SET)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!conn_ctrl_ready(conn) || !conn->ctrl->get_src)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (conn->ctrl->get_src(conn->handle.fd, (struct sockaddr *)&conn->addr.from,
|
|
||||||
sizeof(conn->addr.from),
|
|
||||||
obj_type(conn->target) != OBJ_TYPE_LISTENER) == -1)
|
|
||||||
return;
|
|
||||||
conn->flags |= CO_FL_ADDR_FROM_SET;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Retrieves the connection's original destination address */
|
|
||||||
static inline void conn_get_to_addr(struct connection *conn)
|
|
||||||
{
|
|
||||||
if (conn->flags & CO_FL_ADDR_TO_SET)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!conn_ctrl_ready(conn) || !conn->ctrl->get_dst)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (conn->ctrl->get_dst(conn->handle.fd, (struct sockaddr *)&conn->addr.to,
|
|
||||||
sizeof(conn->addr.to),
|
|
||||||
obj_type(conn->target) != OBJ_TYPE_LISTENER) == -1)
|
|
||||||
return;
|
|
||||||
conn->flags |= CO_FL_ADDR_TO_SET;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Retrieves the connection's original source address. Returns non-zero on
|
/* Retrieves the connection's original source address. Returns non-zero on
|
||||||
* success or zero on failure. The operation is only performed once and the
|
* success or zero on failure. The operation is only performed once and the
|
||||||
* address is stored in the connection for future use.
|
* address is stored in the connection for future use.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user