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
35b12409
Commit
35b12409
authored
1 year ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
When logging file transfers, log the file size too (in bytes)
parent
506f82f6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sbbs3/download.cpp
+6
-3
6 additions, 3 deletions
src/sbbs3/download.cpp
src/sbbs3/upload.cpp
+4
-2
4 additions, 2 deletions
src/sbbs3/upload.cpp
with
10 additions
and
5 deletions
src/sbbs3/download.cpp
+
6
−
3
View file @
35b12409
...
@@ -40,8 +40,10 @@ void sbbs_t::downloadedfile(file_t* f)
...
@@ -40,8 +40,10 @@ void sbbs_t::downloadedfile(file_t* f)
logon_dls
++
;
logon_dls
++
;
}
}
bprintf
(
text
[
FileNBytesSent
],
f
->
name
,
ultoac
((
ulong
)
length
,
tmp
));
bprintf
(
text
[
FileNBytesSent
],
f
->
name
,
ultoac
((
ulong
)
length
,
tmp
));
SAFEPRINTF3
(
str
,
"downloaded %s from %s %s"
snprintf
(
str
,
sizeof
str
,
"downloaded %s (%"
PRId64
" bytes) from %s %s"
,
f
->
name
,
cfg
.
lib
[
cfg
.
dir
[
f
->
dir
]
->
lib
]
->
sname
,
f
->
name
,
length
,
cfg
.
lib
[
cfg
.
dir
[
f
->
dir
]
->
lib
]
->
sname
,
cfg
.
dir
[
f
->
dir
]
->
sname
);
,
cfg
.
dir
[
f
->
dir
]
->
sname
);
logline
(
"D-"
,
str
);
logline
(
"D-"
,
str
);
...
@@ -52,7 +54,8 @@ void sbbs_t::downloadedfile(file_t* f)
...
@@ -52,7 +54,8 @@ void sbbs_t::downloadedfile(file_t* f)
}
}
/****************************************************************************/
/****************************************************************************/
/* This function is called when a file is successfully downloaded. */
/* This function is to be called when a file is successfully downloaded, */
/* to re-calculate and store the user's download through-put (in CPS). */
/****************************************************************************/
/****************************************************************************/
void
sbbs_t
::
downloadedbytes
(
off_t
size
,
time_t
elapsed
)
void
sbbs_t
::
downloadedbytes
(
off_t
size
,
time_t
elapsed
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/sbbs3/upload.cpp
+
4
−
2
View file @
35b12409
...
@@ -175,8 +175,10 @@ bool sbbs_t::uploadfile(file_t* f)
...
@@ -175,8 +175,10 @@ bool sbbs_t::uploadfile(file_t* f)
if
(
!
addfile
(
&
cfg
,
f
,
ext
,
/* metadata: */
NULL
,
&
client
))
if
(
!
addfile
(
&
cfg
,
f
,
ext
,
/* metadata: */
NULL
,
&
client
))
return
false
;
return
false
;
safe_snprintf
(
str
,
sizeof
(
str
),
"uploaded %s to %s %s"
snprintf
(
str
,
sizeof
(
str
),
"uploaded %s (%"
PRId64
" bytes) to %s %s"
,
f
->
name
,
cfg
.
lib
[
cfg
.
dir
[
f
->
dir
]
->
lib
]
->
sname
,
f
->
name
,
length
,
cfg
.
lib
[
cfg
.
dir
[
f
->
dir
]
->
lib
]
->
sname
,
cfg
.
dir
[
f
->
dir
]
->
sname
);
,
cfg
.
dir
[
f
->
dir
]
->
sname
);
if
(
cfg
.
dir
[
f
->
dir
]
->
upload_sem
[
0
])
if
(
cfg
.
dir
[
f
->
dir
]
->
upload_sem
[
0
])
ftouch
(
cmdstr
(
cfg
.
dir
[
f
->
dir
]
->
upload_sem
,
nulstr
,
nulstr
,
NULL
));
ftouch
(
cmdstr
(
cfg
.
dir
[
f
->
dir
]
->
upload_sem
,
nulstr
,
nulstr
,
NULL
));
...
...
This diff is collapsed.
Click to expand it.
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