]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: connection: replace si_data_close() with conn_data_close()
authorWilly Tarreau <wtarreau@exceliance.fr>
Mon, 6 Aug 2012 13:06:49 +0000 (15:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Sep 2012 19:53:10 +0000 (21:53 +0200)
This close function only applies to connection-specific parts and
the stream-interface entry may soon disappear. Move this to the
connection instead.

include/proto/connection.h
include/proto/stream_interface.h
src/session.c
src/sock_raw.c
src/stream_interface.c

index b0804499693a0af133151377098ee22b0f154de6..84f2f0e482bcb771f410f17cf13aaca91684841f 100644 (file)
  */
 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 */
 
 /*
index c7ae117cc0f4a520486a99957287787d9400ff77..91691c09cf8592511f2bab8f59c7c69e33fac019 100644 (file)
@@ -199,13 +199,6 @@ static inline int si_connect(struct stream_interface *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 */
 
 /*
index eca06d934d199e3a58a1200e3cc1cd592b7fc9d4..cca23a5f711f4f204bf04aed391ff4d7829e42d8 100644 (file)
@@ -546,7 +546,7 @@ static int sess_update_st_con_tcp(struct session *s, struct stream_interface *si
                si->flags &= ~SI_FL_CAP_SPLICE;
                fd_delete(si_fd(si));
 
-               si_data_close(si);
+               conn_data_close(&si->conn);
                if (si->release)
                        si->release(si);
 
index a50d77ad3097ebd887bd01a67058bc6671e3aa45..39a962e01ec21c3bf1d7571c1fb2f2077c58637d 100644 (file)
@@ -30,6 +30,7 @@
 #include <common/time.h>
 
 #include <proto/buffers.h>
+#include <proto/connection.h>
 #include <proto/fd.h>
 #include <proto/freq_ctr.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
                 * response buffer as shutr
                 */
-               si_data_close(si);
+               conn_data_close(&si->conn);
                fd_delete(si_fd(si));
                /* fall through */
        case SI_ST_CER:
@@ -748,7 +749,7 @@ static void sock_raw_shutr(struct stream_interface *si)
                return;
 
        if (si->ob->flags & BF_SHUTW) {
-               si_data_close(si);
+               conn_data_close(&si->conn);
                fd_delete(si_fd(si));
                si->state = SI_ST_DIS;
                si->exp = TICK_ETERNITY;
index cf26b51abfc1ea83b7eb942971d8736f46be8bc2..030c7c10dfdfde381b00da43c267c905359f065c 100644 (file)
@@ -27,6 +27,7 @@
 #include <common/time.h>
 
 #include <proto/buffers.h>
+#include <proto/connection.h>
 #include <proto/fd.h>
 #include <proto/frontend.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->exp = TICK_ETERNITY;
 
-               si_data_close(si);
+               conn_data_close(&si->conn);
                if (si->release)
                        si->release(si);
        }
@@ -267,7 +268,7 @@ static void stream_int_shutw(struct stream_interface *si)
                si->state = SI_ST_DIS;
                /* fall through */
 
-               si_data_close(si);
+               conn_data_close(&si->conn);
                if (si->release)
                        si->release(si);
        default: