2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-28 20:07:42 +00:00

Don't defer custom keepalive expiry on all payloads

pyghmi was using any activity to defer any keepalive.  If
a caller has a custom keepalive, only keepalive activity
should advance the keepalive expiry.  Modify code to defer
keepalive only if it is the generic keepalive.

Change-Id: I852ad7a5de65af60fb8e11580bd2ef32896b71f6
This commit is contained in:
Jarrod Johnson 2014-06-10 10:07:55 -04:00
parent 26e8e4fdf0
commit 3bb4e3ac09

View File

@ -685,7 +685,8 @@ class Session(object):
self.netpacket = struct.pack("!%dB" % len(message), *message)
#advance idle timer since we don't need keepalive while sending packets
#out naturally
if self in Session.keepalive_sessions and not needskeepalive:
if (self in Session.keepalive_sessions and not needskeepalive and
not self._customkeepalives):
Session.keepalive_sessions[self]['timeout'] = _monotonic_time() + \
25 + (random.random() * 4.9)
self._xmit_packet(retry, delay_xmit=delay_xmit)