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

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
...@@ -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)
{ {
......
...@@ -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));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment