mirror of
https://opendev.org/x/pyghmi
synced 2026-03-29 06:13:30 +00:00
Fix race condition on sending data
If data was sent prior to the activate payload response, the code to calculate the maximum chunk could not suceed. Correct this by having sent data accumulate as pending until connected state reached. Change-Id: I7c9aed67209b3526bd10cafeee0bae6b1b0ab85f
This commit is contained in:
@@ -130,6 +130,8 @@ class Console(object):
|
||||
#code anyway...
|
||||
self.ipmi_session.sol_handler = self._got_sol_payload
|
||||
self.connected = True
|
||||
if len(self.pendingoutput) > 0:
|
||||
self._sendpendingoutput()
|
||||
|
||||
def _got_cons_input(self, handle):
|
||||
"""Callback for handle events detected by ipmi session
|
||||
@@ -139,7 +141,11 @@ class Console(object):
|
||||
self._sendpendingoutput()
|
||||
|
||||
def send_data(self, data):
|
||||
if self.broken:
|
||||
return
|
||||
self.pendingoutput += data
|
||||
if not self.connected:
|
||||
return
|
||||
if not self.awaitingack:
|
||||
self._sendpendingoutput()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user