in reply to Re: Re: SFTP hangs (winxp)
in thread SFTP hangs (winxp)
Ask the sysadmin of the remote machine if they would be willing to set up a second sshd on another port with logging cranked up so that you can test. It's worth a shot. Otherwise, you need to step through to find the part that is breaking your code.
Begin at the beginning. First, confirm that you can get Net::SSH::Perl working:
my $ssh = Net::SSH::Perl->new("host1", protocol=>2, debug=>1); $ssh->login("user1", "pass1"); ($out, $err, $exit) = $ssh->cmd("hostname"); print "Out: $out$/Err: $err$/Exit: $exit$/";
If that doesn't return the hostname (modulo any syntax errors ... I didn't test the code), then there is something wrong with the server.
From there, step through the Net::SFTP code until you find the bit that breaks it. (extract follows)
sub do_init { my $sftp = shift; my $ssh = $sftp->{ssh}; $sftp->debug("Sending SSH2_FXP_INIT"); my $msg = $sftp->new_msg(SSH2_FXP_INIT); $msg->put_int32(SSH2_FILEXFER_VERSION); $sftp->send_msg($msg); $msg = $sftp->get_msg; my $type = $msg->get_int8; if ($type != SSH2_FXP_VERSION) { croak "Invalid packet back from SSH2_FXP_INIT (type $type)"; } my $version = $msg->get_int32; $sftp->debug("Remote version: $version"); ## XXX Check for extensions. } . . . sub send_msg { my $sftp = shift; my($buf) = @_; my $b = Net::SFTP::Buffer->new; $b->put_int32($buf->length); $b->append($buf->bytes); $sftp->{channel}->send_data($b->bytes); }
Good luck bughunting ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: SFTP hangs (winxp)
by rkg (Hermit) on Dec 07, 2003 at 14:12 UTC | |
by shenme (Priest) on Dec 10, 2003 at 05:26 UTC | |
by shenme (Priest) on Dec 10, 2003 at 05:55 UTC | |
by rkg (Hermit) on Dec 24, 2003 at 16:51 UTC | |
by Anonymous Monk on Nov 02, 2004 at 08:01 UTC |