www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples | github

Archive Index This month's Index

Subject: Re: libssh2_channel_close/libssh2_channel_free hangs if you execute long-running command

Re: libssh2_channel_close/libssh2_channel_free hangs if you execute long-running command

From: Pavel Strashkin <pavel.strashkin_at_gmail.com>
Date: Fri, 14 Oct 2011 16:00:24 -0700

OK, after really long investigation i've found the reason why it
hangs. Now i'm not sure either client or server is the reason of that.
The following stuff is happening. When "close" is received by server,
it closes pipes (stdout, ...) connected to the program and waits for
program termination. When pipe closed from one side, other side will
get SIGPIPE signal when attempting to write, but...before each write
it waits for [interval] seconds so that's why it hangs for the same
time. I'm talking about iostat, mpstat. I think it should be
documented very clearly in libssh2 docs for further users. The same
happens for "eof" request.

2011/10/14 Henrik Nordström <henrik_at_henriknordstrom.net>:
> fre 2011-10-14 klockan 10:06 -0700 skrev Pavel Strashkin:
>
>> The "terminate" word has the only meaning so i think it's a bug that
>> libssh2 waits for next channel data after user has called
>> libssh2_channel_close. The waiting period depends on how often the
>> program uses stdout/stderr.
>
> It need to wait for the remote to respond to the close request, but that
> should be pretty much immediately.
>
> Regards
> Henrik
>
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-10-15

the libssh2 team