Dolda2000 GitWeb
/
doldaconnect.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Only subscribe to wanted notifications.
[doldaconnect.git]
/
daemon
/
transfer.c
diff --git
a/daemon/transfer.c
b/daemon/transfer.c
index
e97da03
..
ab862a2
100644
(file)
--- a/
daemon/transfer.c
+++ b/
daemon/transfer.c
@@
-40,6
+40,8
@@
static void killfilter(struct transfer *transfer);
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 *);
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;
time(&transfer->activity);
sockqueue(transfer->localend, buf, size);
transfer->curpos += size;
+ bytesdownload += size;
CBCHAINDOCB(transfer, trans_p, transfer);
}
CBCHAINDOCB(transfer, trans_p, transfer);
}
@@
-279,6
+282,7
@@
void *transfergetdata(struct transfer *transfer, size_t *size)
buf = srealloc(buf, *size);
}
transfer->curpos += *size;
buf = srealloc(buf, *size);
}
transfer->curpos += *size;
+ bytesupload += *size;
CBCHAINDOCB(transfer, trans_p, transfer);
return(buf);
}
CBCHAINDOCB(transfer, trans_p, transfer);
return(buf);
}
@@
-339,7
+343,10
@@
static int tryreq(struct transfer *transfer)
}
}
if(peer != NULL)
}
}
if(peer != NULL)
+ {
+ time(&transfer->lastreq);
return(fn->fnet->reqconn(peer));
return(fn->fnet->reqconn(peer));
+ }
return(1);
}
return(1);
}