summaryrefslogtreecommitdiff
path: root/pysnmp/proto/mpmod/base.py
diff options
context:
space:
mode:
authorelie <elie>2010-06-11 15:57:20 +0000
committerelie <elie>2010-06-11 15:57:20 +0000
commit20ef677c63f73ad30e1ca4398bcdd94a49b4d9f3 (patch)
tree28105b0eed005d23ee29e4bd4edd85fbe9fb47d7 /pysnmp/proto/mpmod/base.py
parentc4709ed0e06acbbbc2e47a09b307f1c0ea81abf5 (diff)
downloadpysnmp-git-20ef677c63f73ad30e1ca4398bcdd94a49b4d9f3.tar.gz
MP cache expiration re-worked to be time-dependent what allows an
unlimited number of pending request/responses in SNMP engine
Diffstat (limited to 'pysnmp/proto/mpmod/base.py')
-rw-r--r--pysnmp/proto/mpmod/base.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/pysnmp/proto/mpmod/base.py b/pysnmp/proto/mpmod/base.py
index a7c30bda..666a4c37 100644
--- a/pysnmp/proto/mpmod/base.py
+++ b/pysnmp/proto/mpmod/base.py
@@ -70,7 +70,7 @@ class AbstractMessageProcessingModel:
'Cache dup for stateReference=%s at %s' %
(stateReference, self)
)
- expireAt = self.__expirationTimer+1000
+ expireAt = self.__expirationTimer+60
self.__stateReferenceIndex[stateReference] = ( msgInfo, expireAt )
# Schedule to expire
@@ -79,7 +79,6 @@ class AbstractMessageProcessingModel:
if not self.__expirationQueue[expireAt].has_key('stateReference'):
self.__expirationQueue[expireAt]['stateReference'] = {}
self.__expirationQueue[expireAt]['stateReference'][stateReference] = 1
- self.__expireCaches()
def _cachePopByStateRef(self, stateReference):
cacheInfo = self.__stateReferenceIndex.get(stateReference)
@@ -106,7 +105,7 @@ class AbstractMessageProcessingModel:
raise error.ProtocolError(
'Cache dup for msgId=%s at %s' % (msgId, self)
)
- expireAt = self.__expirationTimer+1000
+ expireAt = self.__expirationTimer+60
self.__msgIdIndex[msgId] = ( msgInfo, expireAt )
self.__sendPduHandleIdx[msgInfo['sendPduHandle']] = msgId
@@ -117,7 +116,6 @@ class AbstractMessageProcessingModel:
if not self.__expirationQueue[expireAt].has_key('msgId'):
self.__expirationQueue[expireAt]['msgId'] = {}
self.__expirationQueue[expireAt]['msgId'][msgId] = 1
- self.__expireCaches()
def _cachePopByMsgId(self, msgId):
cacheInfo = self.__msgIdIndex.get(msgId)
@@ -156,4 +154,4 @@ class AbstractMessageProcessingModel:
pass # XXX maybe these should all follow some scheme?
def receiveTimerTick(self, snmpEngine, timeNow):
- pass
+ self.__expireCaches()