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"; }
In reply to Expect and PTY dropping data by salva
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |