]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
fix a bug in new structure handling
authorAndrew Tridgell <tridge@samba.org>
Mon, 29 Jan 2007 11:11:16 +0000 (22:11 +1100)
committerAndrew Tridgell <tridge@samba.org>
Mon, 29 Jan 2007 11:11:16 +0000 (22:11 +1100)
(This used to be ctdb commit 5f248d82717c8094f260ea16292996bb712df947)

ctdb/common/ctdb_call.c

index 0d135d5b07772689bb6a1a0bc92df37889f1e9fd..3949206a55a71f2863d028178b8845f0a009019f 100644 (file)
@@ -299,6 +299,7 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
        /* determine if we are the dmaster for this key. This also
           fetches the record data (if any), thus avoiding a 2nd fetch of the data 
           if the call will be answered locally */
+
        ret = ctdb_ltdb_fetch(ctdb, call.key, &header, &data);
        if (ret != 0) {
                ctdb_send_error(ctdb, hdr, ret, "ltdb fetch failed in ctdb_request_call");
@@ -505,8 +506,10 @@ struct ctdb_call_state *ctdb_call_local_send(struct ctdb_context *ctdb,
 
        state->state = CTDB_CALL_DONE;
        state->node = ctdb->nodes[ctdb->vnn];
+       state->call = *call;
+
+       ret = ctdb_call_local(ctdb, &state->call, header, data, ctdb->vnn);
 
-       ret = ctdb_call_local(ctdb, call, header, data, ctdb->vnn);
        return state;
 }
 
@@ -557,11 +560,9 @@ struct ctdb_call_state *ctdb_call_send(struct ctdb_context *ctdb, struct ctdb_ca
        memcpy(&state->c->data[0], call->key.dptr, call->key.dsize);
        memcpy(&state->c->data[call->key.dsize], 
               call->call_data.dptr, call->call_data.dsize);
+       state->call                = *call;
        state->call.call_data.dptr = &state->c->data[call->key.dsize];
-       state->call.call_data.dsize = call->call_data.dsize;
-
-       state->call.key.dptr         = &state->c->data[0];
-       state->call.key.dsize        = call->key.dsize;
+       state->call.key.dptr       = &state->c->data[0];
 
        state->node   = ctdb->nodes[header.dmaster];
        state->state  = CTDB_CALL_WAIT;