SEDbgMuxApp: properly handle peer.recv() returning None
In 2990cc14b8
I introduced a regression,
which affects the 'establish' command: if no data is received from a
Data Provider during 500 ms, the application crashes:
File "sedbgmux.py", line 151, in do_establish
if f['MsgType'] != DbgMuxFrame.MsgType.ConnData:
TypeError: 'NoneType' object is not subscriptable
This is happening because peer.recv() is returning None.
This commit is contained in:
parent
2990cc14b8
commit
530975eff2
|
@ -147,7 +147,8 @@ class SEDbgMuxApp(cmd2.Cmd):
|
|||
# Read the messages
|
||||
while True:
|
||||
f = self.peer.recv()
|
||||
|
||||
if f is None:
|
||||
continue # No more data in the buffer
|
||||
if f['MsgType'] != DbgMuxFrame.MsgType.ConnData:
|
||||
log.warning('Unexpected frame: %s', f)
|
||||
self.peer.send(DbgMuxFrame.MsgType.Ack)
|
||||
|
|
Loading…
Reference in New Issue