Skip to content

Commit 2e37244

Browse files
author
virco
committed
fixes
1 parent 8d0dc26 commit 2e37244

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

pbusinessaccount.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ void cache_account_emails() {
532532
psync_sql_res *q;
533533

534534
psync_sql_lock();
535-
q=psync_sql_prep_statement("DELETE FROM baccountemail ");
535+
q=psync_sql_prep_statement("DELETE FROM baccountemail");
536536
psync_sql_run_free(q);
537537

538538
do_psync_account_users(userids, 0, &insert_cache_email, params);

plocalscan.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,12 +455,17 @@ static void scan_delete_file(sync_folderlist *fl){
455455
psync_sql_res *res;
456456
psync_uint_row row;
457457
psync_fileid_t fileid;
458+
psync_folderid_t localparentfolderid;
459+
psync_syncid_t syncid;
458460
debug(D_NOTICE, "file deleted %s", fl->name);
459461
// it is also possible to use fl->remoteid, but the file might have just been uploaded by the upload thread
460-
res=psync_sql_query("SELECT fileid FROM localfile WHERE id=?");
462+
res=psync_sql_query("SELECT fileid, syncid, localparentfolderid FROM localfile WHERE id=?");
461463
psync_sql_bind_uint(res, 1, fl->localid);
462-
if (likely_log(row=psync_sql_fetch_rowint(res)))
464+
if (likely_log(row=psync_sql_fetch_rowint(res))){
463465
fileid=row[0];
466+
syncid=row[1];
467+
localparentfolderid=row[2];
468+
}
464469
else{
465470
psync_sql_free_result(res);
466471
return;
@@ -472,6 +477,7 @@ static void scan_delete_file(sync_folderlist *fl){
472477
psync_sql_run_free(res);
473478
if (fileid)
474479
psync_task_delete_remote_file(fl->syncid, fileid);
480+
psync_path_status_sync_folder_task_completed(syncid, localparentfolderid);
475481
}
476482

477483
static void scan_create_folder(sync_folderlist *fl){

pupload.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -443,21 +443,13 @@ static int check_file_if_exists(const unsigned char *hashhex, uint64_t fsize, ps
443443

444444
static int copy_file_if_exists(const unsigned char *hashhex, uint64_t fsize, psync_folderid_t folderid, const char *name, psync_fileid_t localfileid){
445445
binparam params[]={P_STR("auth", psync_my_auth), P_NUM("size", fsize), P_LSTR(PSYNC_CHECKSUM, hashhex, PSYNC_HASH_DIGEST_HEXLEN)};
446-
psync_socket *api;
447446
binresult *res;
448447
const binresult *metas, *meta;
449448
uint64_t result;
450449
int ret;
451-
api=psync_apipool_get();
452-
if (unlikely(!api))
450+
res=psync_api_run_command("getfilesbychecksum", params);
451+
if (!res)
453452
return -1;
454-
res=send_command(api, "getfilesbychecksum", params);
455-
if (likely(res))
456-
psync_apipool_release(api);
457-
else{
458-
psync_apipool_release_bad(api);
459-
return -1;
460-
}
461453
result=psync_find_result(res, "result", PARAM_NUM)->num;
462454
if (unlikely(result)){
463455
psync_free(res);

0 commit comments

Comments
 (0)