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

Archive Index This month's Index

Subject: Re: libssh2_exec read stderr ?

Re: libssh2_exec read stderr ?

From: Peter Stuge <peter_at_stuge.se>
Date: Sat, 2 Jan 2010 06:00:58 +0100

salsa lover wrote:
> I'm wondering if there's a way to read stderr,

The SSH protocol has a way to do it, through
SSH_MSG_CHANNEL_EXTENDED_DATA packets on a channel otherwise sending
some other type of data.

libssh2 has a handy libssh2_channel_read_stderr() macro.

> or the best would be if i could find another way to send some
> messages back to to the client through the ssh connection ?

How generic must this be on the server side? If you control also what
is running on the server you could use a separate channel for the
status updates. It could exec or open up a subsystem or even a TCP
connection from the server side. (See the direct_tcpip.c example.)

//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-01-02

the libssh2 team