X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=bluesky%2Fs3store.c;h=b4920dc50d8f6570ba6ef53f1fd446c42cb508b5;hb=0e3a9c0defb08f388fea2c2eb393dd39d9e95e45;hp=5ab42e130552017e7a1433297256971d6b7974df;hpb=c513d64c6a1f7c2ff2bad97db69e2f40ef642167;p=bluesky.git diff --git a/bluesky/s3store.c b/bluesky/s3store.c index 5ab42e1..b4920dc 100644 --- a/bluesky/s3store.c +++ b/bluesky/s3store.c @@ -59,7 +59,6 @@ static int s3store_put_handler(int bufferSize, char *buffer, static S3Status s3store_properties_callback(const S3ResponseProperties *properties, void *callbackData) { - g_print("(Properties callback)\n"); return S3StatusOK; } @@ -76,7 +75,7 @@ static void s3store_response_callback(S3Status status, info->success = 1; } - if (errorDetails != NULL) { + if (errorDetails != NULL && errorDetails->message != NULL) { g_print(" Error message: %s\n", errorDetails->message); } } @@ -86,7 +85,6 @@ static void s3store_task(gpointer a, gpointer s) BlueSkyStoreAsync *async = (BlueSkyStoreAsync *)a; S3Store *store = (S3Store *)s; - g_print("Start task [key=%s]...\n", async->key); async->status = ASYNC_RUNNING; if (async->op == STORE_OP_GET) { @@ -99,7 +97,6 @@ static void s3store_task(gpointer a, gpointer s) handler.responseHandler.completeCallback = s3store_response_callback; handler.getObjectDataCallback = s3store_get_handler; - g_print("Starting fetch of %s from S3...\n", async->key); S3_get_object(&store->bucket, async->key, NULL, 0, 0, NULL, &handler, &info); @@ -128,8 +125,6 @@ static void s3store_task(gpointer a, gpointer s) handler.responseHandler.completeCallback = s3store_response_callback; handler.putObjectDataCallback = s3store_put_handler; - g_print("Starting store of %s to S3 at %ld...\n", - async->key, bluesky_now_hires()); S3_put_object(&store->bucket, async->key, encrypted->len, NULL, NULL, &handler, &info); @@ -138,10 +133,8 @@ static void s3store_task(gpointer a, gpointer s) async->result = 0; } - // TODO: Deallocate resources - - g_print("Finish task...\n"); bluesky_store_async_mark_complete(async); + bluesky_store_async_unref(async); } static gpointer s3store_new() @@ -184,6 +177,7 @@ static void s3store_submit(gpointer s, BlueSkyStoreAsync *async) case STORE_OP_GET: case STORE_OP_PUT: async->status = ASYNC_PENDING; + bluesky_store_async_ref(async); g_thread_pool_push(store->thread_pool, async, NULL); break;