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

Allow minimum disk space to be any size (not limited to 65535K)

parent ef1381e7
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -81,8 +81,8 @@ void xfer_opts()
while(1) {
i=0;
sprintf(opt[i++],"%-33.33s%uk","Min Bytes Free Disk Space"
,cfg.min_dspace);
sprintf(opt[i++],"%-33.33s%s","Min Bytes Free Disk Space"
,byte_count_to_str(cfg.min_dspace, str, sizeof(str)));
sprintf(opt[i++],"%-33.33s%u","Max Files in Batch UL Queue"
,cfg.max_batup);
sprintf(opt[i++],"%-33.33s%u","Max Files in Batch DL Queue"
......@@ -133,15 +133,16 @@ void xfer_opts()
return;
case __COUNTER__:
uifc.helpbuf=
"`Minimum Kilobytes Free Disk Space to Allow Uploads:`\n"
"`Minimum Byte Free Disk Space to Allow Uploads:`\n"
"\n"
"This is the minimum free space in a file directory to allow user\n"
"uploads.\n"
;
uifc.input(WIN_MID,0,0
,"Minimum Kilobytes Free Disk Space to Allow Uploads"
,ultoa(cfg.min_dspace,tmp,10),5,K_EDIT|K_NUMBER);
cfg.min_dspace=atoi(tmp);
byte_count_to_str(cfg.min_dspace, str, sizeof(str));
if(uifc.input(WIN_MID,0,0
,"Minimum Bytes Free Disk Space to Allow Uploads"
,str, 10, K_UPPER|K_EDIT) > 0)
cfg.min_dspace = parse_byte_count(str, 1);
break;
case __COUNTER__:
uifc.helpbuf=
......
......@@ -576,7 +576,7 @@ typedef struct
uint32_t expired_flags4; /* Flags from set #4 to remove when expired */
uint32_t expired_exempt; /* Exemptions to remove when expired */
uint32_t expired_rest; /* Restrictions to add when expired */
uint16_t min_dspace; /* Minimum amount of free space for uploads (in kilobytes) */
int64_t min_dspace; /* Minimum amount of free space for uploads */
uint16_t max_batup; /* Max number of files in upload queue */
uint16_t max_batdn; /* Max number of files in download queue */
uint16_t max_userxfer; /* Max dest. users of user to user xfer */
......
......@@ -61,7 +61,7 @@ BOOL read_file_cfg(scfg_t* cfg, char* error, size_t maxerrlen)
ini = iniReadFile(fp);
fclose(fp);
cfg->min_dspace = iniGetUShortInt(ini, ROOT_SECTION, "min_dspace", 0);
cfg->min_dspace = iniGetBytes(ini, ROOT_SECTION, "min_dspace", 1, 100 * 1024 * 1024);
cfg->max_batup = iniGetUShortInt(ini, ROOT_SECTION, "max_batup", 0);
cfg->max_batdn = iniGetUShortInt(ini, ROOT_SECTION, "max_batdn", 0);
cfg->max_userxfer = iniGetUShortInt(ini, ROOT_SECTION, "max_userxfer", 0);
......
......@@ -614,7 +614,7 @@ BOOL write_file_cfg(scfg_t* cfg, int backup_level)
backup(inipath, backup_level, TRUE);
str_list_t ini = strListInit();
iniSetUShortInt(&ini, ROOT_SECTION, "min_dspace", cfg->min_dspace, NULL);
iniSetBytes(&ini, ROOT_SECTION, "min_dspace", 1, cfg->min_dspace, NULL);
iniSetUShortInt(&ini, ROOT_SECTION, "max_batup", cfg->max_batup, NULL);
iniSetUShortInt(&ini, ROOT_SECTION, "max_batdn", cfg->max_batdn, NULL);
iniSetUShortInt(&ini, ROOT_SECTION, "max_userxfer" ,cfg->max_userxfer, NULL);
......
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