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 48811cd..0571f92 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_; }