Skip to content
Snippets Groups Projects
Commit 62b59062 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Remove the archive contents in SMB file "tail" thing

This was really slowing down the upgrade_to_v319 and there's no current consumer of the data.

Consider adding back in JSON format later or just leave it to JS things to use for JSON-formatted metadata.
parent 2f328eca
No related branches found
No related tags found
No related merge requests found
......@@ -638,11 +638,8 @@ bool addfile(scfg_t* cfg, uint dirnum, file_t* f, const char* extdesc, client_t*
getfilepath(cfg, f, fpath);
if(f->from_ip == NULL)
file_client_hfields(f, client);
str_list_t list = list_archive_contents(fpath, /* pattern: */NULL
,(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);
int result = smb_addfile(&smb, f, SMB_SELFPACK, extdesc, /* contents: */NULL, fpath);
smb_close(&smb);
strListFree(&list);
return result == SMB_SUCCESS;
}
......
......@@ -1236,10 +1236,7 @@ js_add_file(JSContext *cx, uintN argc, jsval *arglist)
getfilepath(scfg, &file, fpath);
if(file.from_ip == NULL)
file_client_hfields(&file, client);
str_list_t list = list_archive_contents(fpath, /* pattern: */NULL
,(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);
p->smb_result = smb_addfile(&p->smb, &file, SMB_SELFPACK, extdesc, /* contents: */NULL, fpath);
JS_SET_RVAL(cx, arglist, BOOLEAN_TO_JSVAL(p->smb_result == SMB_SUCCESS));
}
JS_RESUMEREQUEST(cx, rc);
......@@ -1327,11 +1324,7 @@ js_update_file(JSContext *cx, uintN argc, jsval *arglist)
p->smb_result = smb_putfile(&p->smb, &file);
else {
if((p->smb_result = smb_removefile(&p->smb, &file)) == SMB_SUCCESS) {
str_list_t list = list_archive_contents(newfname, /* pattern: */NULL
,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);
p->smb_result = smb_addfile(&p->smb, &file, SMB_SELFPACK, extdesc, /* contents: */NULL, newfname);
}
}
}
......
......@@ -660,10 +660,7 @@ bool upgrade_file_bases(bool hash)
if(*extdesc)
body = extdesc;
}
str_list_t list = list_archive_contents(fpath, /* pattern: */NULL
,(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);
result = smb_addfile(&smb, &file, SMB_FASTALLOC, body, /* contents: */NULL, fpath);
}
if(result != SMB_SUCCESS) {
fprintf(stderr, "\n!Error %d (%s) adding file to %s\n", result, smb.last_error, smb.file);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment