The signature on log items should not extend to the pointer locations.
[bluesky.git] / bluesky / log.c
index 87639db..e5f0321 100644 (file)
@@ -335,7 +335,7 @@ void bluesky_log_write_commit_point(BlueSkyFS *fs, BlueSkyCloudLog *marker)
     bluesky_cloudlog_sync(commit);
 
     g_mutex_lock(commit->lock);
-    while ((commit->pending_write & CLOUDLOG_JOURNAL))
+    while ((commit->location_flags & CLOUDLOG_UNCOMMITTED))
         g_cond_wait(commit->cond, commit->lock);
     g_mutex_unlock(commit->lock);
 
@@ -381,6 +381,9 @@ static void cloudlog_fetch_complete(BlueSkyStoreAsync *async,
         char *pathname = g_strdup_printf("%s/%s",
                                          cachefile->log->log_directory,
                                          cachefile->filename);
+        async->data = bluesky_string_dup(async->data);
+        bluesky_cloudlog_decrypt(async->data->data, async->data->len,
+                                 cachefile->fs->keys);
         if (!g_file_set_contents(pathname, async->data->data, async->data->len,
                                  NULL))
             g_print("Error writing out fetched file to cache!\n");