From 5c5dc8f30b8a4072a11641a8cbe82387ae87d082 Mon Sep 17 00:00:00 2001 From: Victor Grishchenko Date: Wed, 13 Oct 2010 16:34:00 +0200 Subject: [PATCH] no repeated data accept (and no rep acks) --- sendrecv.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sendrecv.cpp b/sendrecv.cpp index 530c27b..1f808ba 100644 --- a/sendrecv.cpp +++ b/sendrecv.cpp @@ -320,7 +320,8 @@ bin64_t Channel::OnData (Datagram& dgram) { // TODO: HAVE NONE for corrupted da bin64_t pos = dgram.Pull32(); uint8_t *data; int length = dgram.Pull(&data,1024); - bool ok = (pos==bin64_t::NONE) || file().OfferData(pos, (char*)data, length) ; + bool ok = (pos==bin64_t::NONE) || + (!file().ack_out().get(pos) && file().OfferData(pos, (char*)data, length) ); dprintf("%s #%u %cdata %s\n",tintstr(),id_,ok?'-':'!',pos.str()); data_in_ = tintbin(NOW,bin64_t::NONE); if (!ok) -- 2.39.5