ctdb-tcp: Create outbound queue when the connection becomes writable
[garming/samba-autobuild/.git] / ctdb / tcp / tcp_io.c
index be4558b16ea3bc28f352d931e7fa2f93feab9295..e33ed44048ea9e66c1b5413b0b061c65f4431857 100644 (file)
@@ -87,5 +87,10 @@ int ctdb_tcp_queue_pkt(struct ctdb_node *node, uint8_t *data, uint32_t length)
 {
        struct ctdb_tcp_node *tnode = talloc_get_type(node->private_data,
                                                      struct ctdb_tcp_node);
+       if (tnode->out_queue == NULL) {
+               DBG_DEBUG("No outgoing connection, dropping packet\n");
+               return 0;
+       }
+
        return ctdb_queue_send(tnode->out_queue, data, length);
 }