/* send a packet to a client */ static int daemon_queue_send(struct ctdb_client *client, struct ctdb_req_header *hdr) { CTDB_INCREMENT_STAT(client->ctdb, client_packets_sent); if (hdr->operation == CTDB_REQ_MESSAGE) { if (ctdb_queue_length(client->queue) > client->ctdb->tunable.max_queue_depth_drop_msg) { DEBUG(DEBUG_ERR,("CTDB_REQ_MESSAGE queue full - killing client connection.\n")); talloc_free(client); return -1; } } return ctdb_queue_send(client->queue, (uint8_t *)hdr, hdr->length); }
/* queue a packet for sending */ 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); return ctdb_queue_send(tnode->out_queue, data, length); }