- g_print("Serialized %zd bytes of data\n", state->data->len);
-
- BlueSkyStoreAsync *async = bluesky_store_async_new(fs->store);
- async->op = STORE_OP_PUT;
- async->key = g_strdup_printf("log-%08d-%08d",
- state->location.directory,
- state->location.sequence);
- async->data = bluesky_string_new_from_gstring(state->data);
- bluesky_store_async_submit(async);
- bluesky_store_async_wait(async);
- bluesky_store_async_unref(async);
+ if (state->data->len > 0) {
+ g_print("Serialized %zd bytes of data to cloud\n", state->data->len);
+
+ BlueSkyStoreAsync *async = bluesky_store_async_new(fs->store);
+ async->op = STORE_OP_PUT;
+ async->key = g_strdup_printf("log-%08d-%08d",
+ state->location.directory,
+ state->location.sequence);
+ async->data = bluesky_string_new_from_gstring(state->data);
+ bluesky_store_async_submit(async);
+ bluesky_store_async_wait(async);
+ bluesky_store_async_unref(async);
+
+ state->location.sequence++;
+ state->location.offset = 0;
+ }