Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
72240049
Commit
72240049
authored
1 month ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Protect the batch download list/queue from exceeding allowed files per day
Address issue raised in discussion with x-bit regarding issue
#938
parent
25ba1249
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/bat_xfer.cpp
+10
-1
10 additions, 1 deletion
src/sbbs3/bat_xfer.cpp
with
10 additions
and
1 deletion
src/sbbs3/bat_xfer.cpp
+
10
−
1
View file @
72240049
...
@@ -263,6 +263,11 @@ bool sbbs_t::start_batch_download()
...
@@ -263,6 +263,11 @@ bool sbbs_t::start_batch_download()
iniFreeStringList
(
ini
);
iniFreeStringList
(
ini
);
return
false
;
return
false
;
}
}
if
(
useron
.
dtoday
+
file_count
>
user_downloads_per_day
(
&
cfg
,
&
useron
))
{
bputs
(
text
[
NoMoreDownloads
]);
iniFreeStringList
(
ini
);
return
false
;
}
str_list_t
filenames
=
iniGetSectionList
(
ini
,
NULL
);
str_list_t
filenames
=
iniGetSectionList
(
ini
,
NULL
);
if
(
file_count
==
1
)
{
// Only one file in the queue? Perform a non-batch (e.g. XMODEM) download
if
(
file_count
==
1
)
{
// Only one file in the queue? Perform a non-batch (e.g. XMODEM) download
...
@@ -737,7 +742,11 @@ bool sbbs_t::addtobatdl(file_t* f)
...
@@ -737,7 +742,11 @@ bool sbbs_t::addtobatdl(file_t* f)
bool
result
=
false
;
bool
result
=
false
;
str_list_t
filenames
=
iniGetSectionList
(
ini
,
/* prefix: */
NULL
);
str_list_t
filenames
=
iniGetSectionList
(
ini
,
/* prefix: */
NULL
);
if
(
strListCount
(
filenames
)
>=
cfg
.
max_batdn
)
{
size_t
file_count
=
strListCount
(
filenames
);
if
(
useron
.
dtoday
+
file_count
>
user_downloads_per_day
(
&
cfg
,
&
useron
))
{
bprintf
(
text
[
CantAddToQueue
],
f
->
name
);
bputs
(
text
[
NoMoreDownloads
]);
}
else
if
(
file_count
>=
cfg
.
max_batdn
)
{
bprintf
(
text
[
CantAddToQueue
],
f
->
name
);
bprintf
(
text
[
CantAddToQueue
],
f
->
name
);
bputs
(
text
[
BatchDlQueueIsFull
]);
bputs
(
text
[
BatchDlQueueIsFull
]);
}
else
{
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Rob Swindell
@rswindell
mentioned in issue
#938 (closed)
·
1 month ago
mentioned in issue
#938 (closed)
mentioned in issue #938
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment