mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-12-08 19:21:05 +01:00
MINOR: connection: add new function conn_is_back()
This function returns true if the connection is a backend connection and false if it's a frontend connection.
This commit is contained in:
parent
6ac98ac1be
commit
57f8185625
@ -988,6 +988,15 @@ static inline const struct mux_ops *conn_get_best_mux(struct connection *conn,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* returns 0 if the connection is valid and is a frontend connection, otherwise
|
||||||
|
* returns 1 indicating it's a backend connection. And uninitialized connection
|
||||||
|
* also returns 1 to better handle the usage in the middle of initialization.
|
||||||
|
*/
|
||||||
|
static inline int conn_is_back(const struct connection *conn)
|
||||||
|
{
|
||||||
|
return !objt_listener(conn->target);
|
||||||
|
}
|
||||||
|
|
||||||
/* returns a pointer to the proxy associated with this connection. For a front
|
/* returns a pointer to the proxy associated with this connection. For a front
|
||||||
* connection it returns a pointer to the frontend ; for a back connection, it
|
* connection it returns a pointer to the frontend ; for a back connection, it
|
||||||
* returns a pointer to the backend.
|
* returns a pointer to the backend.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user