Skip to content

Commit 8d0dc26

Browse files
author
virco
committed
fix nested transactions bug in sync
1 parent 9586856 commit 8d0dc26

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pupload.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -706,11 +706,14 @@ static int upload_save(psync_socket *api, psync_fileid_t localfileid, const char
706706
psync_sql_bind_uint(sres, 2, size);
707707
psync_sql_bind_lstring(sres, 3, (const char *)hashhex, PSYNC_HASH_DIGEST_HEXLEN);
708708
psync_sql_run_free(sres);
709-
if (psync_check_result(meta, "conflicted", PARAM_BOOL))
709+
if (psync_check_result(meta, "conflicted", PARAM_BOOL)){
710+
psync_sql_commit_transaction();
710711
set_local_file_conflicted(localfileid, fileid, hash, localpath, psync_find_result(meta, "name", PARAM_STR)->str, taskid);
711-
else
712+
}
713+
else{
712714
set_local_file_remote_id(localfileid, fileid, hash);
713-
psync_sql_commit_transaction();
715+
psync_sql_commit_transaction();
716+
}
714717
ret=PSYNC_NET_OK;
715718
}
716719
psync_free(res);

0 commit comments

Comments
 (0)