Commit 5db8340f authored by BaiJiangJie's avatar BaiJiangJie

[Update] 优化telnet连接逻辑

parent 1919898d
......@@ -300,10 +300,16 @@ class TelnetConnection:
logger.info(msg)
return None, msg
if data.startswith(telnetlib.IAC):
self.option_negotiate(data)
# 将数据以 \r\n 进行分割
_data_list = data.split(b'\r\n')
for _data in _data_list:
if not _data:
continue
if _data.startswith(telnetlib.IAC):
self.option_negotiate(_data)
else:
result = self.login_auth(data)
result = self.login_auth(_data)
if result:
msg = 'Successful asset connection.<{}>/<{}>/<{}>.'.format(
self.client.user, self.system_user.username,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment