#include <tdb.h>
/* All *_send() functions are guaranteed to be non-blocking and fully
- * asynchronous. The non-_send variants are synchronous. */
+ * asynchronous. The non-_send variants are synchronous.
+ */
/*
* Connect to ctdb using the specified domain socket.
* Returns a ctdb context if successful or NULL.
*
- * Use ctdb_free() to release the returned ctdb_connection when finished.
*/
struct ctdb_connection *ctdb_connect(const char *addr);
/*
* Callback for completed requests: it would normally unpack the request
- * using ctdb_*_recv(). You must free the request using ctdb_request_free().
+ * using ctdb_*_recv().
+ * You must free the request using ctdb_request_free().
*
* Note that due to macro magic, your callback doesn't have to take void *,
* it can take a type which matches the actual private parameter.
/* FIXME: Report error. */
ctdb->broken = true;
}
+ ctdb_request_free(req);
}
struct ctdb_connection *ctdb_connect(const char *addr)
DLIST_REMOVE(ctdb->doneq, i);
i->reply = in;
i->callback(ctdb, i, i->priv_data);
- ctdb_request_free(i);
return;
}
}
uint32_t pnn;
status = ctdb_getpnn_recv(req, &pnn);
+ ctdb_request_free(req);
if (status != 0) {
printf("Error reading PNN\n");
return;
uint32_t rm;
status = ctdb_getrecmaster_recv(req, &rm);
+ ctdb_request_free(req);
if (status != 0) {
printf("Error reading RECMASTER\n");
return;
if (ctdb_set_message_handler_recv(ctdb, req) != 0) {
err(1, "registering message");
}
+ ctdb_request_free(req);
printf("Message handler registered\n");
registered = true;
}