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

Archive Index This month's Index

Subject: Help with libssh2_channel_direct_tcpip_ex

Help with libssh2_channel_direct_tcpip_ex

From: Kumar, Ashish <Ashish.Kumar_at_ca.com>
Date: Tue, 16 Feb 2010 18:48:23 +0530

In my code , libssh2_channel_direct_tcpip_ex successfully returns
channel .

 

while( ( channel = libssh2_channel_direct_tcpip_ex(
session,targethostname , 22 , hostname, 22 ) ) == NULL)

{

   rc = libssh2_session_last_error(session,NULL,NULL,0);

   if (rc == LIBSSH2_ERROR_EAGAIN)

      waitsocket(ConnectSocket, session);

   else

      break;

}

 

When I use the channel for below purpose

 

while( (rc = libssh2_channel_exec(channel, commandline)) ==
LIBSSH2_ERROR_EAGAIN );

 

I get the rc = -22 i.e. "LIBSSH2_ERROR_CHANNEL_REQUEST_DENIED" .

 

When I look further , the error is actually coming from packet.c file
from below method

 

"_libssh2_packet_requirev" as the value of ret in below call is 100 i.e.
"d"

 

int ret = _libssh2_transport_read(session);

 

 

Can you give me hint to explore further into where could I be going
wrong ?

 

 

Thanks & Regards,
Ashish Kumar

 

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

the libssh2 team