mirror of
https://github.com/xcat2/confluent.git
synced 2025-01-17 13:13:18 +00:00
Have server avoid sending empty data
While the client can handle it now, have the server avoid needless processing of '' data from a console provider. Address it at the deepest level (the tlvdata implementation) and a place higher up the stack to avoid hits to log and such.
This commit is contained in:
parent
be8d82c6c1
commit
52aaeef506
@ -38,6 +38,9 @@ def send(handle, data):
|
||||
if isinstance(data, str):
|
||||
# plain text, e.g. console data
|
||||
tl = len(data)
|
||||
if tl == 0:
|
||||
# if you don't have anything to say, don't say anything at all
|
||||
return
|
||||
if tl < 16777216:
|
||||
# type for string is '0', so we don't need
|
||||
# to xor anything in
|
||||
|
@ -347,6 +347,9 @@ class _ConsoleHandler(object):
|
||||
if data == conapi.ConsoleEvent.Disconnect:
|
||||
self._got_disconnected()
|
||||
return
|
||||
elif data == '':
|
||||
# ignore empty strings from a cconsole provider
|
||||
return
|
||||
if '\x1b[?1l' in data: # request for ansi mode cursor keys
|
||||
self.appmodedetected = False
|
||||
if '\x1b[?1h' in data: # remember the session wants the client to use
|
||||
|
Loading…
x
Reference in New Issue
Block a user