Hello! Sorry for stupid question (maybe..) I'm writing application that connect to server and execute cat /etc/passwd
Code part:

Glib::ustring Ssh::Send(Glib::ustring Command)
   {
       char tmpResponse[LIBSSH2_CHANNEL_PACKET_DEFAULT]="";
       Glib::ustring Response;
libssh2_channel_write(Channel, (const char * )Command.c_str(), Command.size());
       libssh2_channel_set_blocking(Channel, 1);
libssh2_channel_handle_extended_data(Channel,LIBSSH2_CHANNEL_EXTENDED_DATA_IGNORE);

while(libssh2_channel_read(Channel, tmpResponse, LIBSSH2_CHANNEL_PACKET_DEFAULT)!=0){ Response=Response+tmpResponse; }

       return Response;
   };

I do not see correct result (like cat /etc/passwd on server), if debug code with std::cerr << tmpResponse << std::endl;
i see following output. I'm not understand why =( What's wrong ?

[EMAIL PROTECTED] ~/Projects/gpanel/src $ ./gpanel
tmpResponse = Last login: Tue Jan 15 17:37:03 2008 from 85.235.196.138
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
   The Regents of the University of California.  All rights reserved.

FreeBSD 6.2-RELEASE-p5 (ZEON) #1: Tue Jun 26 12:29:42 MSD 2007

tmpResponse = [EMAIL PROTECTED] ~]$ 5 17:37:03 2008 from 85.235.196.138
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
   The Regents of the University of California.  All rights reserved.

FreeBSD 6.2-RELEASE-p5 (ZEON) #1: Tue Jun 26 12:29:42 MSD 2007

tmpResponse = cat /etc/passwd
~]$ 5 17:37:03 2008 from 85.235.196.138
Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
   The Regents of the University of California.  All rights reserved.

FreeBSD 6.2-RELEASE-p5 (ZEON) #1: Tue Jun 26 12:29:42 MSD 2007

tmpResponse = # $FreeBSD: src/etc/master.passwd,v 1.40 2005/06/06 20:19:56 brooks Exp $
#


--
С уважением, Vasiliy G Tolstov
http://www.selfip.ru

begin:vcard
fn:Vasiliy G Tolstov
n:Tolstov;Vasiliy
org:PeterHost.Ru;Virtual Hosting
adr:;;Professora Popova str.;Saint-Petersbutg;;;Russia
email;internet:[EMAIL PROTECTED]
title:System Administrator
tel;work:+78123477743
tel;cell:+79119940054
x-mozilla-html:TRUE
url:http://www.selfip.ru
version:2.1
end:vcard

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
libssh2-devel mailing list
libssh2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libssh2-devel

Reply via email to