[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ssh_channel_read seems to randomly close the channel
[Thread Prev] | [Thread Next]
- Subject: Re: ssh_channel_read seems to randomly close the channel
- From: g4-lisz@xxxxxxxxxxxx
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 27 May 2019 02:52:44 +0200
- To: libssh@xxxxxxxxxx
Hi Alex I dont't have an answer. But please consider that this behavior can depend a lot on both sides of the connection. So please enable debugging / high verbosity also on the server side. Without knowing what's going on there it's hard to find out where the problem is. I'm not sure, but I think ssh_channel_request_exec returns successfully when it could execute the remote program. Which does not mean that the remote prorgram ended successfully... Did you test exec.c in the examples directory? This does not work for you either? Cheers, Till On 27.05.19 02:08, Alex Zhang wrote: > Hey all! > > I’m opening a session and am trying to remote execute a series of command. > For each command, I open a new channel, setting it to be blocking, shoot a remote execute request (which ALWAYS returns successful), and then attempt to read stdout and then stderr. > > As I said, the remote_exec for each command seems to ALWAYS be successful, but the ssh_channel_read seems to return -1 randomly on random commands. I can’t make out any patterns on which commands’ read fail and which doesn’t. > > After enabling logging, I see that when the read fails, the channel_open() returns TRUE but then after the ssh_channel_read command that fails, the channel_open() returns FALSE; it looks like the channel_read() command somehow made the channel close itself. > > Anyone know why? > > -Alex
ssh_channel_read seems to randomly close the channel | Alex Zhang <zhang.sb.2009@xxxxxxxxx> |