]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: connection: unexport raw_sock and ssl_sock
authorWilly Tarreau <w@1wt.eu>
Thu, 22 Dec 2016 20:08:52 +0000 (21:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 22 Dec 2016 22:26:38 +0000 (23:26 +0100)
This way we're sure not to reuse them by accident.

include/proto/raw_sock.h
include/proto/ssl_sock.h
src/raw_sock.c
src/ssl_sock.c

index 704cbc16a81c48564656ee3ce05a14407844c945..97da3535e85c38100c8b2f0fc06d140dcd20ce91 100644 (file)
@@ -24,8 +24,6 @@
 
 #include <types/stream_interface.h>
 
-extern struct xprt_ops raw_sock;
-
 #endif /* _PROTO_RAW_SOCK_H */
 
 /*
index eea53443eacac16335168940e330ed11e6a70073..d3756a12944e2aae831283fc67582e76277bc993 100644 (file)
@@ -28,7 +28,6 @@
 #include <types/proxy.h>
 #include <types/stream_interface.h>
 
-extern struct xprt_ops ssl_sock;
 extern int sslconns;
 extern int totalsslconns;
 
@@ -36,7 +35,7 @@ extern int totalsslconns;
 static inline
 int ssl_sock_is_ssl(struct connection *conn)
 {
-       if (!conn || conn->xprt != &ssl_sock || !conn->xprt_ctx)
+       if (!conn || conn->xprt != xprt_get(XPRT_SSL) || !conn->xprt_ctx)
                return 0;
        else
                return 1;
index 78cb8a2a6ff948bd5428196521567850857aa2d5..f24f201f0a8c3c9b213fa1bd2e3dd02be92c6f22 100644 (file)
@@ -406,7 +406,7 @@ static int raw_sock_from_buf(struct connection *conn, struct buffer *buf, int fl
 
 
 /* transport-layer operations for RAW sockets */
-struct xprt_ops raw_sock = {
+static struct xprt_ops raw_sock = {
        .snd_buf  = raw_sock_from_buf,
        .rcv_buf  = raw_sock_to_buf,
 #if defined(CONFIG_HAP_LINUX_SPLICE)
index 101f7f34239d50d7e086f75813e5dccfa2b3e163..f5d4920a9d003d31b011630217ec85b0cab6b8d4 100644 (file)
@@ -130,6 +130,7 @@ enum {
 
 int sslconns = 0;
 int totalsslconns = 0;
+static struct xprt_ops ssl_sock;
 
 #if (defined SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB && TLS_TICKETS_NO > 0)
 struct list tlskeys_reference = LIST_HEAD_INIT(tlskeys_reference);
@@ -6648,7 +6649,7 @@ static struct cfg_kw_list cfg_kws = {ILH, {
 }};
 
 /* transport-layer operations for SSL sockets */
-struct xprt_ops ssl_sock = {
+static struct xprt_ops ssl_sock = {
        .snd_buf  = ssl_sock_from_buf,
        .rcv_buf  = ssl_sock_to_buf,
        .rcv_pipe = NULL,