move ctdb_call_recv to libctdb
[sahlberg/ctdb.git] / client / ctdb_client.c
index 56d8b5a729e746b77bbdcc4726d621bf8bce593f..fd34de6b83644c8b26aee6663da7b0b758ff239f 100644 (file)
@@ -41,41 +41,6 @@ struct ctdb_record_handle {
 };
 
 
-/*
-  make a recv call to the local ctdb daemon - called from client context
-
-  This is called when the program wants to wait for a ctdb_call to complete and get the 
-  results. This call will block unless the call has already completed.
-*/
-int ctdb_call_recv(struct ctdb_client_call_state *state, struct ctdb_call *call)
-{
-       if (state == NULL) {
-               return -1;
-       }
-
-       while (state->state < CTDB_CALL_DONE) {
-               event_loop_once(state->ctdb_db->ctdb->ev);
-       }
-       if (state->state != CTDB_CALL_DONE) {
-               DEBUG(DEBUG_ERR,(__location__ " ctdb_call_recv failed\n"));
-               talloc_free(state);
-               return -1;
-       }
-
-       if (state->call->reply_data.dsize) {
-               call->reply_data.dptr = talloc_memdup(state->ctdb_db,
-                                                     state->call->reply_data.dptr,
-                                                     state->call->reply_data.dsize);
-               call->reply_data.dsize = state->call->reply_data.dsize;
-       } else {
-               call->reply_data.dptr = NULL;
-               call->reply_data.dsize = 0;
-       }
-       call->status = state->call->status;
-       talloc_free(state);
-
-       return 0;
-}