summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-03-27 16:12:09 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-03-27 16:12:09 +0000
commita69f499ccf99642b7782cc2efae504c59cd2d07e (patch)
treed33eb7ad979c79e8db0dc027e188a53cf9083517 /src
parentce1231280a1fd115271311306db697427842c6b4 (diff)
2009-03-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Run DefaultBtMessageDispatcher:: checkRequestSlotAndDoNecessaryThing() in every 1 sec. The timeout of RequestSlot is 60s by default and it doesn't need to be called every time when DefaultBtInteractive::doInteractionProcessing() is called. * src/DefaultBtInteractive.cc * src/DefaultBtInteractive.h
Diffstat (limited to 'src')
-rw-r--r--src/DefaultBtInteractive.cc6
-rw-r--r--src/DefaultBtInteractive.h1
2 files changed, 5 insertions, 2 deletions
diff --git a/src/DefaultBtInteractive.cc b/src/DefaultBtInteractive.cc
index 1c37c27e..ef91f64b 100644
--- a/src/DefaultBtInteractive.cc
+++ b/src/DefaultBtInteractive.cc
@@ -438,8 +438,10 @@ void DefaultBtInteractive::doInteractionProcessing() {
detectMessageFlooding();
- dispatcher->checkRequestSlotAndDoNecessaryThing();
-
+ if(_perSecCheckPoint.elapsed(1)) {
+ _perSecCheckPoint.reset();
+ dispatcher->checkRequestSlotAndDoNecessaryThing();
+ }
checkHave();
sendKeepAlive();
diff --git a/src/DefaultBtInteractive.h b/src/DefaultBtInteractive.h
index d364404f..dd3a79bb 100644
--- a/src/DefaultBtInteractive.h
+++ b/src/DefaultBtInteractive.h
@@ -123,6 +123,7 @@ private:
FloodingStat floodingStat;
Time inactiveCheckPoint;
Time _pexCheckPoint;
+ Time _perSecCheckPoint;
time_t keepAliveInterval;
bool _utPexEnabled;
bool _dhtEnabled;