dont even try to allocate a packet if the transport is down since it will fail
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 30 Jun 2009 01:55:42 +0000 (11:55 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 27 Jul 2009 03:06:27 +0000 (13:06 +1000)
server/ctdb_call.c

index ca6fba7c649b207d019d28001196d50a6fadddeb..5e7261c12014167ce8824639e867bbef9c3aeaac 100644 (file)
@@ -663,6 +663,11 @@ struct ctdb_call_state *ctdb_daemon_call_send_remote(struct ctdb_db_context *ctd
        struct ctdb_call_state *state;
        struct ctdb_context *ctdb = ctdb_db->ctdb;
 
+       if (ctdb->methods == NULL) {
+               DEBUG(DEBUG_ERR,(__location__ " Failed send packet. Transport is down\n"));
+               return NULL;
+       }
+
        state = talloc_zero(ctdb_db, struct ctdb_call_state);
        CTDB_NO_MEMORY_NULL(ctdb, state);
        state->call = talloc(state, struct ctdb_call);