static void read_done_cb (OSAsyncResult *res, void *cb_data) { CcnetProcessor *processor = cb_data; USE_PRIV; if (!res->success) { g_warning ("[putcommit] Failed to read %s.\n", res->obj_id); goto bad; } send_commit (processor, res->obj_id, res->data, res->len); seaf_debug ("Send commit %.8s.\n", res->obj_id); /* Send next commit. */ if (priv->id_list != NULL) read_and_send_commit (processor); else { ccnet_processor_send_response (processor, SC_END, SS_END, NULL, 0); ccnet_processor_done (processor, TRUE); } return; bad: ccnet_processor_send_response (processor, SC_NOT_FOUND, SS_NOT_FOUND, NULL, 0); ccnet_processor_done (processor, FALSE); }
static void collect_commit_id_done (void *vprocessor) { CcnetProcessor *processor = vprocessor; USE_PRIV; if (!priv->id_list) { ccnet_processor_send_response (processor, SC_NOT_FOUND, SS_NOT_FOUND, NULL, 0); ccnet_processor_done (processor, FALSE); return; } read_and_send_commit (processor); }
static void collect_commit_id_done (void *vprocessor) { CcnetProcessor *processor = vprocessor; USE_PRIV; if (!priv->id_list) { ccnet_processor_send_response (processor, SC_NOT_FOUND, SS_NOT_FOUND, NULL, 0); ccnet_processor_done (processor, FALSE); return; } priv->reader_id = seaf_obj_store_register_async_read (seaf->commit_mgr->obj_store, priv->repo_id, priv->repo_version, read_done_cb, processor); priv->registered = TRUE; read_and_send_commit (processor); }