rx: tolerate duplicate peer messages

closes #121
This commit is contained in:
Brian Warner 2016-12-26 15:27:14 -05:00
parent 8b5d884636
commit e500f4a100

View File

@ -758,10 +758,15 @@ class _Wormhole:
if self._closing:
log.msg("received peer message while closing '%s'" % phase)
if phase in self._received_messages:
log.msg("ignoring duplicate peer message '%s'" % phase)
return
if phase == "pake":
self._received_messages["pake"] = body
return self._event_received_pake(body)
if phase == "version":
self._received_messages["version"] = body
return self._event_received_version(side, body)
if re.search(r'^\d+$', phase):
return self._event_received_phase_message(side, phase, body)