Keep stats on downloaded and uploaded bytes.
authorfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Wed, 9 Nov 2005 03:47:36 +0000 (03:47 +0000)
committerfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Wed, 9 Nov 2005 03:47:36 +0000 (03:47 +0000)
git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@494 959494ce-11ee-0310-bf91-de5d638817bd

daemon/transfer.c

index db43f34..ab862a2 100644 (file)
@@ -40,6 +40,8 @@
 
 static void killfilter(struct transfer *transfer);
 
+unsigned long long bytesupload = 0;
+unsigned long long bytesdownload = 0;
 struct transfer *transfers = NULL;
 int numtransfers = 0;
 GCBCHAIN(newtransfercb, struct transfer *);
@@ -240,6 +242,7 @@ void transferputdata(struct transfer *transfer, void *buf, size_t size)
     time(&transfer->activity);
     sockqueue(transfer->localend, buf, size);
     transfer->curpos += size;
+    bytesdownload += size;
     CBCHAINDOCB(transfer, trans_p, transfer);
 }
 
@@ -279,6 +282,7 @@ void *transfergetdata(struct transfer *transfer, size_t *size)
        buf = srealloc(buf, *size);
     }
     transfer->curpos += *size;
+    bytesupload += *size;
     CBCHAINDOCB(transfer, trans_p, transfer);
     return(buf);
 }