Skip to content

Commit

Permalink
Merge pull request #82 from ploxiln/closed_chan_shutdown
Browse files Browse the repository at this point in the history
channel: check if already closed in _send_eof()
  • Loading branch information
ploxiln authored Jul 31, 2020
2 parents 1e930d8 + 413ec61 commit b77fe6b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion paramiko/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,7 @@ def shutdown(self, how):
# feign "read" shutdown
self.eof_received = 1
if (how == 1) or (how == 2):
m = None
self.lock.acquire()
try:
m = self._send_eof()
Expand Down Expand Up @@ -1230,7 +1231,7 @@ def _set_closed(self):

def _send_eof(self):
# you are holding the lock.
if self.eof_sent:
if self.eof_sent or self.closed:
return None
m = Message()
m.add_byte(cMSG_CHANNEL_EOF)
Expand Down

0 comments on commit b77fe6b

Please sign in to comment.