From: fredrik Date: Sat, 22 Oct 2005 01:59:38 +0000 (+0000) Subject: A couple of small bugfixes. X-Git-Tag: 0.1~175 X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=e52006fed4c97009766abdd4a1b15ac79c6830e8;p=doldaconnect.git A couple of small bugfixes. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@400 959494ce-11ee-0310-bf91-de5d638817bd --- diff --git a/daemon/fnet-dc.c b/daemon/fnet-dc.c index 1bd9011..d6ccb77 100644 --- a/daemon/fnet-dc.c +++ b/daemon/fnet-dc.c @@ -2053,8 +2053,9 @@ static void handletthl(struct dcpeer *peer) { pushtigertree(&peer->tth, peer->inbuf); memmove(peer->inbuf, peer->inbuf + 24, peer->inbufdata -= 24); + peer->curread += 24; } - if((peer->curread += 24) >= peer->totalsize) + if(peer->curread >= peer->totalsize) { peer->state = PEER_CMD; synctigertree(&peer->tth); @@ -2112,6 +2113,12 @@ static void cmd_adcsnd(struct socket *sk, struct dcpeer *peer, char *cmd, char * goto out; } startdl(peer); + if(peer->inbufdata > 0) + { + sockpushdata(sk, peer->inbuf, peer->inbufdata); + peer->inbufdata = 0; + transread(sk, peer); + } } else { /* We certainly didn't request this...*/ freedcpeer(peer);