1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-12 20:58:37 +03:00

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)
This commit is contained in:
Ralph Boehme 2020-02-29 11:54:51 +01:00 committed by Karolin Seeger
parent 7f135cb6ce
commit ec0d2193c3
3 changed files with 12 additions and 1 deletions

View 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

View 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

View 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,