]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: ssl: provide its own subscribe/unsubscribe function.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 21 Mar 2019 15:30:07 +0000 (16:30 +0100)
committerOlivier Houchard <cognet@ci0.org>
Thu, 18 Apr 2019 12:56:24 +0000 (14:56 +0200)
In order to prepare for the possibility of using different kinds of xprt
with ssl, make the ssl code provide its own subscribe and unsubscribe
functions, right now it just calls conn_subscribe and conn_unsubsribe.

src/ssl_sock.c

index ea96470cb0182336aced2155c868bbe1e15ee99d..b4aa94ab9a28d2ad45c89e33cf0c567909af3418 100644 (file)
@@ -5524,6 +5524,16 @@ reneg_ok:
        return 0;
 }
 
+static int ssl_subscribe(struct connection *conn, int event_type, void *param)
+{
+       return conn_subscribe(conn, event_type, param);
+}
+
+static int ssl_unsubscribe(struct connection *conn, int event_type, void *param)
+{
+       return conn_unsubscribe(conn, event_type, param);
+}
+
 /* Receive up to <count> bytes from connection <conn>'s socket and store them
  * into buffer <buf>. Only one call to recv() is performed, unless the
  * buffer wraps, in which case a second call may be performed. The connection's
@@ -9619,8 +9629,8 @@ INITCALL1(STG_REGISTER, sample_register_convs, &conv_kws);
 static struct xprt_ops ssl_sock = {
        .snd_buf  = ssl_sock_from_buf,
        .rcv_buf  = ssl_sock_to_buf,
-       .subscribe = conn_subscribe,
-       .unsubscribe = conn_unsubscribe,
+       .subscribe = ssl_subscribe,
+       .unsubscribe = ssl_unsubscribe,
        .rcv_pipe = NULL,
        .snd_pipe = NULL,
        .shutr    = NULL,