From 18712bc179b897c28e3d597fdbefadd5bfdfc24e Mon Sep 17 00:00:00 2001 From: victor Date: Wed, 28 Oct 2009 18:51:36 +0000 Subject: [PATCH] go home git-svn-id: https://ttuki.vtt.fi/svn/p2p-next/TUD/p2tp/trunk@490 e16421f0-f15b-0410-abcd-98678b794739 --- BUGS | 11 ++++++++++- datagram.cpp | 5 ++++- ext/seq_picker.cpp | 4 ++-- sendrecv.cpp | 2 +- tests/connecttest.cpp | 4 +++- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/BUGS b/BUGS index 5e3d004..2dfe512 100644 --- a/BUGS +++ b/BUGS @@ -1,3 +1,12 @@ * hints, data for non-existing ranges * opens multiple channels to the same address - * hints do not expire + v hints do not expire + * survive 10% loss + * unlimited ping pong + * git + * check hints agains ack_out?_ + * check data against ack_in + * channel suspend/wake. 3 cong modes state machine - ??? + * minimize the number of template instantiations + * Channel thinks how much it HINTs a second, + picker thinks which HINTs are snubbed diff --git a/datagram.cpp b/datagram.cpp index 5776d98..08abef0 100644 --- a/datagram.cpp +++ b/datagram.cpp @@ -14,6 +14,7 @@ #else #include #endif +#define RND_DROP 10 #include #include "datagram.h" @@ -42,11 +43,13 @@ char* Datagram::TimeStr (tint time) { } int Datagram::Send () { - if (rand()%10==0) { +#ifdef RND_DROP + if (rand()%RND_DROP==0) { Time(); dprintf("%s datagram killed\n",TimeStr()); return size(); } +#endif int r = sendto(sock,(const char *)buf+offset,length-offset,0, (struct sockaddr*)&(addr.addr),sizeof(struct sockaddr_in)); //offset=0; diff --git a/ext/seq_picker.cpp b/ext/seq_picker.cpp index cc8a782..a880100 100644 --- a/ext/seq_picker.cpp +++ b/ext/seq_picker.cpp @@ -23,7 +23,7 @@ public: } virtual bin64_t Pick (bins& offer, uint8_t layer) { - + bin64_t hint = offer.find_filtered (ack_hint_out_,bin64_t::ALL,layer,bins::FILLED); if (hint==bin64_t::NONE) @@ -47,7 +47,7 @@ public: } virtual void Expired (bins& b) { - ack_hint_out_.remove(b); + ack_hint_out_.remove(b); // may invalidate } }; diff --git a/sendrecv.cpp b/sendrecv.cpp index bd0dfe7..c31bf1c 100644 --- a/sendrecv.cpp +++ b/sendrecv.cpp @@ -138,7 +138,7 @@ void Channel::AddHint (Datagram& dgram) { uint8_t layer = 2; // actually, enough bin64_t hint = file().picker().Pick(ack_in_,layer); - // FIXME: any layer + // FIXME FIXME FIXME: any layer if (hint==bin64_t::NONE) hint = file().picker().Pick(ack_in_,0); diff --git a/tests/connecttest.cpp b/tests/connecttest.cpp index b0bd23e..21ab809 100644 --- a/tests/connecttest.cpp +++ b/tests/connecttest.cpp @@ -49,6 +49,8 @@ using namespace p2tp; TEST(P2TP,CwndTest) { + + srand ( time(NULL) ); unlink("doc/sofi-copy.jpg"); struct stat st; @@ -90,7 +92,7 @@ TEST(P2TP,CwndTest) { p2tp::Loop(TINT_SEC); int count = 0; - while (p2tp::SeqComplete(copy)!=size && count++<20) + while (p2tp::SeqComplete(copy)!=size && count++<600) p2tp::Loop(TINT_SEC); ASSERT_EQ(size,p2tp::SeqComplete(copy)); -- 2.20.1