ctdb-tcp: rename ctdb_tcp_stop_connection() to ctdb_tcp_stop_outgoing()
authorRalph Boehme <slow@samba.org>
Fri, 28 Feb 2020 10:36:00 +0000 (11:36 +0100)
committerMartin Schwenke <martins@samba.org>
Thu, 12 Mar 2020 03:47:30 +0000 (03:47 +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>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/tcp/ctdb_tcp.h
ctdb/tcp/tcp_connect.c
ctdb/tcp/tcp_init.c

index daabad74297e2e2168228a6d531b227f11841354..095056e8544544c56753cc16dfe8d9744eb09673 100644 (file)
@@ -48,7 +48,7 @@ void ctdb_tcp_node_connect(struct tevent_context *ev, struct tevent_timer *te,
                           struct timeval t, void *private_data);
 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_connection(struct ctdb_node *node);
+void ctdb_tcp_stop_outgoing(struct ctdb_node *node);
 
 #define CTDB_TCP_ALIGNMENT 8
 
index 805fba5c27a22062182075b5064778eff0350d4a..757c41dc7031b388a7d6128193be04e4bb1c196d 100644 (file)
@@ -38,9 +38,9 @@
 #include "ctdb_tcp.h"
 
 /*
-  stop any connecting (established or pending) to a node
+  stop any outgoing connection (established or pending) to a node
  */
-void ctdb_tcp_stop_connection(struct ctdb_node *node)
+void ctdb_tcp_stop_outgoing(struct ctdb_node *node)
 {
        struct ctdb_tcp_node *tnode = talloc_get_type(
                node->transport_data, struct ctdb_tcp_node);
@@ -89,7 +89,7 @@ static void ctdb_node_connect_write(struct tevent_context *ev,
 
        ret = getsockopt(tnode->out_fd, SOL_SOCKET, SO_ERROR, &error, &len);
        if (ret != 0 || error != 0) {
-               ctdb_tcp_stop_connection(node);
+               ctdb_tcp_stop_outgoing(node);
                tnode->connect_te = tevent_add_timer(ctdb->ev, tnode,
                                                    timeval_current_ofs(1, 0),
                                                    ctdb_tcp_node_connect, node);
@@ -126,7 +126,7 @@ static void ctdb_node_connect_write(struct tevent_context *ev,
                                            node->name);
        if (tnode->out_queue == NULL) {
                DBG_ERR("Failed to set up outgoing queue\n");
-               ctdb_tcp_stop_connection(node);
+               ctdb_tcp_stop_outgoing(node);
                tnode->connect_te = tevent_add_timer(ctdb->ev,
                                                     tnode,
                                                     timeval_current_ofs(1, 0),
@@ -166,7 +166,7 @@ void ctdb_tcp_node_connect(struct tevent_context *ev, struct tevent_timer *te,
         ctdb_sock_addr sock_out;
        int ret;
 
-       ctdb_tcp_stop_connection(node);
+       ctdb_tcp_stop_outgoing(node);
 
        sock_out = node->address;
 
@@ -250,7 +250,7 @@ void ctdb_tcp_node_connect(struct tevent_context *ev, struct tevent_timer *te,
        return;
 
 failed:
-       ctdb_tcp_stop_connection(node);
+       ctdb_tcp_stop_outgoing(node);
        tnode->connect_te = tevent_add_timer(ctdb->ev,
                                             tnode,
                                             timeval_current_ofs(1, 0),
index dbf6c4b9bcfaefccaa20d3876ded582f16e6ef75..c6acb166807035f5f9d5b3547a66007bb8144349 100644 (file)
@@ -122,7 +122,7 @@ static void ctdb_tcp_restart(struct ctdb_node *node)
 
        DEBUG(DEBUG_NOTICE,("Tearing down connection to dead node :%d\n", node->pnn));
        TALLOC_FREE(tnode->in_queue);
-       ctdb_tcp_stop_connection(node);
+       ctdb_tcp_stop_outgoing(node);
 
        tnode->connect_te = tevent_add_timer(node->ctdb->ev, tnode,
                                             timeval_zero(),