2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-16 04:38:19 +00:00

Change SOL code to not send empty data to caller

If a SOL target sends a packet with no new data (e.g. spurious retry), do not
bother the caller with such empty data.  It's a waste of their attention at
best and if the caller is doing something like trying to write the data
straight to a TLS socket, it will trigger EOF exception.

Change-Id: I1d751331bc0fa0087bf671de12507b7fe011f5fa
This commit is contained in:
Jarrod Johnson 2013-10-10 19:26:38 -04:00
parent ffe493df0f
commit b86e197210

View File

@ -226,7 +226,8 @@ class Console(object):
else: # TODO(jbjohnso) what if remote sequence number is wrong??
self.remseq = newseq
self.lastsize = remdatalen
self._print_data(remdata)
if remdata: # Do not subject callers to empty data
self._print_data(remdata)
ackpayload = (0, self.remseq, remdatalen, 0)
#Why not put pending data into the ack? because it's rare
#and might be hard to decide what to do in the context of