From: victor Date: Tue, 10 Nov 2009 11:10:41 +0000 (+0000) Subject: annoying bug X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=ec9c4f219fd0e61d60f274b2e0f746c24de647b4;p=swift-upb.git annoying bug git-svn-id: https://ttuki.vtt.fi/svn/p2p-next/TUD/p2tp/trunk@523 e16421f0-f15b-0410-abcd-98678b794739 --- diff --git a/sendrecv.cpp b/sendrecv.cpp index 5ad627b..811167c 100644 --- a/sendrecv.cpp +++ b/sendrecv.cpp @@ -320,8 +320,10 @@ bin64_t Channel::OnData (Datagram& dgram) { void Channel::OnAck (Datagram& dgram) { bin64_t ackd_pos = dgram.Pull32(); - if (ackd_pos.base_offset()>file().size()) + if (file().size() && ackd_pos.base_offset()>file().size_kilo()) { + eprintf("invalid ack: (%i,%lli)\n",ackd_pos.layer(),ackd_pos.offset()); return; + } dprintf("%s #%i -ack (%i,%lli)\n",tintstr(),id,ackd_pos.layer(),ackd_pos.offset()); for (int i=0; i<8 && i