Skip to content

Commit

Permalink
Merge pull request #355 from lorenzo-d-m/main
Browse files Browse the repository at this point in the history
Deleted EOF control in telnet sync/async control chars
  • Loading branch information
carlmontanari authored Oct 15, 2024
2 parents 1513274 + e18ad73 commit 6dd94db
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
5 changes: 0 additions & 5 deletions scrapli/transport/plugins/asynctelnet/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,11 @@ def _handle_control_chars(self) -> None:
Raises:
ScrapliConnectionNotOpened: if connection is not opened for some reason
ScrapliConnectionNotOpened: if we read an empty byte string from the reader -- this
indicates the server sent an EOF -- see #142
"""
if not self.stdout:
raise ScrapliConnectionNotOpened

if self._raw_buf.find(NULL) != -1:
raise ScrapliConnectionNotOpened("server returned EOF, connection not opened")

index = self._raw_buf.find(IAC)
if index == -1:
self._cooked_buf = self._raw_buf
Expand Down
5 changes: 0 additions & 5 deletions scrapli/transport/plugins/telnet/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,11 @@ def _handle_control_chars(self) -> None:
Raises:
ScrapliConnectionNotOpened: if connection is not opened for some reason
ScrapliConnectionNotOpened: if we read an empty byte string from the reader -- this
indicates the server sent an EOF -- see #142
"""
if not self.socket:
raise ScrapliConnectionNotOpened

if self._raw_buf.find(NULL) != -1:
raise ScrapliConnectionNotOpened("server returned EOF, connection not opened")

index = self._raw_buf.find(IAC)
if index == -1:
self._cooked_buf = self._raw_buf
Expand Down

0 comments on commit 6dd94db

Please sign in to comment.