[project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-67]
replay patch 63 (missing channel changes) i'm still getting the hang of tla/arch, obviously. replay patch 63, which was meant to be part of the later mega-patch, but apparently when i reversed it, i lost it entirely.
This commit is contained in:
parent
c86c4f3949
commit
5598a8f88f
|
@ -81,6 +81,7 @@ class Channel (object):
|
||||||
self.name = str(chanid)
|
self.name = str(chanid)
|
||||||
self.logger = logging.getLogger('paramiko.chan.' + str(chanid))
|
self.logger = logging.getLogger('paramiko.chan.' + str(chanid))
|
||||||
self.pipe_rfd = self.pipe_wfd = None
|
self.pipe_rfd = self.pipe_wfd = None
|
||||||
|
self.event = threading.Event()
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
"""
|
"""
|
||||||
|
@ -122,14 +123,21 @@ class Channel (object):
|
||||||
m.add_byte(chr(MSG_CHANNEL_REQUEST))
|
m.add_byte(chr(MSG_CHANNEL_REQUEST))
|
||||||
m.add_int(self.remote_chanid)
|
m.add_int(self.remote_chanid)
|
||||||
m.add_string('pty-req')
|
m.add_string('pty-req')
|
||||||
m.add_boolean(0)
|
m.add_boolean(True)
|
||||||
m.add_string(term)
|
m.add_string(term)
|
||||||
m.add_int(width)
|
m.add_int(width)
|
||||||
m.add_int(height)
|
m.add_int(height)
|
||||||
# pixel height, width (usually useless)
|
# pixel height, width (usually useless)
|
||||||
m.add_int(0).add_int(0)
|
m.add_int(0).add_int(0)
|
||||||
m.add_string('')
|
m.add_string('')
|
||||||
self.transport._send_message(m)
|
self.event.clear()
|
||||||
|
self.transport._send_user_message(m)
|
||||||
|
while 1:
|
||||||
|
self.event.wait(0.1)
|
||||||
|
if self.closed:
|
||||||
|
return False
|
||||||
|
if self.event.isSet():
|
||||||
|
return True
|
||||||
|
|
||||||
def invoke_shell(self):
|
def invoke_shell(self):
|
||||||
"""
|
"""
|
||||||
|
@ -144,7 +152,14 @@ class Channel (object):
|
||||||
m.add_int(self.remote_chanid)
|
m.add_int(self.remote_chanid)
|
||||||
m.add_string('shell')
|
m.add_string('shell')
|
||||||
m.add_boolean(1)
|
m.add_boolean(1)
|
||||||
self.transport._send_message(m)
|
self.event.clear()
|
||||||
|
self.transport._send_user_message(m)
|
||||||
|
while 1:
|
||||||
|
self.event.wait(0.1)
|
||||||
|
if self.closed:
|
||||||
|
return False
|
||||||
|
if self.event.isSet():
|
||||||
|
return True
|
||||||
|
|
||||||
def exec_command(self, command):
|
def exec_command(self, command):
|
||||||
"""
|
"""
|
||||||
|
@ -163,7 +178,14 @@ class Channel (object):
|
||||||
m.add_string('exec')
|
m.add_string('exec')
|
||||||
m.add_boolean(1)
|
m.add_boolean(1)
|
||||||
m.add_string(command)
|
m.add_string(command)
|
||||||
self.transport._send_message(m)
|
self.event.clear()
|
||||||
|
self.transport._send_user_message(m)
|
||||||
|
while 1:
|
||||||
|
self.event.wait(0.1)
|
||||||
|
if self.closed:
|
||||||
|
return False
|
||||||
|
if self.event.isSet():
|
||||||
|
return True
|
||||||
|
|
||||||
def invoke_subsystem(self, subsystem):
|
def invoke_subsystem(self, subsystem):
|
||||||
"""
|
"""
|
||||||
|
@ -182,7 +204,14 @@ class Channel (object):
|
||||||
m.add_string('subsystem')
|
m.add_string('subsystem')
|
||||||
m.add_boolean(1)
|
m.add_boolean(1)
|
||||||
m.add_string(subsystem)
|
m.add_string(subsystem)
|
||||||
self.transport._send_message(m)
|
self.event.clear()
|
||||||
|
self.transport._send_user_message(m)
|
||||||
|
while 1:
|
||||||
|
self.event.wait(0.1)
|
||||||
|
if self.closed:
|
||||||
|
return False
|
||||||
|
if self.event.isSet():
|
||||||
|
return True
|
||||||
|
|
||||||
def resize_pty(self, width=80, height=24):
|
def resize_pty(self, width=80, height=24):
|
||||||
"""
|
"""
|
||||||
|
@ -204,7 +233,14 @@ class Channel (object):
|
||||||
m.add_int(width)
|
m.add_int(width)
|
||||||
m.add_int(height)
|
m.add_int(height)
|
||||||
m.add_int(0).add_int(0)
|
m.add_int(0).add_int(0)
|
||||||
self.transport._send_message(m)
|
self.event.clear()
|
||||||
|
self.transport._send_user_message(m)
|
||||||
|
while 1:
|
||||||
|
self.event.wait(0.1)
|
||||||
|
if self.closed:
|
||||||
|
return False
|
||||||
|
if self.event.isSet():
|
||||||
|
return True
|
||||||
|
|
||||||
def get_transport(self):
|
def get_transport(self):
|
||||||
"""
|
"""
|
||||||
|
@ -301,11 +337,14 @@ class Channel (object):
|
||||||
try:
|
try:
|
||||||
self.lock.acquire()
|
self.lock.acquire()
|
||||||
if self.active and not self.closed:
|
if self.active and not self.closed:
|
||||||
self._send_eof()
|
try:
|
||||||
m = Message()
|
self._send_eof()
|
||||||
m.add_byte(chr(MSG_CHANNEL_CLOSE))
|
m = Message()
|
||||||
m.add_int(self.remote_chanid)
|
m.add_byte(chr(MSG_CHANNEL_CLOSE))
|
||||||
self.transport._send_message(m)
|
m.add_int(self.remote_chanid)
|
||||||
|
self.transport._send_user_message(m)
|
||||||
|
except EOFError:
|
||||||
|
pass
|
||||||
self._set_closed()
|
self._set_closed()
|
||||||
self.transport._unlink_channel(self.chanid)
|
self.transport._unlink_channel(self.chanid)
|
||||||
finally:
|
finally:
|
||||||
|
@ -425,7 +464,7 @@ class Channel (object):
|
||||||
m.add_byte(chr(MSG_CHANNEL_DATA))
|
m.add_byte(chr(MSG_CHANNEL_DATA))
|
||||||
m.add_int(self.remote_chanid)
|
m.add_int(self.remote_chanid)
|
||||||
m.add_string(s[:size])
|
m.add_string(s[:size])
|
||||||
self.transport._send_message(m)
|
self.transport._send_user_message(m)
|
||||||
self.out_window_size -= size
|
self.out_window_size -= size
|
||||||
if self.ultra_debug:
|
if self.ultra_debug:
|
||||||
self._log(DEBUG, 'window down to %d' % self.out_window_size)
|
self._log(DEBUG, 'window down to %d' % self.out_window_size)
|
||||||
|
@ -631,6 +670,7 @@ class Channel (object):
|
||||||
|
|
||||||
def _request_success(self, m):
|
def _request_success(self, m):
|
||||||
self._log(DEBUG, 'Sesch channel %d request ok' % self.chanid)
|
self._log(DEBUG, 'Sesch channel %d request ok' % self.chanid)
|
||||||
|
self.event.set()
|
||||||
return
|
return
|
||||||
|
|
||||||
def _request_failed(self, m):
|
def _request_failed(self, m):
|
||||||
|
@ -702,7 +742,7 @@ class Channel (object):
|
||||||
else:
|
else:
|
||||||
m.add_byte(chr(MSG_CHANNEL_FAILURE))
|
m.add_byte(chr(MSG_CHANNEL_FAILURE))
|
||||||
m.add_int(self.remote_chanid)
|
m.add_int(self.remote_chanid)
|
||||||
self.transport._send_message(m)
|
self.transport._send_user_message(m)
|
||||||
|
|
||||||
def _handle_eof(self, m):
|
def _handle_eof(self, m):
|
||||||
try:
|
try:
|
||||||
|
@ -748,7 +788,7 @@ class Channel (object):
|
||||||
m = Message()
|
m = Message()
|
||||||
m.add_byte(chr(MSG_CHANNEL_EOF))
|
m.add_byte(chr(MSG_CHANNEL_EOF))
|
||||||
m.add_int(self.remote_chanid)
|
m.add_int(self.remote_chanid)
|
||||||
self.transport._send_message(m)
|
self.transport._send_user_message(m)
|
||||||
self.eof_sent = 1
|
self.eof_sent = 1
|
||||||
self._log(DEBUG, 'EOF sent')
|
self._log(DEBUG, 'EOF sent')
|
||||||
return
|
return
|
||||||
|
@ -855,7 +895,7 @@ class Channel (object):
|
||||||
m.add_byte(chr(MSG_CHANNEL_WINDOW_ADJUST))
|
m.add_byte(chr(MSG_CHANNEL_WINDOW_ADJUST))
|
||||||
m.add_int(self.remote_chanid)
|
m.add_int(self.remote_chanid)
|
||||||
m.add_int(self.in_window_sofar)
|
m.add_int(self.in_window_sofar)
|
||||||
self.transport._send_message(m)
|
self.transport._send_user_message(m)
|
||||||
self.in_window_sofar = 0
|
self.in_window_sofar = 0
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue