Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
coco
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
coco
Commits
3e4529a0
Unverified
Commit
3e4529a0
authored
Aug 05, 2019
by
BaiJiangJie
Committed by
GitHub
Aug 05, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #257 from jumpserver/dev_bai
[Update] 优化telnet连接逻辑
parents
1919898d
5db8340f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
connection.py
coco/connection.py
+9
-3
No files found.
coco/connection.py
View file @
3e4529a0
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment