mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-27 23:22:09 +00:00
MEDIUM: connection: always unset the transport layer upon close
When calling conn_xprt_close(), we always clear the transport pointer so that all transport layers leave the connection in the same state after a close. This will also make it safer and cheaper to call conn_xprt_close() multiple times if needed.
This commit is contained in:
parent
773d65f413
commit
6c03a64978
@ -45,11 +45,16 @@ static inline int conn_xprt_init(struct connection *conn)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Calls the close() function of the transport layer if any */
|
||||
/* Calls the close() function of the transport layer if any, and always unsets
|
||||
* the transport layer.
|
||||
*/
|
||||
static inline void conn_xprt_close(struct connection *conn)
|
||||
{
|
||||
if (conn->xprt && conn->xprt->close)
|
||||
conn->xprt->close(conn);
|
||||
if (conn->xprt) {
|
||||
if (conn->xprt->close)
|
||||
conn->xprt->close(conn);
|
||||
conn->xprt = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Update polling on connection <c>'s file descriptor depending on its current
|
||||
|
Loading…
Reference in New Issue
Block a user