mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 23:27:04 +02:00
REORG: connection: replace si_data_close() with conn_data_close()
This close function only applies to connection-specific parts and the stream-interface entry may soon disappear. Move this to the connection instead.
This commit is contained in:
parent
3438f5dce1
commit
8b117082bc
@ -30,6 +30,14 @@
|
|||||||
*/
|
*/
|
||||||
int conn_fd_handler(int fd);
|
int conn_fd_handler(int fd);
|
||||||
|
|
||||||
|
/* Calls the close() function of the data layer if any */
|
||||||
|
static inline void conn_data_close(struct connection *conn)
|
||||||
|
{
|
||||||
|
if (conn->data->close)
|
||||||
|
conn->data->close(conn);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* _PROTO_CONNECTION_H */
|
#endif /* _PROTO_CONNECTION_H */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -199,13 +199,6 @@ static inline int si_connect(struct stream_interface *si)
|
|||||||
return si_ctrl(si)->connect(si);
|
return si_ctrl(si)->connect(si);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calls the close() function of the data layer if any */
|
|
||||||
static inline void si_data_close(struct stream_interface *si)
|
|
||||||
{
|
|
||||||
if (si->conn.data->close)
|
|
||||||
si->conn.data->close(&si->conn);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* _PROTO_STREAM_INTERFACE_H */
|
#endif /* _PROTO_STREAM_INTERFACE_H */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -546,7 +546,7 @@ static int sess_update_st_con_tcp(struct session *s, struct stream_interface *si
|
|||||||
si->flags &= ~SI_FL_CAP_SPLICE;
|
si->flags &= ~SI_FL_CAP_SPLICE;
|
||||||
fd_delete(si_fd(si));
|
fd_delete(si_fd(si));
|
||||||
|
|
||||||
si_data_close(si);
|
conn_data_close(&si->conn);
|
||||||
if (si->release)
|
if (si->release)
|
||||||
si->release(si);
|
si->release(si);
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include <common/time.h>
|
#include <common/time.h>
|
||||||
|
|
||||||
#include <proto/buffers.h>
|
#include <proto/buffers.h>
|
||||||
|
#include <proto/connection.h>
|
||||||
#include <proto/fd.h>
|
#include <proto/fd.h>
|
||||||
#include <proto/freq_ctr.h>
|
#include <proto/freq_ctr.h>
|
||||||
#include <proto/log.h>
|
#include <proto/log.h>
|
||||||
@ -710,7 +711,7 @@ static void sock_raw_shutw(struct stream_interface *si)
|
|||||||
/* we may have to close a pending connection, and mark the
|
/* we may have to close a pending connection, and mark the
|
||||||
* response buffer as shutr
|
* response buffer as shutr
|
||||||
*/
|
*/
|
||||||
si_data_close(si);
|
conn_data_close(&si->conn);
|
||||||
fd_delete(si_fd(si));
|
fd_delete(si_fd(si));
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case SI_ST_CER:
|
case SI_ST_CER:
|
||||||
@ -748,7 +749,7 @@ static void sock_raw_shutr(struct stream_interface *si)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (si->ob->flags & BF_SHUTW) {
|
if (si->ob->flags & BF_SHUTW) {
|
||||||
si_data_close(si);
|
conn_data_close(&si->conn);
|
||||||
fd_delete(si_fd(si));
|
fd_delete(si_fd(si));
|
||||||
si->state = SI_ST_DIS;
|
si->state = SI_ST_DIS;
|
||||||
si->exp = TICK_ETERNITY;
|
si->exp = TICK_ETERNITY;
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include <common/time.h>
|
#include <common/time.h>
|
||||||
|
|
||||||
#include <proto/buffers.h>
|
#include <proto/buffers.h>
|
||||||
|
#include <proto/connection.h>
|
||||||
#include <proto/fd.h>
|
#include <proto/fd.h>
|
||||||
#include <proto/frontend.h>
|
#include <proto/frontend.h>
|
||||||
#include <proto/sock_raw.h>
|
#include <proto/sock_raw.h>
|
||||||
@ -230,7 +231,7 @@ static void stream_int_shutr(struct stream_interface *si)
|
|||||||
si->state = SI_ST_DIS;
|
si->state = SI_ST_DIS;
|
||||||
si->exp = TICK_ETERNITY;
|
si->exp = TICK_ETERNITY;
|
||||||
|
|
||||||
si_data_close(si);
|
conn_data_close(&si->conn);
|
||||||
if (si->release)
|
if (si->release)
|
||||||
si->release(si);
|
si->release(si);
|
||||||
}
|
}
|
||||||
@ -267,7 +268,7 @@ static void stream_int_shutw(struct stream_interface *si)
|
|||||||
si->state = SI_ST_DIS;
|
si->state = SI_ST_DIS;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
|
|
||||||
si_data_close(si);
|
conn_data_close(&si->conn);
|
||||||
if (si->release)
|
if (si->release)
|
||||||
si->release(si);
|
si->release(si);
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user