summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2020-02-29 11:54:51 +0100
committerKarolin Seeger <kseeger@samba.org>2020-03-24 07:26:18 +0000
commitec0d2193c329662f3c624f3680bfa66c734449c6 (patch)
treec9fe95e213d0a237e2ee248cf0c9643a65eb6dde
parent7f135cb6cebd25ff51d1d6603d7561f1e9fefe11 (diff)
downloadsamba-ec0d2193c329662f3c624f3680bfa66c734449c6.tar.gz
ctdb-tcp: add ctdb_tcp_stop_incoming()
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)
-rw-r--r--ctdb/tcp/ctdb_tcp.h1
-rw-r--r--ctdb/tcp/tcp_connect.c10
-rw-r--r--ctdb/tcp/tcp_init.c2
3 files changed, 12 insertions, 1 deletions
diff --git a/ctdb/tcp/ctdb_tcp.h b/ctdb/tcp/ctdb_tcp.h
index 095056e8544..cb8d66fa5dc 100644
--- a/ctdb/tcp/ctdb_tcp.h
+++ b/ctdb/tcp/ctdb_tcp.h
@@ -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
diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c
index cc0c7bd2e47..9c09f3f4e74 100644
--- a/ctdb/tcp/tcp_connect.c
+++ b/ctdb/tcp/tcp_connect.c
@@ -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
diff --git a/ctdb/tcp/tcp_init.c b/ctdb/tcp/tcp_init.c
index b0da5ad4610..fae1fa99195 100644
--- a/ctdb/tcp/tcp_init.c
+++ b/ctdb/tcp/tcp_init.c
@@ -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,