Commits (1)
...@@ -638,11 +638,8 @@ bool addfile(scfg_t* cfg, uint dirnum, file_t* f, const char* extdesc, client_t* ...@@ -638,11 +638,8 @@ bool addfile(scfg_t* cfg, uint dirnum, file_t* f, const char* extdesc, client_t*
getfilepath(cfg, f, fpath); getfilepath(cfg, f, fpath);
if(f->from_ip == NULL) if(f->from_ip == NULL)
file_client_hfields(f, client); file_client_hfields(f, client);
str_list_t list = list_archive_contents(fpath, /* pattern: */NULL int result = smb_addfile(&smb, f, SMB_SELFPACK, extdesc, /* contents: */NULL, fpath);
,(cfg->dir[dirnum]->misc & DIR_NOHASH) == 0, /* sort: */TRUE, /* error: */NULL, /* size: */0);
int result = smb_addfile_withlist(&smb, f, SMB_SELFPACK, extdesc, list, fpath);
smb_close(&smb); smb_close(&smb);
strListFree(&list);
return result == SMB_SUCCESS; return result == SMB_SUCCESS;
} }
......
...@@ -1236,10 +1236,7 @@ js_add_file(JSContext *cx, uintN argc, jsval *arglist) ...@@ -1236,10 +1236,7 @@ js_add_file(JSContext *cx, uintN argc, jsval *arglist)
getfilepath(scfg, &file, fpath); getfilepath(scfg, &file, fpath);
if(file.from_ip == NULL) if(file.from_ip == NULL)
file_client_hfields(&file, client); file_client_hfields(&file, client);
str_list_t list = list_archive_contents(fpath, /* pattern: */NULL p->smb_result = smb_addfile(&p->smb, &file, SMB_SELFPACK, extdesc, /* contents: */NULL, fpath);
,(scfg->dir[file.dir]->misc & DIR_NOHASH) == 0, /* sort: */TRUE, /* error: */NULL, /* size: */0);
p->smb_result = smb_addfile_withlist(&p->smb, &file, SMB_SELFPACK, extdesc, list, fpath);
strListFree(&list);
JS_SET_RVAL(cx, arglist, BOOLEAN_TO_JSVAL(p->smb_result == SMB_SUCCESS)); JS_SET_RVAL(cx, arglist, BOOLEAN_TO_JSVAL(p->smb_result == SMB_SUCCESS));
} }
JS_RESUMEREQUEST(cx, rc); JS_RESUMEREQUEST(cx, rc);
...@@ -1327,11 +1324,7 @@ js_update_file(JSContext *cx, uintN argc, jsval *arglist) ...@@ -1327,11 +1324,7 @@ js_update_file(JSContext *cx, uintN argc, jsval *arglist)
p->smb_result = smb_putfile(&p->smb, &file); p->smb_result = smb_putfile(&p->smb, &file);
else { else {
if((p->smb_result = smb_removefile(&p->smb, &file)) == SMB_SUCCESS) { if((p->smb_result = smb_removefile(&p->smb, &file)) == SMB_SUCCESS) {
str_list_t list = list_archive_contents(newfname, /* pattern: */NULL p->smb_result = smb_addfile(&p->smb, &file, SMB_SELFPACK, extdesc, /* contents: */NULL, newfname);
,file.dir < scfg->total_dirs && (scfg->dir[file.dir]->misc & DIR_NOHASH) == 0
,/* sort: */TRUE, /* error: */NULL, /* size: */0);
p->smb_result = smb_addfile_withlist(&p->smb, &file, SMB_SELFPACK, extdesc, list, newfname);
strListFree(&list);
} }
} }
} }
......
...@@ -660,10 +660,7 @@ bool upgrade_file_bases(bool hash) ...@@ -660,10 +660,7 @@ bool upgrade_file_bases(bool hash)
if(*extdesc) if(*extdesc)
body = extdesc; body = extdesc;
} }
str_list_t list = list_archive_contents(fpath, /* pattern: */NULL result = smb_addfile(&smb, &file, SMB_FASTALLOC, body, /* contents: */NULL, fpath);
,(scfg.dir[i]->misc & DIR_NOHASH) == 0, /* sort: */TRUE, /* error: */NULL, /* size: */0);
result = smb_addfile_withlist(&smb, &file, SMB_FASTALLOC, body, list, fpath);
strListFree(&list);
} }
if(result != SMB_SUCCESS) { if(result != SMB_SUCCESS) {
fprintf(stderr, "\n!Error %d (%s) adding file to %s\n", result, smb.last_error, smb.file); fprintf(stderr, "\n!Error %d (%s) adding file to %s\n", result, smb.last_error, smb.file);
......