mirror of
https://github.com/evennia/evennia.git
synced 2026-03-21 15:26:30 +01:00
Merge branch 'master' into develop
This commit is contained in:
commit
d6ab9b3f5a
1 changed files with 8 additions and 2 deletions
|
|
@ -279,13 +279,19 @@ class AMPMultiConnectionProtocol(amp.AMP):
|
|||
if data[-2:] != NULNUL:
|
||||
# an incomplete AMP box means more batches are forthcoming.
|
||||
self.multibatches += 1
|
||||
super(AMPMultiConnectionProtocol, self).dataReceived(data)
|
||||
try:
|
||||
super(AMPMultiConnectionProtocol, self).dataReceived(data)
|
||||
except KeyError:
|
||||
_LOGGER.trace("Discarded incoming partial data: {}".format(to_str(data)))
|
||||
elif self.multibatches:
|
||||
# invalid AMP, but we have a pending multi-batch that is not yet complete
|
||||
if data[-2:] == NULNUL:
|
||||
# end of existing multibatch
|
||||
self.multibatches = max(0, self.multibatches - 1)
|
||||
super(AMPMultiConnectionProtocol, self).dataReceived(data)
|
||||
try:
|
||||
super(AMPMultiConnectionProtocol, self).dataReceived(data)
|
||||
except KeyError:
|
||||
_LOGGER.trace("Discarded incoming multi-batch data:".format(to_str(data)))
|
||||
else:
|
||||
# not an AMP communication, return warning
|
||||
self.transport.write(_HTTP_WARNING)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue