[server] Fix a bug in recvfs-proc.

pending_objects should be decreased after the object is written
into disk.
This commit is contained in:
Jiaqiang Xu 2014-04-28 17:12:59 +08:00
parent a41fe51b37
commit b39636217c

View File

@ -262,6 +262,7 @@ static void
on_fs_write (OSAsyncResult *res, void *cb_data)
{
CcnetProcessor *processor = cb_data;
USE_PRIV;
if (!res->success) {
g_warning ("[recvfs] Failed to write %s.\n", res->obj_id);
@ -271,6 +272,8 @@ on_fs_write (OSAsyncResult *res, void *cb_data)
return;
}
--priv->pending_objects;
#ifdef DEBUG
seaf_debug ("[recvfs] Wrote fs object %s.\n", res->obj_id);
#endif
@ -445,8 +448,6 @@ recv_fs_object (CcnetProcessor *processor, char *content, int clen)
seaf_debug ("[recvfs] Recv fs object %.8s.\n", pack->id);
--priv->pending_objects;
fs_obj = seaf_fs_object_from_data(pack->id,
pack->object, clen - sizeof(ObjectPack),
(priv->repo_version > 0));