bluesky_string_unref(block->data);
block->data = async->data;
bluesky_string_ref(block->data);
+
+ if (block->data == NULL) {
+ g_warning("Failed to fetch data block from store!\n");
+ block->data = bluesky_string_new(g_malloc0(BLUESKY_BLOCK_SIZE),
+ BLUESKY_BLOCK_SIZE);
+ }
+
block->type = BLUESKY_BLOCK_CACHED;
}
value.length()),
value.length());
async->result = 0;
+ } else {
+ g_warning("Failed to fetch key %s from kvstore", async->key);
}
break;
}
case STORE_OP_PUT:
{
string value(async->data->data, async->data->len);
- client->Put(async->key, value);
+ if (!client->Put(async->key, value)) {
+ g_warning("Failed to store key %s to kvstore", async->key);
+ }
break;
}