salva has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to solve this bug in Net::SFTP::Foreign.
The problem happens when Expect is used to spawn the slave SSH process so that interprocess communication goes through a PTY. After some investigation I have found that the operative system drops data when syswrite is called with more than 512 bytes or when consecutive enough syswrites summing up more than 512 bytes are performed.
Is there any way to work around this "feature"? as for instance, some way to configure the PTY to not drop data or to increment its buffer size?
Or, is there any way in Expect to get rid of the PTY once the interactive phase is over, using a regular pipe for the rest of the IPC?
It seems that HP-UX and AIX are affected by this problem, Linux is not.
update: a testing script:
to test, install Net::SFTP::Foreign and Expect, set the correct password inside the script and run it passing as argument the path to a file of 100KB aprox.$| = 1; use Net::SFTP::Foreign; # $Net::SFTP::Foreign::debug=1|2|4|32|64; while (1) { my $s = Net::SFTP::Foreign->new('localhost', password => '...'); my $r = $s->put($ARGV[0], "/tmp/delete.me"); print "ok: $r\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Expect and PTY dropping data
by pc88mxer (Vicar) on May 21, 2008 at 14:22 UTC | |
by salva (Canon) on May 21, 2008 at 14:56 UTC | |
by moritz (Cardinal) on May 21, 2008 at 15:02 UTC | |
|
Re: Expect and PTY dropping data - solved
by salva (Canon) on May 23, 2008 at 07:32 UTC |