Dolda2000 GitWeb
/
doldaconnect.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7665d29
)
Truncate the calculated transfer curpos when reading local file data.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 5 Nov 2009 15:59:08 +0000
(16:59 +0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Thu, 5 Nov 2009 15:59:08 +0000
(16:59 +0100)
With command-stream text left unsent in the socket pipe, curpos would
become negative, which messes things up.
daemon/transfer.c
patch
|
blob
|
blame
|
history
diff --git
a/daemon/transfer.c
b/daemon/transfer.c
index
62e81d6
..
1863e74
100644
(file)
--- a/
daemon/transfer.c
+++ b/
daemon/transfer.c
@@
-142,7
+142,8
@@
static void localread(struct socket *sk, struct transfer *transfer)
transfer->localpos += blen;
bytesupload += blen;
}
- curpos = transfer->localpos - socktqueuesize(transfer->datapipe);
+ if((curpos = transfer->localpos - socktqueuesize(transfer->datapipe)) < 0)
+ curpos = 0;
if(curpos != transfer->curpos) {
transfer->curpos = curpos;
CBCHAINDOCB(transfer, trans_p, transfer);