]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tcp: add ctdb_tcp_stop_incoming()
authorRalph Boehme <slow@samba.org>
Sat, 29 Feb 2020 10:54:51 +0000 (11:54 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 24 Mar 2020 07:26:18 +0000 (07:26 +0000)
No change in behaviour.  This makes the code self-documenting.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14295

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 2c73dbafba50b28e72a8ec7b4382fae42fca6d17)

ctdb/tcp/ctdb_tcp.h
ctdb/tcp/tcp_connect.c
ctdb/tcp/tcp_init.c

index 095056e8544544c56753cc16dfe8d9744eb09673..cb8d66fa5dcd705379e618cac64172da8426d137 100644 (file)
@@ -49,6 +49,7 @@ void ctdb_tcp_node_connect(struct tevent_context *ev, struct tevent_timer *te,
 void ctdb_tcp_read_cb(uint8_t *data, size_t cnt, void *args);
 void ctdb_tcp_tnode_cb(uint8_t *data, size_t cnt, void *private_data);
 void ctdb_tcp_stop_outgoing(struct ctdb_node *node);
+void ctdb_tcp_stop_incoming(struct ctdb_node *node);
 
 #define CTDB_TCP_ALIGNMENT 8
 
index cc0c7bd2e47aae3f7cbb99ab41d6f2159d8178cf..9c09f3f4e74b338a296117967f69899e692cdaa8 100644 (file)
@@ -54,6 +54,16 @@ void ctdb_tcp_stop_outgoing(struct ctdb_node *node)
        }
 }
 
+/*
+  stop incoming connection to a node
+ */
+void ctdb_tcp_stop_incoming(struct ctdb_node *node)
+{
+       struct ctdb_tcp_node *tnode = talloc_get_type(
+               node->transport_data, struct ctdb_tcp_node);
+
+       TALLOC_FREE(tnode->in_queue);
+}
 
 /*
   called when a complete packet has come in - should not happen on this socket
index b0da5ad4610263d92ba2f36cdb6645cd3ad284c0..fae1fa9919566e666874162a1580b7fda5ceb93f 100644 (file)
@@ -121,7 +121,7 @@ static void ctdb_tcp_restart(struct ctdb_node *node)
                node->transport_data, struct ctdb_tcp_node);
 
        DEBUG(DEBUG_NOTICE,("Tearing down connection to dead node :%d\n", node->pnn));
-       TALLOC_FREE(tnode->in_queue);
+       ctdb_tcp_stop_incoming(node);
        ctdb_tcp_stop_outgoing(node);
 
        tnode->connect_te = tevent_add_timer(node->ctdb->ev, tnode,