]> p2p-next.cs.pub.ro Git - swift-upb.git/commitdiff
Insane RTT safeguard
authorVictor Grishchenko <victor.grishchenko@gmail.com>
Thu, 4 Feb 2010 14:54:15 +0000 (15:54 +0100)
committerVictor Grishchenko <victor.grishchenko@gmail.com>
Thu, 4 Feb 2010 14:54:15 +0000 (15:54 +0100)
(encountered in a valgrinded swarm)

swift.h

diff --git a/swift.h b/swift.h
index 48811cdc9ca3e7f94de8659b4e03d0fc434b3249..0571f92b34a095fba00eb76f22efaa43d271424a 100644 (file)
--- a/swift.h
+++ b/swift.h
@@ -308,7 +308,7 @@ namespace swift {
         HashTree&   file () { return transfer_->file(); }
         const Address& peer() const { return peer_; }
         tint ack_timeout () {
-            return rtt_avg_ + std::max(dev_avg_,MIN_DEV)*4;
+            return std::min(30*TINT_SEC,rtt_avg_ + std::max(dev_avg_,MIN_DEV)*4);
         }
         uint32_t    id () const { return id_; }