fix a comment claiming that channels are closed automatically when GC'd (they aren't and can't be); don't close the pipe until the app explicitly calls close(); signal EOF via the pipe
the previous windows pipe fix still didn't work. replace it with a new pipe.py abstraction of pipes (one for posix, one for windows) which appears to finally work on windows. for real this time. also add some more documentation to Channel to explain that after exec_command, invoke_shell, or invoke_subsystem, a Channel can't be reused.
oooh maybe i'll test things before checking them in next time: rekeying was a little bit overzealous. now it's careful to only rekey once and reset the counters in sync
split out Packetizer, fix banner detection bug, new unit test
split out a chunk of BaseTransport into a Packetizer class, which handles
the in/out packet data, ciphers, etc. it didn't make the code any smaller
(transport.py is still close to 1500 lines, which is awful) but it did split
out a coherent chunk of functionality into a discrete unit.
in the process, fixed a bug that alain spineux pointed out: the banner
check was too forgiving and would block forever waiting for an SSH banner.
now it waits 5 seconds for the first line, and 2 seconds for each subsequent
line, before giving up.
added a unit test to test keepalive, since i wasn't sure that was still
working after pulling out Packetizer.
make SFTPClient.file an alias for SFTPClient.open.
clean up docs a little, and make 'file' an alias for 'open'.
this is how python is heading in general.
avoid os.environ['HOME'] in the demos
avoid using os.environ['HOME'], which will never work on windows, and
use os.path.expanduser() instead. it's semi-moot because windows doesn't
have a standard location for ssh files, but i think paramiko should set a
good example anyway.
integrated laptop work (test commit)
Patches applied:
* robey@lag.net--2003-public-master-shake/secsh--dev--1.0--base-0
tag of robey@lag.net--2003-public/secsh--dev--1.0--patch-160
* robey@lag.net--2003-public-master-shake/secsh--dev--1.0--patch-1
test commit
* robey@lag.net--2003-public/secsh--dev--1.0--base-0
initial import
* robey@lag.net--2003-public/secsh--dev--1.0--patch-1
no changes
change SubsystemHandler/SFTPServerInterface API
change the API of SubsystemHandler to accept a reference to the
ServerInstance object during construction. this will break all code
that currently creates subsystem handlers (like sftp servers) -- sorry!
lots of little doc fixups (mostly indenting).
rewrite channel pipes to work on windows
the pipe system i was using for simulating an os-level FD (for select) was
retarded. i realized this week that i could just use a single byte in the
pipe to signal "data is ready" and not try to feed all incoming data thru
the pipe -- and then i don't have to try to make the pipe non-blocking (which
should make it work on windows). a lot of duplicate code got removed and now
it's all going thru the same code-path on read.
there's still a slight penalty on incoming feeds and calling 'recv' when a
pipe has been opened (by calling 'fileno'), but it's tiny.
removed a bunch of documentation and comments about things not working on
windows, since i think they probably do now.
fix sending of large sftp packet sizes
fix a bug where packets larger than about 12KB would cause the session to
die on platforms other than osx. turns out that on most platforms, setting a
socket timeout also causes timeouts to occur on writes (but not on osx). so
on a huge write, once the os buffers were full, paramiko would get a
socket.timeout exception when writing, and bail.
since the timeout is primarily so we can periodically poll to see if the
session has been killed from elsewhere, do that on a timeout but otherwise
continue trying to write. large packet sizes (in sftp) should now work.