Retry if sending data before AMP started. Resolves #1506.

This commit is contained in:
Griatch 2018-01-10 08:06:14 +01:00
parent 9488f73bab
commit 00b4ab3c10

View file

@ -378,6 +378,12 @@ class PortalSessionHandler(SessionHandler):
if self.command_overflow:
self.data_out(session, text=[[_ERROR_COMMAND_OVERFLOW], {}])
return
if not self.portal.amp_protocol:
# this can happen if someone connects before AMP connection
# was established (usually on first start)
reactor.callLater(1.0, self.data_in, session, **kwargs)
return
# scrub data
kwargs = self.clean_senddata(session, kwargs)