keep track of total bytes transferred

svn path=/trunk/boinc/; revision=607
This commit is contained in:
Seth Cooper 2002-11-13 05:17:25 +00:00
parent 5dda076366
commit 1340174ca1
2 changed files with 3 additions and 0 deletions

View File

@ -143,6 +143,7 @@ void NET_XFER::init(char* host, int p, int b) {
strcpy(hostname, host); strcpy(hostname, host);
port = p; port = p;
blocksize = b; blocksize = b;
nbytes_xfered = 0;
} }
// Insert a NET_XFER object into the set // Insert a NET_XFER object into the set
@ -265,6 +266,7 @@ int NET_XFER_SET::do_select(int max_bytes, int& bytes_transferred) {
} else if (nxp->do_file_io) { } else if (nxp->do_file_io) {
if (max_bytes > 0) { if (max_bytes > 0) {
retval = nxp->do_xfer(n); retval = nxp->do_xfer(n);
nxp->nbytes_xfered += n;
max_bytes -= n; max_bytes -= n;
bytes_transferred += n; bytes_transferred += n;
} }

View File

@ -48,6 +48,7 @@ public:
char hostname[256]; char hostname[256];
int port; int port;
int blocksize; int blocksize;
int nbytes_xfered; // total number of bytes transferred
void init(char* host, int port, int blocksize); void init(char* host, int port, int blocksize);
int open_server(); int open_server();