From libssh2-devel-bounces@cool.haxx.se  Tue Feb  1 10:42:42 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p119fHRc002346;
	Tue, 1 Feb 2011 10:42:37 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p119fGiB002332
	for <libssh2-devel@cool.haxx.se>; Tue, 1 Feb 2011 10:41:16 +0100
Received: (qmail 31291 invoked from network); 1 Feb 2011 09:41:11 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 1 Feb 2011 09:41:11 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Tue, 01 Feb 2011 09:41:11 -0000
X-URL: http://trac.libssh2.org/
Subject: [libssh2] #208: Facing an issue while SFTP copying on Solaris
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/208
Message-ID: <043.39d3a69fd6a34156d1850ba5422ba148@libssh2.stuge.se>
X-Trac-Ticket-ID: 208
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#208: Facing an issue while SFTP copying on Solaris
----------------------+-----------------------------------------------------
  Reporter:  babi2ki  |       Owner:       
      Type:  defect   |      Status:  new  
  Priority:  high     |   Milestone:  1.2.7
 Component:  SFTP     |     Version:  1.2.7
  Keywords:           |      Blocks:       
Blocked By:           |  
----------------------+-----------------------------------------------------
 Hi,
  If I am trying to integrate libssh2 sample code with my project and it
 gets failed to establishing SSH session. But, when I run the same piece of
 code(sftp_write) separately it works fine for me. One thing I observed is
 that my project uses one socket for communication whereas libssh2 uses
 another for establishing SSH session.

 This issue is applicable only on Solaris and it works fine for me on Linux
 & Windows.
 So, does libssh2 has any issue when establishing a SSH session if one
 socket session is already ON? (Especially on Solaris)

 Initially I found this issue using libcurl which internally uses libssh2.

 Here is the sample libssh2 code which I have used in my project:
 ********************sample code****************
         /*
          * The application code is responsible for creating the socket
          * and establishing the connection
          */
         sock = socket(AF_INET, SOCK_STREAM, 0);

         sin.sin_family = AF_INET;
         sin.sin_port = htons(22);
         sin.sin_addr.s_addr = hostaddr;
         if (connect(sock, (struct sockaddr*)(&sin),
                         sizeof(struct sockaddr_in)) != 0) {
                 fprintf(stderr, "failed to connect!\n");
                 exit(0);
         }

         /* Create a session instance
          */
         session = libssh2_session_init();
         if(!session)
                 exit(0);

         /* Since we have set non-blocking, tell libssh2 we are blocking */
         libssh2_session_set_blocking(session, 1);

         /* ... start it up. This will trade welcome banners, exchange
 keys,
          * and setup crypto, compression, and MAC layers
          */

         rc = libssh2_session_startup(session, sock);

         if(rc) {
                 cout<<"errno = "<<errno<<endl;
                 fprintf(stderr, "Failure establishing SSH session: %d\n",
 rc);
                 exit(0);
         }
 ******************************************
 In my case rc = -1 and errno = 11;

-- 
Ticket URL: <http://trac.libssh2.org/ticket/208>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Feb  1 13:54:54 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p11CrZ0I004120;
	Tue, 1 Feb 2011 13:54:51 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p11CrYUb004087
	for <libssh2-devel@cool.haxx.se>; Tue, 1 Feb 2011 13:53:34 +0100
Received: (qmail 1296 invoked from network); 1 Feb 2011 12:53:22 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 1 Feb 2011 12:53:22 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Tue, 01 Feb 2011 12:53:22 -0000
X-URL: http://trac.libssh2.org/
Subject: [libssh2] #209: Failure in build of the example programs (1.2.7
	static on MinGW)
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/209
Message-ID: <042.4cd3759d93cddb77416601aabd251640@libssh2.stuge.se>
X-Trac-Ticket-ID: 209
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#209: Failure in build of the example programs (1.2.7 static on MinGW)
--------------------------+-------------------------------------------------
  Reporter:  arithy       |       Owner:       
      Type:  build error  |      Status:  new  
  Priority:  normal       |   Milestone:       
 Component:  examples     |     Version:  1.2.7
  Keywords:               |      Blocks:       
Blocked By:               |  
--------------------------+-------------------------------------------------
 I failed to build 1.2.7 on MinGW using the static library option.
 The make command stopped at the example program build phase.

 To work around this problem, the following modifications were required:
 - include/libssh2.h: [invalidate {{{__declspec}}}]
 {{{
   # if defined(LIBSSH2_WIN32) && defined(LIBSSH2_WINDLL)
 - #  ifdef LIBSSH2_LIBRARY
 - #   define LIBSSH2_API __declspec(dllexport)
 - #  else
 - #   define LIBSSH2_API __declspec(dllimport)
 - #  endif /* LIBSSH2_LIBRARY */
 + #  define LIBSSH2_API
   # else /* !LIBSSH2_WIN32 */
 }}}
 - example/Makefile: [add GDI32 library]
 {{{
 - LIBS =  -lws2_32
 + LIBS =  -lws2_32 -lgdi32
 }}}

-- 
Ticket URL: <http://trac.libssh2.org/ticket/209>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Feb  1 17:50:18 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p11GmxCB007432;
	Tue, 1 Feb 2011 17:50:15 +0100
Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com
	[209.85.212.54])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p11GmuIO007382
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 1 Feb 2011 17:48:57 +0100
Received: by vws9 with SMTP id 9so2404560vws.41
	for <libssh2-devel@cool.haxx.se>; Tue, 01 Feb 2011 08:48:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:date:message-id:subject:from:to
	:content-type; bh=rgiFfIVbn4pOa1wriOh1dL7SBZeC9reiBvgVDwBSq4w=;
	b=EPfD5YRsJn/FtZlMD3/HzN+2HSqskt2Hzffg64+cDckchYUNjPYSQO2fDo0xp5h75G
	HmFNDwkVnFZ3LePqhsFWUcFTUIGMN1OOqV1yzKp0rEnq5dWtFcu+A2q70q6GECYhLCv7
	FYlCoEtlslMBduDSg3nfcl3yFOopOUEfHYnTM=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=YO5s/6JPj8FPn1kY/R0MWGIT6JGbsYL0/BU9UndxOMbfWZstEzTc92mIePQbbf494g
	vRV0CZeLUrFXJu3Itd+5Qt0H2CsmznHiyXan5oeqF1lCv2M2pMSLoNJYtIKGsKnldr7L
	5BtzpKa3OI0hvaj7PQ5cQQXdzFEfCs0NiyLmM=
MIME-Version: 1.0
Received: by 10.229.188.21 with SMTP id cy21mr7260605qcb.16.1296578925625;
	Tue, 01 Feb 2011 08:48:45 -0800 (PST)
Received: by 10.229.214.134 with HTTP; Tue, 1 Feb 2011 08:48:45 -0800 (PST)
Date: Tue, 1 Feb 2011 17:48:45 +0100
Message-ID: <AANLkTi=RfQyQWYYQeCH+1XHW7WyyEsE6-qD5youRic_P@mail.gmail.com>
Subject: public key authentication
From: macav <macavsk@gmail.com>
To: libssh2-devel@cool.haxx.se
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0515798491=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============0515798491==
Content-Type: multipart/alternative; boundary=0016e686cd32490339049b3b4e3d

--0016e686cd32490339049b3b4e3d
Content-Type: text/plain; charset=ISO-8859-1

Hi,

I have a problem with public key authentication, no matter what I do, I
always get error -19: LIBSSH2_ERROR_PUBLICKEY_UNVERIFIED. I have the public
key in authorized_keys and I don't really know what to do to make it work.
Thank you for the reply.

Macav

--0016e686cd32490339049b3b4e3d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,<div><br></div><div>I have a problem with public key authentication, no =
matter what I do, I always get error -19:=A0<span class=3D"Apple-style-span=
" style=3D"font-family: monospace; white-space: pre; ">LIBSSH2_ERROR_PUBLIC=
KEY_UNVERIFIED. I have the public key in authorized_keys and I don&#39;t re=
ally know what to do to make it work.</span></div>
<div><span class=3D"Apple-style-span" style=3D"font-family: monospace; whit=
e-space: pre; ">Thank you for the reply.</span></div><div><font class=3D"Ap=
ple-style-span" face=3D"monospace"><span class=3D"Apple-style-span" style=
=3D"white-space: pre;"><br>
</span></font></div><div><font class=3D"Apple-style-span" face=3D"monospace=
"><span class=3D"Apple-style-span" style=3D"white-space: pre;">Macav</span>=
</font></div><div><font class=3D"Apple-style-span" face=3D"monospace"><span=
 class=3D"Apple-style-span" style=3D"white-space: pre;"><br>
</span></font></div><meta name=3D"qrichtext" content=3D"1"><style type=3D"t=
ext/css">
p, li { white-space: pre-wrap; }
</style>

--0016e686cd32490339049b3b4e3d--

--===============0515798491==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

--===============0515798491==--

From libssh2-devel-bounces@cool.haxx.se  Thu Feb  3 03:27:12 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p132QjqC005179;
	Thu, 3 Feb 2011 03:27:06 +0100
Received: from mail.grokthis.net (mail.grokthis.net [206.251.38.24])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p132QiKA005175
	for <libssh2-devel@cool.haxx.se>; Thu, 3 Feb 2011 03:26:45 +0100
Received: from localhost (localhost.localdomain [127.0.0.1])
	by mail.grokthis.net (Postfix) with ESMTP id 8766417C6E9
	for <libssh2-devel@cool.haxx.se>; Wed,  2 Feb 2011 21:26:10 -0500 (EST)
X-Virus-Scanned: amavisd-new at 
X-Spam-Flag: NO
X-Spam-Score: 2.228
X-Spam-Level: **
X-Spam-Status: No, score=2.228 tagged_above=-10 required=6.6
	tests=[BAYES_00=-1.9, RCVD_IN_PBL=3.335, RDNS_NONE=0.793] autolearn=no
Received: from mail.grokthis.net ([127.0.0.1])
	by localhost (mail.grokthis.net [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 7dRrtAnzQ+e3 for <libssh2-devel@cool.haxx.se>;
	Wed,  2 Feb 2011 21:25:52 -0500 (EST)
Received: from mail.grokthis.net (gollum.grokthis.net [206.251.38.24])
	by mail.grokthis.net (Postfix) with ESMTP id EEAF717C0BC
	for <libssh2-devel@cool.haxx.se>; Wed,  2 Feb 2011 21:25:51 -0500 (EST)
Date: Wed, 2 Feb 2011 21:25:51 -0500 (EST)
From: John Utz <john@utzweb.net>
To: libssh2-devel@cool.haxx.se
Message-ID: <5638872.3265.1296699951442.JavaMail.root@mail.grokthis.net>
In-Reply-To: <1374370.3263.1296699687584.JavaMail.root@mail.grokthis.net>
Subject: sample code for using sftp file attributes
MIME-Version: 1.0
X-Originating-IP: [97.126.50.178]
X-Mailer: Zimbra 6.0.8_GA_2661 (ZimbraWebClient - CAM (Mac)/6.0.8_GA_2661)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hi;

I am trying to debug some file attribute stuff with sftp and curl, so i made sure that the attribute stuff works properly with libssh2.

it does. :-)

the following code compiles and run on gentoo amd64 and OSX 10.6.

this was evolved from sftp.c

BEGIN

static void kbd_callback(const char *name, int name_len,
             const char *instruction, int instruction_len, int num_prompts,
             const LIBSSH2_USERAUTH_KBDINT_PROMPT *prompts,
             LIBSSH2_USERAUTH_KBDINT_RESPONSE *responses,
             void **abstract)
{
  int i;
  size_t n;
  char buf[1024];
  (void)abstract;
 
  printf("Please type response: ");
  fgets(buf, sizeof(buf), stdin);
  n = strlen(buf);
  while (n > 0 && strchr("\r\n", buf[n - 1]))
    n--;
  buf[n] = 0;
 
  responses[0].text = strdup(buf);
  responses[0].length = n;
}


int
main(int argc, char *argv[])
{
  int i, iRc, iPw=0, iSck = socket(AF_INET, SOCK_STREAM, 0);

  const char *pcFprt;

  LIBSSH2_SESSION     *pLS2Ses  = NULL;
  LIBSSH2_SFTP        *pLS2FtpS = NULL;
  LIBSSH2_SFTP_HANDLE *pLS2FtpH = NULL;

  LIBSSH2_SFTP_ATTRIBUTES LS2Atrs;

  unsigned long ulAdrHst = 1 < argc ? inet_addr(argv[1]) : htonl(0x7f000001);

  struct sockaddr_in sSckIn;

  sSckIn.sin_family      = AF_INET;
  sSckIn.sin_port        = htons(22);
  sSckIn.sin_addr.s_addr = ulAdrHst;

  if((iRc = connect(iSck, (struct sockaddr*)(&sSckIn),
                    sizeof(struct sockaddr_in)))) goto fin;

  if((iRc = libssh2_init(0))) goto fin;

  if(!(pLS2Ses = libssh2_session_init())) goto fin;

  libssh2_session_set_blocking(pLS2Ses, 1);

  if((iRc = libssh2_session_startup(pLS2Ses, iSck))) goto fin;

  if((iRc = libssh2_userauth_keyboard_interactive(pLS2Ses, "YOURLOGIN",
                                                  &kbd_callback))) goto fin;

  if(!(pLS2FtpS = libssh2_sftp_init(pLS2Ses))) goto fin;

  if(!(pLS2FtpH = libssh2_sftp_open(pLS2FtpS, "Compile/libssh2test/main.c", LIBSSH2_FXF_READ,
                                   0))) goto fin;

  if((iRc = libssh2_sftp_fstat_ex(pLS2FtpH, &LS2Atrs, 0))) goto fin;

  printf("Stat Data: Perm=%lo\n",  LS2Atrs.permissions);
  printf("Stat Data: Size=%llu\n", LS2Atrs.filesize);
  printf("Stat Data: mtime=%lu\n", LS2Atrs.mtime);
  printf("Stat Data: mtime=%s\n",  asctime(localtime(&LS2Atrs.mtime)));
 
  libssh2_sftp_close(pLS2FtpH);

  libssh2_sftp_shutdown(pLS2FtpS);

 fin:

  if(iRc) printf("libssh2 failed: %x\n", iRc);
  else
  {
    libssh2_session_disconnect(pLS2Ses, "Libssh2 Finished");
    libssh2_session_free(pLS2Ses);
  }
  if(pLS2FtpS && !pLS2FtpH) printf("Unable to open file with SFTP: %ld\n",
                                   libssh2_sftp_last_error(pLS2FtpS));

  close(iSck);

  return iRc;
}
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Mon Feb 14 04:19:12 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p1E3Ikeq000836;
	Mon, 14 Feb 2011 04:19:09 +0100
Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com
	[209.85.210.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p1E3IhoN000753
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Mon, 14 Feb 2011 04:18:44 +0100
Received: by iyb26 with SMTP id 26so4504462iyb.41
	for <libssh2-devel@cool.haxx.se>; Sun, 13 Feb 2011 19:18:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:date:message-id:subject:from:to
	:content-type; bh=vbjNYLHytpHVIXKqqhtPnc/KEtxDohS2QKCj1TTy2Os=;
	b=d6Qebl5QTqWWOoCzdL/kZQFlxp3ZWmv61LpDKg2y8OXnqeJ33D0FNgJzlOcIOpJj66
	YcxL15jR3Z6muVIYasUt5QNgOg0uR67+s6zB9Hp+13Epa1eQNQ3/RP8rjGIQHzvr7nLM
	hn7tJFPlDqIq2hPV90GztyjOQwM1joj5ImyGs=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=T6bVJelxKhakSvBb5ndwYRacpqS+mTJ1A15rrBn1q6SsfCcmrYi+szygPlAjNKHPVi
	AlAQd7ubmbDUHTj1Lu2fKuUXNRBgH5iRk2IcMkdArZ6/oV87uHuxhkw3fSJWL+V5+Mwf
	IFfxqjYrt+Ot70R9r3WkG89XlIDUEllkVref0=
MIME-Version: 1.0
Received: by 10.231.13.138 with SMTP id c10mr2587165iba.97.1297653516236; Sun,
	13 Feb 2011 19:18:36 -0800 (PST)
Received: by 10.231.158.15 with HTTP; Sun, 13 Feb 2011 19:18:36 -0800 (PST)
Date: Mon, 14 Feb 2011 11:18:36 +0800
Message-ID: <AANLkTinGKvs328FMgYN8v-JQpcTSOiK34ZcFALpEHqwL@mail.gmail.com>
Subject: bug in sftp_write_sliding.c
From: zl liu <xieepp@gmail.com>
To: libssh2-devel@cool.haxx.se
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0466365942=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============0466365942==
Content-Type: multipart/alternative; boundary=000325576096e07ac9049c35808c

--000325576096e07ac9049c35808c
Content-Type: text/plain; charset=ISO-8859-1

*if* (nread <= 0) {

            */* end of file */ *

**/* Only indicate the ending of the read operation not the send operation, so

   the speed is not exact*/

            *break*;
     }

--000325576096e07ac9049c35808c
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<span class=3D"Apple-style-span" style=3D"font-family: Simsun; font-size: m=
edium; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spac=
ing: 2px; "><pre><b><font color=3D"#A020F0">if</font></b> (nread &lt;=3D 0)=
 {</pre>
<pre>            <i><font color=3D"#B22222">/* end of file */=A0</font></i>=
</pre><pre><i></i>/* Only indicate the ending of the read operation not the=
 send=A0operation, so</pre><pre>   the speed is not exact*/</pre><pre>     =
       <b><font color=3D"#A020F0">break</font></b>;
     }</pre><pre><br></pre></span>

--000325576096e07ac9049c35808c--

--===============0466365942==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

--===============0466365942==--

From libssh2-devel-bounces@cool.haxx.se  Mon Feb 14 09:06:48 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p1E86QER003494;
	Mon, 14 Feb 2011 09:06:44 +0100
Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com
	[209.85.216.175])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p1E86OPw003431
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Mon, 14 Feb 2011 09:06:25 +0100
Received: by qyk8 with SMTP id 8so1124125qyk.20
	for <libssh2-devel@cool.haxx.se>; Mon, 14 Feb 2011 00:06:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:content-type;
	bh=0alndmngrJPukuTiS2FbKtvwRwoV58whviTBVqiY7so=;
	b=rIqtN2gZO8Wxk5DSjSfoCyMSHuYfMPvcxRU1cRC27KaemlXhoO91zWB+yxa7LAmbNn
	17ji43QzvIRhELR+ndAb+i8Q9ufXYUzOAOBj4ctGkj/ZH355fgta7v+aeHtyBkTDJRCR
	Seb0uM+OiUV6yIWOChdcRoY7F0GMbv9qeA0qo=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type;
	b=tFBgccsGlXm/datjOS1DsL516uNXxFUAt1K3PudB6GZBDuzzb82ESUuou/X76GLKqQ
	IpT8yn3aTYjx1YW7TSSm51UXp/9XzdFue360P/72o1rCV5AQzftBvvKybx14xl0nYQjL
	WDX7SCUpmUwSPM2ARYctXTRvwtmtR3q8Fok+8=
MIME-Version: 1.0
Received: by 10.229.186.75 with SMTP id cr11mr2525645qcb.113.1297670777752;
	Mon, 14 Feb 2011 00:06:17 -0800 (PST)
Received: by 10.229.238.204 with HTTP; Mon, 14 Feb 2011 00:06:17 -0800 (PST)
In-Reply-To: <AANLkTinDo9qRGyXzQSOhDSf+7jGHFvEv683X_v4gFzF1@mail.gmail.com>
References: <AANLkTinDo9qRGyXzQSOhDSf+7jGHFvEv683X_v4gFzF1@mail.gmail.com>
Date: Mon, 14 Feb 2011 09:06:17 +0100
Message-ID: <AANLkTikgu+pkc3GS99uy7rhgy2Kz=jUdZ-VB783+hvTF@mail.gmail.com>
Subject: Re: [PATCH] do decompression only if needed
From: Alfred Gebert <alfred.gebert@gmail.com>
To: libssh2-devel@cool.haxx.se
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

I did not hear anything. This is a friendly remainder. Thank you.

Alfred
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Mon Feb 14 11:56:37 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p1EAuK5R013053;
	Mon, 14 Feb 2011 11:56:35 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p1EAuIhU013047
	for <libssh2-devel@cool.haxx.se>; Mon, 14 Feb 2011 11:56:18 +0100
Date: Mon, 14 Feb 2011 11:56:18 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: [PATCH] do decompression only if needed
In-Reply-To: <AANLkTikgu+pkc3GS99uy7rhgy2Kz=jUdZ-VB783+hvTF@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1102141155520.10637@tvnag.unkk.fr>
References: <AANLkTinDo9qRGyXzQSOhDSf+7jGHFvEv683X_v4gFzF1@mail.gmail.com>
	<AANLkTikgu+pkc3GS99uy7rhgy2Kz=jUdZ-VB783+hvTF@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Mon, 14 Feb 2011, Alfred Gebert wrote:

> I did not hear anything. This is a friendly remainder. Thank you.

Thanks for the reminder, I'll free up some time and give it a check asap.

-- 

  / daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Mon Feb 14 15:24:50 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p1EEONdS019068;
	Mon, 14 Feb 2011 15:24:46 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p1EEOMsC019031
	for <libssh2-devel@cool.haxx.se>; Mon, 14 Feb 2011 15:24:22 +0100
Received: (qmail 21511 invoked from network); 14 Feb 2011 14:24:16 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 14 Feb 2011 14:24:16 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Mon, 14 Feb 2011 14:24:16 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #205: "Error waiting for FXP_READ ACK" during large
	download on Windows
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/205#comment:6
Message-ID: <060.a881395ce3dfab88c253df0bd73e3d77@libssh2.stuge.se>
References: <045.22cd8a9b7f08a7953dd719389d002842@libssh2.stuge.se>
X-Trac-Ticket-ID: 205
In-Reply-To: <045.22cd8a9b7f08a7953dd719389d002842@libssh2.stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#205: "Error waiting for FXP_READ ACK" during large download on Windows
------------------------+---------------------------------------------------
  Reporter:  riordanmr  |        Owner:       
      Type:  defect     |       Status:  new  
  Priority:  normal     |    Milestone:  1.2.8
 Component:  API        |      Version:  1.2.7
Resolution:             |     Keywords:       
    Blocks:             |   Blocked By:       
------------------------+---------------------------------------------------

Comment (by stuge):

 We're talking on IRC about how to maybe hunt this down.

 Replying to [ticket:205 riordanmr]:
 > Occasionally during large downloads, libssh2_sftp_read returns -25, with
 error text "Error waiting for FXP_READ ACK".
 > This problem seems to occur only on Windows,

 I had a thought; is this 32 or 64-bit Windows?

-- 
Ticket URL: <http://trac.libssh2.org/ticket/205#comment:6>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Mon Feb 14 21:31:55 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p1EKVXBs008537;
	Mon, 14 Feb 2011 21:31:51 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p1EKVVcW008531
	for <libssh2-devel@cool.haxx.se>; Mon, 14 Feb 2011 21:31:31 +0100
Received: (qmail 11917 invoked from network); 14 Feb 2011 20:31:25 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 14 Feb 2011 20:31:25 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Mon, 14 Feb 2011 20:31:25 -0000
X-URL: http://trac.libssh2.org/
Subject: [libssh2] #210: make check and install fail on Solaris (OpenIndiana
	x86)
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/210
Message-ID: <041.9be3250759a64acfab2d0aafd3ff2a89@libssh2.stuge.se>
X-Trac-Ticket-ID: 210
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#210: make check and install fail on Solaris (OpenIndiana x86)
--------------------------+-------------------------------------------------
  Reporter:  dzejk        |       Owner:       
      Type:  build error  |      Status:  new  
  Priority:  normal       |   Milestone:  1.2.7
 Component:  tests        |     Version:  1.2.7
  Keywords:               |      Blocks:       
Blocked By:               |  
--------------------------+-------------------------------------------------
 ''System:''
 uname -a
 SunOS hostname 5.11 oi_148 i86pc i386 i86pc

 ''Compiler:''
 gcc -v
 Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/specs
 Configured with: /export/sfw-b148/sfw-
 gate/usr/src/cmd/gcc/gcc-3.4.3/configure -
 -prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as --with-
 ld=/usr/ccs/bin
 /ld --without-gnu-ld --enable-languages=c,c++,f77,objc --enable-shared
 Thread model: posix
 gcc version 3.4.3 (csl-sol210-3_4-20050802)

 ''First I installed OpenSSL 1.0.0d:''
 ./config --prefix=INST_DIR --openssldir=INST_DIR shared
 make
 make test
 make install

 ''Build and install complete successfully. Let's take a look:''
 ls INST_DIR/lib
 engines      libcrypto.so        libssl.a   libssl.so.1.0.0
 libcrypto.a  libcrypto.so.1.0.0  libssl.so  pkgconfig

 ''Then I try to build LibSSH2 1.2.7:''

 ./configure --prefix=SOMEWHERE --with-libssl-prefix=INST_DIR
 ''(I give the same directory where OpenSSL installs to. lib with static
 and shared libraries is relative to it and configure detects it
 correctly)''
 make
 ''(it succeeds)''
 make check
 ''It fails. First some test cases are built, then it outputs:''
 make  check-TESTS
 make[2]: Entering directory `/home/my_uname/libssh2-1.2.7/tests'
 ld.so.1: simple: fatal: libssl.so.1.0.0: open failed: No such file or
 directory
 /bin/sh: line 9: 2397: Killed
 FAIL: simple
 ===========================================
 1 of 1 tests failed
 Please report to libssh2-devel@cool.haxx.se
 ===========================================
 make[2]: *** [check-TESTS] Error 1
 make[2]: Leaving directory `/home/my_uname/libssh2-1.2.7/tests'
 make[1]: *** [check-am] Error 2
 make[1]: Leaving directory `/home/my_uname/libssh2-1.2.7/tests'
 make: *** [check-recursive] Error 1

 ''Anyway I attempt to install it:''
 my_uname@hostname:~/libssh2-1.2.7$ su
 Password:
 my_unamec@hostname:~/libssh2-1.2.7# make install
 make: Fatal error in reader: Makefile, line 751: Badly formed macro
 assignment

-- 
Ticket URL: <http://trac.libssh2.org/ticket/210>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Feb 15 00:59:48 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p1ENxTT8018730;
	Tue, 15 Feb 2011 00:59:44 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p1ENxQAH018702
	for <libssh2-devel@cool.haxx.se>; Tue, 15 Feb 2011 00:59:26 +0100
Received: (qmail 26700 invoked from network); 14 Feb 2011 23:59:21 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 14 Feb 2011 23:59:21 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Mon, 14 Feb 2011 23:59:21 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #205: "Error waiting for FXP_READ ACK" during large
	download on Windows
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/205#comment:7
Message-ID: <060.2ad5772c1f010df4571275762212628a@libssh2.stuge.se>
References: <045.22cd8a9b7f08a7953dd719389d002842@libssh2.stuge.se>
X-Trac-Ticket-ID: 205
In-Reply-To: <045.22cd8a9b7f08a7953dd719389d002842@libssh2.stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#205: "Error waiting for FXP_READ ACK" during large download on Windows
------------------------+---------------------------------------------------
  Reporter:  riordanmr  |        Owner:       
      Type:  defect     |       Status:  new  
  Priority:  normal     |    Milestone:  1.2.8
 Component:  API        |      Version:  1.2.7
Resolution:             |     Keywords:       
    Blocks:             |   Blocked By:       
------------------------+---------------------------------------------------

Comment (by riordanmr):

 This is 32-bit Windows 2003.

-- 
Ticket URL: <http://trac.libssh2.org/ticket/205#comment:7>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Feb 15 01:50:23 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p1F0oDtR018601;
	Tue, 15 Feb 2011 01:50:22 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p1F0oDUa018592
	for <libssh2-devel@cool.haxx.se>; Tue, 15 Feb 2011 01:50:13 +0100
Received: (qmail 18989 invoked from network); 15 Feb 2011 00:50:08 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 15 Feb 2011 00:50:08 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Tue, 15 Feb 2011 00:50:08 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #210: make check and install fail on Solaris
	(OpenIndiana x86)
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/210#comment:1
Message-ID: <056.5c1bf51456a86cabf9b082c564cf0aae@libssh2.stuge.se>
References: <041.9be3250759a64acfab2d0aafd3ff2a89@libssh2.stuge.se>
X-Trac-Ticket-ID: 210
In-Reply-To: <041.9be3250759a64acfab2d0aafd3ff2a89@libssh2.stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#210: make check and install fail on Solaris (OpenIndiana x86)
--------------------------+-------------------------------------------------
  Reporter:  dzejk        |        Owner:       
      Type:  build error  |       Status:  new  
  Priority:  normal       |    Milestone:  1.2.7
 Component:  tests        |      Version:  1.2.7
Resolution:               |     Keywords:       
    Blocks:               |   Blocked By:       
--------------------------+-------------------------------------------------

Comment (by stuge):

 Thanks for the report. There seems to be two issues:

 * make check-TESTS fails
 * make install fails

 Please attach config.log, Makefile.in and Makefile to the ticket so that
 we can investigate the problems further. Thank you!

-- 
Ticket URL: <http://trac.libssh2.org/ticket/210#comment:1>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Feb 15 03:48:25 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p1F2m8cQ011128;
	Tue, 15 Feb 2011 03:48:23 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p1F2m7Zx011121
	for <libssh2-devel@cool.haxx.se>; Tue, 15 Feb 2011 03:48:07 +0100
Received: (qmail 13740 invoked from network); 15 Feb 2011 02:48:00 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 15 Feb 2011 02:48:00 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Tue, 15 Feb 2011 02:48:00 -0000
X-URL: http://trac.libssh2.org/
Subject: [libssh2] #211: size mismatch between struct transportpacket fields
	causes libssh2 to get stuck
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/211
Message-ID: <108.62cba77b47352402c1cd0687daecf8b2@libssh2.stuge.se>
X-Trac-Ticket-ID: 211
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#211: size mismatch between struct transportpacket fields causes libssh2 to get
stuck
---------------------------------------------------------------------------------------+
  Reporter:  www.google.com/accounts/o8/id?id=aitoawlhggg_yplkl7grwwpbbum-omtqud4rmna  |       Owner:       
      Type:  defect                                                                    |      Status:  new  
  Priority:  normal                                                                    |   Milestone:  1.2.8
 Component:  protocol                                                                  |     Version:  1.2.7
  Keywords:                                                                            |      Blocks:       
Blocked By:                                                                            |  
---------------------------------------------------------------------------------------+
 transportpacket->packet_length is of type uint32_t
 transportpacket->total_num  is of type int (32 bit in most architectures).
 In libssh2_tarnsport_read (src/transport.c) on line 454 total_num is
 computed as
 p->total_num = p->packet_length - 1 + (encrypted ?
 session->remote.mac->mac_len : 0);

 In this case if packet_length is greater than (2 pow 30) we get a
 total_num value that is -ve. In this case libssh2 gets stuck in a infinite
 do {} while loop inside libssh2_transport_read.
 I understand from definition of LIBSSH2_PACKET_MAXPAYLOAD and the comment
 right after the total_num calculation that maximum uncompressed payload
 should never be greater than 40000, so its likely that what we are getting
 from the other side here has a bogus packet length (in the particular case
 it was 3359664964). However with the type/size mismatch we bypass the
 check on line 466 in src/trasport.c i.e.
   if (p->total_num > LIBSSH2_PACKET_MAXPAYLOAD) {
     return LIBSSH2_ERROR_OUT_OF_BOUNDARY;
   }
 Subsequently we get stuck in the infinite do {}while loop. Suggested
 solution, define both packet_length and total_num to be of type uint32_t.

-- 
Ticket URL: <http://trac.libssh2.org/ticket/211>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Feb 15 14:24:08 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p1FDNkpj028472;
	Tue, 15 Feb 2011 14:24:03 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p1FDNiXM028437
	for <libssh2-devel@cool.haxx.se>; Tue, 15 Feb 2011 14:23:44 +0100
Received: (qmail 16643 invoked from network); 15 Feb 2011 13:23:42 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 15 Feb 2011 13:23:42 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Tue, 15 Feb 2011 13:23:42 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #210: make check and install fail on Solaris
	(OpenIndiana x86)
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/210#comment:2
Message-ID: <056.c9848a33353e1e3bc4638de5b4607b99@libssh2.stuge.se>
References: <041.9be3250759a64acfab2d0aafd3ff2a89@libssh2.stuge.se>
X-Trac-Ticket-ID: 210
In-Reply-To: <041.9be3250759a64acfab2d0aafd3ff2a89@libssh2.stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#210: make check and install fail on Solaris (OpenIndiana x86)
--------------------------+-------------------------------------------------
  Reporter:  dzejk        |        Owner:       
      Type:  build error  |       Status:  new  
  Priority:  normal       |    Milestone:  1.2.7
 Component:  tests        |      Version:  1.2.7
Resolution:               |     Keywords:       
    Blocks:               |   Blocked By:       
--------------------------+-------------------------------------------------

Comment (by dzejk):

 Please find attached the requested files.

 BTW, only GNU development tools (gcc, GNU make etc.) contained in SUNWgcc
 are installed. I guess there is no other make installed:

 $ find / -name "make" -print 2>/dev/null
 /usr/share/lib/make
 /usr/ccs/bin/make
 /usr/bin/make
 /usr/gnu/bin/make

-- 
Ticket URL: <http://trac.libssh2.org/ticket/210#comment:2>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Feb 15 18:06:42 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p1FH6O0Y030687;
	Tue, 15 Feb 2011 18:06:39 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p1FH6Nur030680
	for <libssh2-devel@cool.haxx.se>; Tue, 15 Feb 2011 18:06:23 +0100
Received: (qmail 22190 invoked from network); 15 Feb 2011 17:06:20 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 15 Feb 2011 17:06:20 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Tue, 15 Feb 2011 17:06:20 -0000
X-URL: http://trac.libssh2.org/
Subject: [libssh2] #212: Win32 access violation reading beyond module's
	executable address space
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/212
Message-ID: <085.75fcd2f2729a1c4fe91d486bf364da18@libssh2.stuge.se>
X-Trac-Ticket-ID: 212
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#212: Win32 access violation reading beyond module's executable address space
----------------------------------------------------------------+-----------
  Reporter:  me.yahoo.com/a/zb4rfgwuv_ft.mggqltssk.ndw--#37f15  |       Owner:       
      Type:  defect                                             |      Status:  new  
  Priority:  normal                                             |   Milestone:  1.2.8
 Component:  SFTP                                               |     Version:  1.2.7
  Keywords:                                                     |      Blocks:       
Blocked By:                                                     |  
----------------------------------------------------------------+-----------
 I first discovered this problem last night against 1.2.8-20101213, today's
 snapshot still reports the following error:

 First-chance exception at 0x100400ec (libssh2.dll) in JobController.exe:
 0xC0000005: Access violation reading location 0x100dd000.

 Module libssh2.dll occupies address space 10000000-100DD000.

 Stack trace at point of exception shows:

         libssh2.dll!_SHA1_Init()  + 0x26c bytes
         libssh2.dll!_SHA1_Update()  + 0xc8 bytes
         libssh2.dll!_HMAC_CTX_set_flags()  + 0x67 bytes
         libssh2.dll!_EVP_DigestUpdate()  + 0x14 bytes
         libssh2.dll!_RAND_SSLeay()  + 0x5a6 bytes
         libssh2.dll!_RAND_bytes()  + 0x52 bytes
         libssh2.dll!_libssh2_channel_write()  Line 2066 + 0x2a bytes
         libssh2.dll!sftp_write()  Line 1619 + 0x20 bytes
         libssh2.dll!libssh2_sftp_write()  Line 1721 + 0x11 bytes

 Line 2066 for _libssh2_channel_write reads:

     if (channel->write_state == libssh2_NB_state_created) {
         rc = _libssh2_transport_send(session, channel->write_packet,
                                      channel->write_packet_len,
                                      buf, channel->write_bufwrite);
         if (rc == LIBSSH2_ERROR_EAGAIN) {
             return _libssh2_error(session, rc,
                                   "Unable to send channel data");
         }

 The program is a multi-threaded 32bit .NET application using a
 classlibrary to wrap libssh2 in a managed layer. Until now this has worked
 perfectly every time for me.  No customisations have been made to the
 library.  It performs several SFTP fetches to retrieve zipped data,
 processes them and stores the results locally.  It then transmits those
 results back using SFTP to multiple locations.

 The error appears on both w2k8 64bit and xp/sp3 32bit.  Recompiled zlib to
 1.2.5 and openssl to 0.9.8r just in case, no effect.  Tested against 3
 different servers - CompleteFTP and freesshd local to the machine and
 linux openssh on a virtual machine; all 3 exhibit the same problem at
 approximately the same point.  None of the servers report anything out of
 the ordinary in their logs.

 The exact same code works correctly if I limit the threading to only one
 transfer at once, even though though each transfer occurs in it's own
 thread with the session created and accessed from only that one thread.

 I hope to recreate this using a much-simplified multi-threaded C program
 and attach the program to this ticket, but if there's anything I can
 provide before then, please let me know.

-- 
Ticket URL: <http://trac.libssh2.org/ticket/212>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Feb 15 19:35:52 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p1FIZb8j012353;
	Tue, 15 Feb 2011 19:35:50 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p1FIZaJ3012340
	for <libssh2-devel@cool.haxx.se>; Tue, 15 Feb 2011 19:35:36 +0100
Received: (qmail 22831 invoked from network); 15 Feb 2011 18:35:33 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 15 Feb 2011 18:35:33 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Tue, 15 Feb 2011 18:35:33 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #212: Win32 access violation reading beyond module's
	executable address space
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/212#comment:1
Message-ID: <100.4f66b544b1ba238b6bf90ba73eca6a82@libssh2.stuge.se>
References: <085.75fcd2f2729a1c4fe91d486bf364da18@libssh2.stuge.se>
X-Trac-Ticket-ID: 212
In-Reply-To: <085.75fcd2f2729a1c4fe91d486bf364da18@libssh2.stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#212: Win32 access violation reading beyond module's executable address space
----------------------------------------------------------------+-----------
  Reporter:  me.yahoo.com/a/zb4rfgwuv_ft.mggqltssk.ndw--#37f15  |        Owner:  bagder  
      Type:  defect                                             |       Status:  assigned
  Priority:  normal                                             |    Milestone:  1.2.8   
 Component:  SFTP                                               |      Version:  1.2.7   
Resolution:                                                     |     Keywords:          
    Blocks:                                                     |   Blocked By:          
----------------------------------------------------------------+-----------
Changes (by bagder):

  * owner:  => bagder
  * status:  new => assigned


Comment:

 Do you have the openssl mutex callbacks set?

-- 
Ticket URL: <http://trac.libssh2.org/ticket/212#comment:1>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Feb 15 19:45:10 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p1FIj7Ds021127;
	Tue, 15 Feb 2011 19:45:10 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p1FIj6nK020997
	for <libssh2-devel@cool.haxx.se>; Tue, 15 Feb 2011 19:45:06 +0100
Received: (qmail 27381 invoked from network); 15 Feb 2011 18:45:03 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 15 Feb 2011 18:45:03 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Tue, 15 Feb 2011 18:45:03 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #211: size mismatch between struct transportpacket
	fields causes libssh2 to get stuck
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/211#comment:1
Message-ID: <123.dbffb977809068731e7870c67f8e7795@libssh2.stuge.se>
References: <108.62cba77b47352402c1cd0687daecf8b2@libssh2.stuge.se>
X-Trac-Ticket-ID: 211
In-Reply-To: <108.62cba77b47352402c1cd0687daecf8b2@libssh2.stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#211: size mismatch between struct transportpacket fields causes libssh2 to get
stuck
---------------------------------------------------------------------------------------+
  Reporter:  www.google.com/accounts/o8/id?id=aitoawlhggg_yplkl7grwwpbbum-omtqud4rmna  |        Owner:        
      Type:  defect                                                                    |       Status:  closed
  Priority:  normal                                                                    |    Milestone:  1.2.8 
 Component:  protocol                                                                  |      Version:  1.2.7 
Resolution:  fixed                                                                     |     Keywords:        
    Blocks:                                                                            |   Blocked By:        
---------------------------------------------------------------------------------------+
Changes (by bagder):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 Please try a current snapshot/git version, as we've already changed the
 code in this section and 'total_num' is of size_t type now.

-- 
Ticket URL: <http://trac.libssh2.org/ticket/211#comment:1>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Feb 15 21:51:43 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p1FKpLgW005068;
	Tue, 15 Feb 2011 21:51:38 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p1FKpKPJ005062
	for <libssh2-devel@cool.haxx.se>; Tue, 15 Feb 2011 21:51:20 +0100
Received: (qmail 14354 invoked from network); 15 Feb 2011 20:51:16 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 15 Feb 2011 20:51:16 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Tue, 15 Feb 2011 20:51:16 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #210: make check and install fail on Solaris
	(OpenIndiana x86)
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/210#comment:3
Message-ID: <056.b5a5e3c0e7de30e7d93312014ba5d943@libssh2.stuge.se>
References: <041.9be3250759a64acfab2d0aafd3ff2a89@libssh2.stuge.se>
X-Trac-Ticket-ID: 210
In-Reply-To: <041.9be3250759a64acfab2d0aafd3ff2a89@libssh2.stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#210: make check and install fail on Solaris (OpenIndiana x86)
--------------------------+-------------------------------------------------
  Reporter:  dzejk        |        Owner:       
      Type:  build error  |       Status:  new  
  Priority:  normal       |    Milestone:  1.2.7
 Component:  tests        |      Version:  1.2.7
Resolution:               |     Keywords:       
    Blocks:               |   Blocked By:       
--------------------------+-------------------------------------------------

Comment (by danf):

 The build and link apparently succeeded, but the test application can't
 run because the library libssl.so.1.0.0 can't be found at run time. I'm
 not sure how exactly this is fixed under Solaris, but on Linux it would
 involve setting the LD_LIBRARY_PATH environment variable, or editing the
 /etc/ld.so.conf file to point the dynamic linker to the location of the
 right libssl. Alternately, you could pass in linker flags to hard-code the
 path into the apps. Using the GNU toolchain, this would involve something
 like configuring with LDFLAGS='-Wl,-rpath -Wl,INST_DIR/lib'

-- 
Ticket URL: <http://trac.libssh2.org/ticket/210#comment:3>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Wed Feb 16 04:16:33 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p1G3GFFA002233;
	Wed, 16 Feb 2011 04:16:30 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id p1G3GD5B002227
	for <libssh2-devel@cool.haxx.se>; Wed, 16 Feb 2011 04:16:13 +0100
Received: (qmail 18879 invoked by uid 501); 16 Feb 2011 03:16:12 -0000
Message-ID: <20110216031612.18878.qmail@stuge.se>
Date: Wed, 16 Feb 2011 04:16:12 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: bug in sftp_write_sliding.c
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <AANLkTinGKvs328FMgYN8v-JQpcTSOiK34ZcFALpEHqwL@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <AANLkTinGKvs328FMgYN8v-JQpcTSOiK34ZcFALpEHqwL@mail.gmail.com>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hello,

zl liu wrote:
> *if* (nread <= 0) {
> 
>             */* end of file */ *
> 
> **/* Only indicate the ending of the read operation not the send operation, so
> 
>    the speed is not exact*/
> 
>             *break*;
>      }

I'm afraid it is impossible for me to understand your email.

Please explain the problem that you discovered, or even better send a
patch with a fix. Ideally use git to generate a patch on top of
current libssh2.git. Thank you!


//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Wed Feb 16 04:41:15 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p1G3f8eY013321;
	Wed, 16 Feb 2011 04:41:14 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p1G3f7cP013181
	for <libssh2-devel@cool.haxx.se>; Wed, 16 Feb 2011 04:41:07 +0100
Received: (qmail 7882 invoked from network); 16 Feb 2011 03:41:06 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 16 Feb 2011 03:41:06 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Wed, 16 Feb 2011 03:41:06 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #186: libssh gets stuck at
	kex_method_diffie_hellman_groupGP_sha1_key_exchange. CPU
	utilization goes upto 100%
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/186#comment:5
Message-ID: <123.ceb832ec4c8fd2d7c056d4c20b29bbb8@libssh2.stuge.se>
References: <108.a5a9892915fbecf282faa78e591a6c63@libssh2.stuge.se>
X-Trac-Ticket-ID: 186
In-Reply-To: <108.a5a9892915fbecf282faa78e591a6c63@libssh2.stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#186: libssh gets stuck at kex_method_diffie_hellman_groupGP_sha1_key_exchange.
CPU utilization goes upto 100%
---------------------------------------------------------------------------------------+
  Reporter:  www.google.com/accounts/o8/id?id=aitoawlhggg_yplkl7grwwpbbum-omtqud4rmna  |        Owner:  bagder  
      Type:  defect                                                                    |       Status:  assigned
  Priority:  normal                                                                    |    Milestone:  1.2.8   
 Component:  crypto                                                                    |      Version:  1.2.2   
Resolution:                                                                            |     Keywords:          
    Blocks:                                                                            |   Blocked By:          
---------------------------------------------------------------------------------------+

Comment (by www.google.com/accounts/o8/id?id=aitoawlhggg_yplkl7grwwpbbum-omtqud4rmna):

 Replying to [comment:4 stuge]:
 My apologies for the late reply.
 > Replying to [comment:3 www.google.com/accounts/o8/id?id
 =aitoawlhggg_yplkl7grwwpbbum-omtqud4rmna]:
 > > It gets stuck in the gcrypt's , gcry_mpi_copy () function, with the
 cpu utilization going to 100% and staying that way till we terminate the
 process.
 >
 > Are you positive that it is really stuck inside the libgcrypt function,
 and that the problem is not that the function is called over and over?
 >
 Yes, please see below
 > Can you work with gdb when it gets stuck? Step through? What does it
 actually do in that function? Also, it would be helpful to build a
 libgcrypt which includes debugging symbols.
 >
 I did this and now the backtrace is
 (gdb) bt
 #0  gcry_mpi_powm (res=0x14ba5d10, base=<value optimized out>, expo=<value
 optimized out>, mod=<value optimized out>)
     at mpi-pow.c:241
 #1  0x00007f4a30c8eb77 in
 kex_method_diffie_hellman_groupGP_sha1_key_exchange (session=0x1473b040,
 g=0x137d1050,
     p=0x137d31c0, group_order=129, packet_type_init=32 ' ',
 packet_type_reply=33 '!', midhash=0x14156241 "",
     midhash_len=138, exchange_state=0x1473f440) at kex.c:108
 #2  0x00007f4a30c9033c in
 kex_method_diffie_hellman_group_exchange_sha1_key_exchange
 (session=0x1473b040,
     key_state=0x1473f428) at kex.c:881
 #3  0x00007f4a30c90fb0 in libssh2_kex_exchange (session=0x1473b040,
 reexchange=<value optimized out>, key_state=0x1473f410)
     at kex.c:1761
 #4  0x00007f4a30c98b7e in libssh2_session_startup (session=0x1473b040,
 sock=18) at session.c:594
 #5  0x00000000005a780d in SSHSession::issueSSHLibCmd ()
 #6  0x00000000005a8315 in SSHSession::issueEagainLibCmds ()
 #7  0x00000000005a891c in SSHSession::fdWriteReady ()
 #8  0x00000000009df413 in Scheduler::run ()
 #9  0x0000000000651434 in main ()

 I can further confirm that its spinning in a loop inside gcry_mpi_powm. I
 set a breakpoint in libssh2 code just after this offending call. Even
 after a very long time control does not return there, so
 (gdb) b kex.c:113
 Note: breakpoint 11 also set at pc 0x7f4a30c8eb77.
 Breakpoint 12 at 0x7f4a30c8eb77: file kex.c, line 113.
 (gdb) c
 Continuing.

 The breakpoint never gets hit.

 > If it really does get stuck inside libgcrypt then maybe the problem
 isn't actually with libssh2. (Though it could also be a problem in libssh2
 that gives libgcrypt bogus data and causes it to run off and do something
 silly.)

 Is there a way to find out which case this maybe. I can possibly
 dissassmble the code and tell you the values of the arguements (which got
 optimized out to be passed in registers) passed to the gcrypt function
 (although I guess those could have been smashed as well, libgcrypt is
 relying on a ton of handwritten assembly code).

 Thanks for your help.
 Jasmeet Bagga

-- 
Ticket URL: <http://trac.libssh2.org/ticket/186#comment:5>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Wed Feb 16 04:51:14 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p1G3p9Kv008457;
	Wed, 16 Feb 2011 04:51:13 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p1G3p8vC008441
	for <libssh2-devel@cool.haxx.se>; Wed, 16 Feb 2011 04:51:08 +0100
Received: (qmail 8596 invoked from network); 16 Feb 2011 03:44:26 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 16 Feb 2011 03:44:26 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Wed, 16 Feb 2011 03:44:26 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #186: libssh gets stuck at
	kex_method_diffie_hellman_groupGP_sha1_key_exchange. CPU
	utilization goes upto 100%
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/186#comment:6
Message-ID: <123.e9d16da680fafbaac79c650d68eba1f7@libssh2.stuge.se>
References: <108.a5a9892915fbecf282faa78e591a6c63@libssh2.stuge.se>
X-Trac-Ticket-ID: 186
In-Reply-To: <108.a5a9892915fbecf282faa78e591a6c63@libssh2.stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#186: libssh gets stuck at kex_method_diffie_hellman_groupGP_sha1_key_exchange.
CPU utilization goes upto 100%
---------------------------------------------------------------------------------------+
  Reporter:  www.google.com/accounts/o8/id?id=aitoawlhggg_yplkl7grwwpbbum-omtqud4rmna  |        Owner:  bagder  
      Type:  defect                                                                    |       Status:  assigned
  Priority:  normal                                                                    |    Milestone:  1.2.8   
 Component:  crypto                                                                    |      Version:  1.2.2   
Resolution:                                                                            |     Keywords:          
    Blocks:                                                                            |   Blocked By:          
---------------------------------------------------------------------------------------+

Comment (by www.google.com/accounts/o8/id?id=aitoawlhggg_yplkl7grwwpbbum-omtqud4rmna):

 Also, on a related note, do you recommend switching to openssl ? I tried
 that and saw the process did not get stuck. Just wanted to know what your
 recommendation would be in regards to linking libssh2 with openssl vs
 libgcrypt.

 Thanks,
 Jasmeet Bagga

-- 
Ticket URL: <http://trac.libssh2.org/ticket/186#comment:6>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Wed Feb 16 13:59:41 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1GCx88k018771;
	Wed, 16 Feb 2011 13:59:36 +0100
Received: from giant.haxx.se (dast@giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1GCx7mZ018763
	for <libssh2-devel@cool.haxx.se>; Wed, 16 Feb 2011 13:59:07 +0100
Date: Wed, 16 Feb 2011 13:59:07 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: [PATCH] do decompression only if needed
In-Reply-To: <AANLkTinDo9qRGyXzQSOhDSf+7jGHFvEv683X_v4gFzF1@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1102161358380.18583@tvnag.unkk.fr>
References: <AANLkTinDo9qRGyXzQSOhDSf+7jGHFvEv683X_v4gFzF1@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 16 Feb 2011 13:59:41 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Wed, 16 Feb 2011 13:59:07 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Wed, 26 Jan 2011, Alfred Gebert wrote:

> The buffer for the decompression (remote.comp_abstract) is initialised in 
> time when it is needed. With this fix decompression is disabled when the 
> buffer (remote.comp_abstract) is not initialised.
>
> Bug: http://trac.libssh2.org/ticket/200

Thanks, your patch was applied and pushed right now! commit ad88325b3fb617

-- 

  / daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Wed Feb 16 13:59:50 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1GCxni5019057;
	Wed, 16 Feb 2011 13:59:49 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1GCxlfM019045
	for <libssh2-devel@cool.haxx.se>; Wed, 16 Feb 2011 13:59:47 +0100
Received: (qmail 23319 invoked from network); 16 Feb 2011 12:59:45 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 16 Feb 2011 12:59:45 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Wed, 16 Feb 2011 12:59:45 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #200: Compression not enabled correctly
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/200#comment:1
Message-ID: <060.662487f6ce599ed941f8c171bddc8c7b@libssh2.stuge.se>
References: <045.9239c395ed7185ad408d27b835794318@libssh2.stuge.se>
X-Trac-Ticket-ID: 200
In-Reply-To: <045.9239c395ed7185ad408d27b835794318@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 16 Feb 2011 13:59:50 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Wed, 16 Feb 2011 13:59:48 +0100 (CET)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p1GCxlfM019045
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#200: Compression not enabled correctly
------------------------+---------------------------------------------------
  Reporter:  riordanmr  |        Owner:        
      Type:  defect     |       Status:  closed
  Priority:  normal     |    Milestone:  1.2.8 
 Component:  protocol   |      Version:  1.2.7 
Resolution:  fixed      |     Keywords:        
    Blocks:             |   Blocked By:        
------------------------+---------------------------------------------------
Changes (by bagder):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 Fixed in commit ad88325b3fb617, just pushed to git.

-- 
Ticket URL: <http://trac.libssh2.org/ticket/200#comment:1>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Wed Feb 16 14:01:32 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1GD1UEW021605;
	Wed, 16 Feb 2011 14:01:31 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1GD1TZd021580
	for <libssh2-devel@cool.haxx.se>; Wed, 16 Feb 2011 14:01:29 +0100
Received: (qmail 23845 invoked from network); 16 Feb 2011 13:01:27 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 16 Feb 2011 13:01:27 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Wed, 16 Feb 2011 13:01:27 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #207: libssh2 (v1.2.1) crashes in
	libssh2_channel_read_ex due to invalid memory write
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/207#comment:4
Message-ID: <123.4e9569dde42f91449c0339b06b565b1f@libssh2.stuge.se>
References: <108.1565998d459f8da1e1ca60375af1e978@libssh2.stuge.se>
X-Trac-Ticket-ID: 207
In-Reply-To: <108.1565998d459f8da1e1ca60375af1e978@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 16 Feb 2011 14:01:32 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Wed, 16 Feb 2011 14:01:29 +0100 (CET)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p1GD1TZd021580
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#207: libssh2 (v1.2.1) crashes in libssh2_channel_read_ex due to invalid memory
write
---------------------------------------------------------------------------------------+
  Reporter:  www.google.com/accounts/o8/id?id=aitoawmdz8rvnouurvo7z17gt8ll4pj4-xvsgja  |        Owner:  bagder
      Type:  defect                                                                    |       Status:  closed
  Priority:  normal                                                                    |    Milestone:  1.2.8 
 Component:  crypto                                                                    |      Version:  1.2.1 
Resolution:  outdated                                                                  |     Keywords:        
    Blocks:                                                                            |   Blocked By:        
---------------------------------------------------------------------------------------+
Changes (by bagder):

  * status:  assigned => closed
  * resolution:  => outdated


-- 
Ticket URL: <http://trac.libssh2.org/ticket/207#comment:4>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Wed Feb 16 22:58:58 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1GLwdNa031478;
	Wed, 16 Feb 2011 22:58:55 +0100
Received: from mail.icesoft.ro (mail.icesoft.ro [89.42.24.215])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1GLwbEP031464
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 16 Feb 2011 22:58:38 +0100
Received: from [192.168.0.100] (unknown [89.114.234.9])
	by mail.icesoft.ro (Postfix) with ESMTP id 24967244018
	for <libssh2-devel@cool.haxx.se>; Wed, 16 Feb 2011 23:58:34 +0200 (EET)
From: Serghei Amelian <serghei.amelian@gmail.com>
To: libssh2-devel@cool.haxx.se
Subject: libssh2_sftp_fstat_ex(): getting user and group
Date: Wed, 16 Feb 2011 23:58:43 +0200
User-Agent: KMail/1.9.10 (enterprise35 0.20100827.1168748)
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <201102162358.43784.serghei.amelian@gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 16 Feb 2011 22:58:57 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Wed, 16 Feb 2011 22:58:38 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hello,

Is there any way to find the user and a group? With libssh2_sftp_fstat_ex() I 
can only read uid and gid. With libssh2_sftp_opendir() I can use "longentry", 
but i want to use libssh2_sftp_fstat_ex() as well.

Thank you.

-- 
Serghei
Trinity Desktop Environment
http://trinity.pearsoncomputing.net/
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Wed Feb 16 23:14:42 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1GM3Reg003620;
	Wed, 16 Feb 2011 23:03:30 +0100
Received: from giant.haxx.se (dast@giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1GM3PgG003584
	for <libssh2-devel@cool.haxx.se>; Wed, 16 Feb 2011 23:03:25 +0100
Date: Wed, 16 Feb 2011 23:03:25 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: libssh2_sftp_fstat_ex(): getting user and group
In-Reply-To: <201102162358.43784.serghei.amelian@gmail.com>
Message-ID: <alpine.DEB.2.00.1102162301500.3727@tvnag.unkk.fr>
References: <201102162358.43784.serghei.amelian@gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 16 Feb 2011 23:03:30 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Wed, 16 Feb 2011 23:03:25 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Wed, 16 Feb 2011, Serghei Amelian wrote:

> Is there any way to find the user and a group? With libssh2_sftp_fstat_ex() 
> I can only read uid and gid. With libssh2_sftp_opendir() I can use 
> "longentry", but i want to use libssh2_sftp_fstat_ex() as well.

No, it is not possible.

libssh2 implements SFTP version 3 and it doesn't provide that information. If 
libssh2 would implement a later SFTP version and the server you're 
communicating with also does, then it would be possible... I believe for 
example OpenSSH also only implement SFTP version 3.

See http://www.greenend.org.uk/rjk/2007/sftpversions.html for a great overview 
of SFTP differences.

-- 

  / daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Sat Feb 19 22:45:26 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1JLj16L028578;
	Sat, 19 Feb 2011 22:45:21 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1JLixX8028533
	for <libssh2-devel@cool.haxx.se>; Sat, 19 Feb 2011 22:44:59 +0100
Received: (qmail 22507 invoked from network); 19 Feb 2011 21:44:54 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 19 Feb 2011 21:44:54 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Sat, 19 Feb 2011 21:44:54 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #204: Enhance authentication to return partial
	success codes
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/204#comment:3
Message-ID: <060.18baa89440e7ce03b18546f2a0d50876@libssh2.stuge.se>
References: <045.73f5346bcf876dd86404e34a72fb003e@libssh2.stuge.se>
X-Trac-Ticket-ID: 204
In-Reply-To: <045.73f5346bcf876dd86404e34a72fb003e@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Sat, 19 Feb 2011 22:45:26 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Sat, 19 Feb 2011 22:44:59 +0100 (CET)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p1JLixX8028533
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#204: Enhance authentication to return partial success codes
--------------------------+-------------------------------------------------
  Reporter:  riordanmr    |        Owner:  riordanmr     
      Type:  enhancement  |       Status:  assigned      
  Priority:  normal       |    Milestone:  1.2.8         
 Component:  API          |      Version:  1.2.7         
Resolution:               |     Keywords:  authentication
    Blocks:               |   Blocked By:                
--------------------------+-------------------------------------------------

Comment (by sob):

 There's multiple authentication methods patch for OpenSSH:

 https://bugzilla.mindrot.org/show_bug.cgi?id=983

-- 
Ticket URL: <http://trac.libssh2.org/ticket/204#comment:3>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Mon Feb 21 16:03:45 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (list@localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1LF3MVq024063;
	Mon, 21 Feb 2011 16:03:39 +0100
Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com
	[209.85.210.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1LF3JJb023874
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Mon, 21 Feb 2011 16:03:20 +0100
Received: by pzk32 with SMTP id 32so192598pzk.41
	for <libssh2-devel@cool.haxx.se>; Mon, 21 Feb 2011 07:03:11 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:date:message-id:subject:from:to
	:content-type; bh=ONORWum803R3agiSNGEUdTbJ4M8cMu8MeGVuvOyOAFc=;
	b=sYjD+H3PhWeGCXpqfJls/gWD5eHEWg9avH55R0Z/0tGLUj1yuvyVkx0Y+aCP6jRx9S
	zYyjoG0UlHW/sacg1OItCdF/yVPa3ESWJQAZxpQjF+fsveHkVyBstOSJlkg5BhYhm0Jg
	HgpEB/rMko2yDRf+03tSpG9SkMe6iT2zPwBss=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=RMgmq3G5odQFMNU9QMhAL6+H6uWfseSuzObDbvnT24/nl56W5sv3lgr/XxzVM4G8P9
	tfGuyjQqzqBlSxTQ9GWvN6b5amR4WOqs3nhiDA/RJNEld17VWXe0z0L/2M8GHO3hZSW8
	FsdiLc1sTA8WjtZAMoqrnJe0uaJRgq2co96CY=
MIME-Version: 1.0
Received: by 10.143.178.10 with SMTP id f10mr1263355wfp.267.1298300591436;
	Mon, 21 Feb 2011 07:03:11 -0800 (PST)
Received: by 10.142.13.10 with HTTP; Mon, 21 Feb 2011 07:03:11 -0800 (PST)
Date: Mon, 21 Feb 2011 16:03:11 +0100
Message-ID: <AANLkTinjM64VPmM2yUaFKarU06DNRVAca=oNtP4K4jq=@mail.gmail.com>
Subject: problem with big data packages using libssh2_channel_read
From: Mateusz Pilski <mpilski@gmail.com>
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Mon, 21 Feb 2011 16:03:45 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Mon, 21 Feb 2011 16:03:21 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1933906715=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============1933906715==
Content-Type: multipart/alternative; boundary=000e0cd5ccba90739e049ccc2958

--000e0cd5ccba90739e049ccc2958
Content-Type: text/plain; charset=ISO-8859-1

Hello there
I'm using libssh2 library to produce ssh client witch is designed for my
clients needs. So far everything was working well, but i discovered that the
program hangs for few seconds on large data packages. For example if in my
program i will send command
cat larg_file.dat
program hangs for few seconds, then it spit out data of maxbuffer size (in
code:HALFBUFFSIZE)  then again hangs for few seconds and so on. I'm using
libssh2_channel_read as follows (this is simplified code):

do
{
       libssh2_channel_flush_ex(channel,LIBSSH2_CHANNEL_FLUSH_ALL);
        /*reading*/

        for(i=0;i<BUFFSIZE;i++)schelout[i]=0;
        readlen=libssh2_channel_read(channel,schelout,HALFBUFFSIZE);

if(readlen>0)
{

            if(strlen(schelout)>0)
            printf("%s",schelout);
            fflush(stdout);

}
        c[0]=-1;
        /*writing*/

        mygetch(c); /*this is my function for geting character from keybord
in general it is getc with nonblocking*/

        if(c[0]!=-1)
        {
        libssh2_channel_write(channel,c,strlen(c));
        libssh2_channel_flush(channel);

        }
}while(libssh2_channel_eof(channel)!=1);

looking forward to hearing from you
Mateusz Pilski
p.s. Sorry for my "not ideal" english :)

--000e0cd5ccba90739e049ccc2958
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello there<br>I&#39;m using libssh2 library to produce ssh client witch is=
 designed for my clients needs. So far everything was working well, but i d=
iscovered that the program hangs for few seconds on large data packages. Fo=
r example if in my program i will send command <br>
cat larg_file.dat <br>program hangs for few seconds, then it spit out data =
of maxbuffer size (in code:HALFBUFFSIZE)=A0 then again hangs for few second=
s and so on. I&#39;m using=A0=A0 libssh2_channel_read as follows (this is s=
implified code):<br>
=A0<br>do<br>{<br>=A0=A0 =A0=A0=A0 libssh2_channel_flush_ex(channel,LIBSSH2=
_CHANNEL_FLUSH_ALL);<br>=A0=A0=A0 =A0=A0=A0 /*reading*/<br><br>=A0=A0=A0 =
=A0=A0=A0 for(i=3D0;i&lt;BUFFSIZE;i++)schelout[i]=3D0;<br>=A0=A0=A0 =A0=A0=
=A0 readlen=3Dlibssh2_channel_read(channel,schelout,HALFBUFFSIZE);<br>
<br>if(readlen&gt;0)<br>{<br>=A0=A0=A0 =A0=A0=A0 <br>=A0=A0=A0 =A0=A0=A0 =
=A0=A0=A0 if(strlen(schelout)&gt;0)<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 printf=
(&quot;%s&quot;,schelout);<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 fflush(stdout);=
<br>=A0=A0=A0 =A0=A0=A0 <br>}<br>=A0=A0=A0 =A0=A0=A0 c[0]=3D-1;<br>=A0=A0=
=A0 =A0=A0=A0 /*writing*/<br>
=A0=A0=A0 =A0=A0=A0 <br>=A0=A0=A0 =A0=A0=A0 mygetch(c); /*this is my functi=
on for geting character from keybord in general it is getc with nonblocking=
*/<br><br>=A0=A0=A0 =A0=A0=A0 if(c[0]!=3D-1)<br>=A0=A0=A0 =A0=A0=A0 { <br>=
=A0=A0=A0 =A0=A0=A0 libssh2_channel_write(channel,c,strlen(c));<br>
=A0=A0=A0 =A0=A0=A0 libssh2_channel_flush(channel);=A0=A0=A0 =A0=A0=A0 <br>=
=A0=A0=A0 =A0=A0=A0 <br>=A0=A0=A0 =A0=A0=A0 }<br>}while(libssh2_channel_eof=
(channel)!=3D1);<br><br>looking forward to hearing from you<br>Mateusz Pils=
ki<br>p.s. Sorry for my &quot;not ideal&quot; english :)<br>
<br>

--000e0cd5ccba90739e049ccc2958--

--===============1933906715==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

--===============1933906715==--

From libssh2-devel-bounces@cool.haxx.se  Mon Feb 21 23:30:27 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1LMU3XJ001419;
	Mon, 21 Feb 2011 23:30:22 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1LMU1gt001228
	for <libssh2-devel@cool.haxx.se>; Mon, 21 Feb 2011 23:30:01 +0100
Date: Mon, 21 Feb 2011 23:30:01 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: problem with big data packages using libssh2_channel_read
In-Reply-To: <AANLkTinjM64VPmM2yUaFKarU06DNRVAca=oNtP4K4jq=@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1102212325010.25402@tvnag.unkk.fr>
References: <AANLkTinjM64VPmM2yUaFKarU06DNRVAca=oNtP4K4jq=@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Mon, 21 Feb 2011 23:30:27 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Mon, 21 Feb 2011 23:30:01 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Mon, 21 Feb 2011, Mateusz Pilski wrote:

> I'm using libssh2 library to produce ssh client witch is designed for my 
> clients needs. So far everything was working well, but i discovered that the 
> program hangs for few seconds on large data packages.

Using the API in blocking mode, right?

My hunch is that what you're seeing is simply that while receiving a block of 
data over a slow network link, then libssh2 will keep returning EAGAIN 
internally and the blocking API will sit there waiting for a full packet to 
arrive before it returns anyway.

If you really want to avoid that the function blocks for a certain period of 
time at some invokes, I think you should consider the non-blocking approach.

Or do you think it can be something else?

-- 

  / daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Feb 22 16:07:14 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1MF6oCg025441;
	Tue, 22 Feb 2011 16:07:09 +0100
Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com
	[74.125.83.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1MF6kES025393
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 22 Feb 2011 16:06:48 +0100
Received: by pvg11 with SMTP id 11so350267pvg.41
	for <libssh2-devel@cool.haxx.se>; Tue, 22 Feb 2011 07:06:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:content-type;
	bh=OkFrRd3Ne0i6CSSOhToBVHkrfP1iD1FeYu0sivwb7rg=;
	b=Ji4xyV1E6n1CsTrf83IX/jauS8H1BqooAXWr4I2mieMWWkWMaFIqV+U/JRWEhtj49Z
	/mFC2xTdjo7gDkGZ6QBiOijJExthtxILvaI+0hnvByRw6ELKxFTyCKOmoIgDjrC/jZtb
	LR4hDwvDzx7qI2Z5+7/7xdRZr/oiQYMWLNloQ=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type;
	b=gzBgTNN2O6b84oVZ3RXOJh2E5fyUzSHE6AaCUONa19352wanQ+mGdGm50iCyIz8j5y
	Nbc6APdXz0cRbicMS0JVNb4H9WK6a0d8Z5pXW0rPpwChA/jwGcB7Ydzxmaa9cBuK/2gf
	liW12ryk6t00TApwM7gnvyGRpnTPNQVQZkgjA=
MIME-Version: 1.0
Received: by 10.143.20.33 with SMTP id x33mr2313523wfi.210.1298387199909; Tue,
	22 Feb 2011 07:06:39 -0800 (PST)
Received: by 10.142.13.10 with HTTP; Tue, 22 Feb 2011 07:06:39 -0800 (PST)
In-Reply-To: <alpine.DEB.2.00.1102212325010.25402@tvnag.unkk.fr>
References: <AANLkTinjM64VPmM2yUaFKarU06DNRVAca=oNtP4K4jq=@mail.gmail.com>
	<alpine.DEB.2.00.1102212325010.25402@tvnag.unkk.fr>
Date: Tue, 22 Feb 2011 16:06:39 +0100
Message-ID: <AANLkTikK_o5-odavc_DHoEH2ZCPj2zwiv8-nVzRO9kb-@mail.gmail.com>
Subject: Re: problem with big data packages using libssh2_channel_read
From: Mateusz Pilski <mpilski@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 22 Feb 2011 16:07:14 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Tue, 22 Feb 2011 16:06:48 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0223341257=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============0223341257==
Content-Type: multipart/alternative; boundary=00504502cc48d4e09c049ce0534a

--00504502cc48d4e09c049ce0534a
Content-Type: text/plain; charset=ISO-8859-1

Thank you for quick response. Unfortunately this isn't the solution for my
problem because channel is set for nonblocking few lines before code i
pasted using
libssh2_channel_set_blocking(channel, 0);
also there i use function
libssh2_channel_handle_extended_data2(channel,
LIBSSH2_CHANNEL_EXTENDED_DATA_MERGE);
but i don't suppose that it have influence on my problem.

2011/2/21 Daniel Stenberg <daniel@haxx.se>

> On Mon, 21 Feb 2011, Mateusz Pilski wrote:
>
>  I'm using libssh2 library to produce ssh client witch is designed for my
>> clients needs. So far everything was working well, but i discovered that the
>> program hangs for few seconds on large data packages.
>>
>
> Using the API in blocking mode, right?
>
> My hunch is that what you're seeing is simply that while receiving a block
> of data over a slow network link, then libssh2 will keep returning EAGAIN
> internally and the blocking API will sit there waiting for a full packet to
> arrive before it returns anyway.
>
> If you really want to avoid that the function blocks for a certain period
> of time at some invokes, I think you should consider the non-blocking
> approach.
>
> Or do you think it can be something else?
>
> --
>
>  / daniel.haxx.se
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>

--00504502cc48d4e09c049ce0534a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Thank you for quick response. Unfortunately this isn&#39;t the solution for=
 my problem because channel is set for nonblocking few lines before code i =
pasted using<br>libssh2_channel_set_blocking(channel, 0);<br>also there i u=
se function <br>
libssh2_channel_handle_extended_data2(channel, LIBSSH2_CHANNEL_EXTENDED_DAT=
A_MERGE); <br>but i don&#39;t suppose that it have influence on my problem.=
=A0 <br><br><div class=3D"gmail_quote">2011/2/21 Daniel Stenberg <span dir=
=3D"ltr">&lt;<a href=3D"mailto:daniel@haxx.se">daniel@haxx.se</a>&gt;</span=
><br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class=3D"im"=
>On Mon, 21 Feb 2011, Mateusz Pilski wrote:<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I&#39;m using libssh2 library to produce ssh client witch is designed for m=
y clients needs. So far everything was working well, but i discovered that =
the program hangs for few seconds on large data packages.<br>
</blockquote>
<br></div>
Using the API in blocking mode, right?<br>
<br>
My hunch is that what you&#39;re seeing is simply that while receiving a bl=
ock of data over a slow network link, then libssh2 will keep returning EAGA=
IN internally and the blocking API will sit there waiting for a full packet=
 to arrive before it returns anyway.<br>

<br>
If you really want to avoid that the function blocks for a certain period o=
f time at some invokes, I think you should consider the non-blocking approa=
ch.<br>
<br>
Or do you think it can be something else?<br><font color=3D"#888888">
<br>
-- <br>
<br>
=A0/ <a href=3D"http://daniel.haxx.se" target=3D"_blank">daniel.haxx.se</a>=
<br>
_______________________________________________<br>
libssh2-devel <a href=3D"http://cool.haxx.se/cgi-bin/mailman/listinfo/libss=
h2-devel" target=3D"_blank">http://cool.haxx.se/cgi-bin/mailman/listinfo/li=
bssh2-devel</a><br>
</font></blockquote></div><br>

--00504502cc48d4e09c049ce0534a--

--===============0223341257==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

--===============0223341257==--

From libssh2-devel-bounces@cool.haxx.se  Tue Feb 22 16:18:43 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1MFIdCx029613;
	Tue, 22 Feb 2011 16:18:42 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1MFIb84029586
	for <libssh2-devel@cool.haxx.se>; Tue, 22 Feb 2011 16:18:37 +0100
Date: Tue, 22 Feb 2011 16:18:37 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: problem with big data packages using libssh2_channel_read
In-Reply-To: <AANLkTikK_o5-odavc_DHoEH2ZCPj2zwiv8-nVzRO9kb-@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1102221616560.1378@tvnag.unkk.fr>
References: <AANLkTinjM64VPmM2yUaFKarU06DNRVAca=oNtP4K4jq=@mail.gmail.com>
	<alpine.DEB.2.00.1102212325010.25402@tvnag.unkk.fr>
	<AANLkTikK_o5-odavc_DHoEH2ZCPj2zwiv8-nVzRO9kb-@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 22 Feb 2011 16:18:43 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Tue, 22 Feb 2011 16:18:37 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Tue, 22 Feb 2011, Mateusz Pilski wrote:

Please don't top-post, it makes it very hard to follow what's being said!

> Thank you for quick response. Unfortunately this isn't the solution for my 
> problem because channel is set for nonblocking few lines before code i 
> pasted using

Okay, so what version are you using on what operating system?

Have you tried to repeat the problem with a recent snapshot/git version?

> also there i use function libssh2_channel_handle_extended_data2(channel, 
> LIBSSH2_CHANNEL_EXTENDED_DATA_MERGE); but i don't suppose that it have 
> influence on my problem.

Can you help us help you and provide a full example that repeats this problem?

-- 

  / daniel.haxx.se
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Wed Feb 23 14:36:28 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1NDa8JK001301;
	Wed, 23 Feb 2011 14:36:25 +0100
Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com
	[209.85.210.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1NDa30i001222
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 23 Feb 2011 14:36:05 +0100
Received: by pzk32 with SMTP id 32so569711pzk.41
	for <libssh2-devel@cool.haxx.se>; Wed, 23 Feb 2011 05:36:00 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:content-type;
	bh=rV8GIYlg/HwIBNnnWoW7gT5MabdOJFEPoS+qTgetTyA=;
	b=CnHbOHe7kdHCZ12lD1FRLePDBJkQdvmb8ra/Ys/ekBooxNijTcwzYkJkC7CSTkTAy2
	SKSy81XgRgUaA3wg00NyyaDN4bV1Af54J569CF6GpMcTrvlh82U4pGoFZu+FsyPJmieT
	hjhnaBesPxEb9gbVYnHkm6Sk0e4Dslq3NWN2c=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type;
	b=U8Hl5qzgMXNs8EBbp0/wm7Cv+qka0rKTVqu4m6BTduhENdnym8C7W/eEfvX8t3n+7Z
	8sNtgLXRw7GAe+mGrG6hsCJgn7ixfWq3o0PfAUw33BnHp+qArWuph6cbDNzW5AXcOU0l
	Nc8nBCsq+adEZGs6HNbathlTTOT8F83Fnu5v8=
MIME-Version: 1.0
Received: by 10.142.209.10 with SMTP id h10mr570555wfg.96.1298468158738; Wed,
	23 Feb 2011 05:35:58 -0800 (PST)
Received: by 10.142.165.6 with HTTP; Wed, 23 Feb 2011 05:35:58 -0800 (PST)
In-Reply-To: <alpine.DEB.2.00.1102221616560.1378@tvnag.unkk.fr>
References: <AANLkTinjM64VPmM2yUaFKarU06DNRVAca=oNtP4K4jq=@mail.gmail.com>
	<alpine.DEB.2.00.1102212325010.25402@tvnag.unkk.fr>
	<AANLkTikK_o5-odavc_DHoEH2ZCPj2zwiv8-nVzRO9kb-@mail.gmail.com>
	<alpine.DEB.2.00.1102221616560.1378@tvnag.unkk.fr>
Date: Wed, 23 Feb 2011 14:35:58 +0100
Message-ID: <AANLkTi=S6j+i+21U276YRwGD1KELM1Ma6Q_3v_ZyMjQ_@mail.gmail.com>
Subject: Re: problem with big data packages using libssh2_channel_read
From: Mateusz Pilski <mpilski@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 23 Feb 2011 14:36:28 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Wed, 23 Feb 2011 14:36:06 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0923180457=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============0923180457==
Content-Type: multipart/alternative; boundary=000e0cd242c45a937e049cf32d16

--000e0cd242c45a937e049cf32d16
Content-Type: text/plain; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable

2011/2/22 Daniel Stenberg <daniel@haxx.se>

> On Tue, 22 Feb 2011, Mateusz Pilski wrote:
>
> Please don't top-post, it makes it very hard to follow what's being said!

sorry for that.


>
>  Thank you for quick response. Unfortunately this isn't the solution for =
my
>> problem because channel is set for nonblocking few lines before code i
>> pasted using
>>
>
> Okay, so what version are you using on what operating system?
>
> i'm using
system: Debian 2.6.32-28
libssh2 version 1.2.7
and all of this is on quite old and slow machine:
cpu 800 mhz 64 KB cache
memory 256 MB
but still it isn't a piece of junk i remember i've played for example quake
2 on similar machine  and there were no problems at all and i don't think
that sending encrypted package of 4 KB size could be more demanding than
that.
i have made some test on faster machine (cpu 2400 mhz 1024 KB chache) and
everything goes fine there.

Have you tried to repeat the problem with a recent snapshot/git version?
>
> yes, nothing changed.

>
>  also there i use function libssh2_channel_handle_extended_data2(channel,
>> LIBSSH2_CHANNEL_EXTENDED_DATA_MERGE); but i don't suppose that it have
>> influence on my problem.
>>
>
> Can you help us help you and provide a full example that repeats this
> problem?
>
> i post here mostly simplified working code with this error(compile with
-lssh2 -lncurses). Code is quite long but functions connection() and
makeconnection() are just lightly modified code of connection example from
libssh2 site (http://libssh2.org/examples/ssh2.html) so the interesting par=
t
is only function mainloop(). To make connection change first 3 lines of
code. Because i cut most of the code result is litle messy, but what is
important is when you connect and type command "cat largefile.dat" it will
hang just like i described before. Note that if packet will be large but
still smaller than BUFFSIZE (for example if you change BUFFSIZE to 124096
and HALFBUFFSIZE to 62048) all will go well.


#define confighost "127.0.0.1"
#define configusername "login"
#define configpassword "password"
#include <libssh2.h>
#include <ncurses.h>
#include <netinet/in.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>  /* String function definitions */
#include <termios.h> /* POSIX terminal control definitions */

#define BUFFSIZE 4096
#define HALFBUFFSIZE 2048

char pass[64];
int curpos=3D0,comlen=3D0;

static void kbd_callback(const char *name, int name_len,
             const char *instruction, int instruction_len, int num_prompts,
             const LIBSSH2_USERAUTH_KBDINT_PROMPT *prompts,
             LIBSSH2_USERAUTH_KBDINT_RESPONSE *responses,
             void **abstract)
{
    (void)name;
    (void)name_len;
    (void)instruction;
    (void)instruction_len;
    if (num_prompts =3D=3D 1) {
        responses[0].text =3D strdup(pass);
        responses[0].length =3D strlen(pass);
    }
    (void)prompts;
    (void)abstract;
} /* kbd_callback */

int block=3D0,arrow=3D0;
    LIBSSH2_SESSION *session;
    LIBSSH2_CHANNEL *channel;



int connection(int *socke)
{
  unsigned long hostaddr;
    int sock, auth_pw =3D 0;
    struct sockaddr_in sin;
    const char *fingerprint;
    char *userauthlist;
#ifdef WIN32
    WSADATA wsadata;

    WSAStartup(MAKEWORD(2,0), &wsadata);
#endif


hostaddr =3D inet_addr(confighost);

    sock =3D socket(AF_INET, SOCK_STREAM, 0);
#ifndef WIN32

    fcntl(sock, F_SETFL, 0);
#endif
    *socke=3Dsock;

    sin.sin_family =3D AF_INET;
    sin.sin_port =3D htons(22);
    sin.sin_addr.s_addr =3D hostaddr;

    if (connect(sock, (struct sockaddr*)(&sin),
                sizeof(struct sockaddr_in)) !=3D 0) {
        fprintf(stderr, "Nie uda=B3o si=EA nawi=B1za=E6 po=B3=B1czenia z %s=
!\nSprawd=BC
swoje po=B3=B1czenie sieciowe.\nJe=B6li problem b=EAdzie si=EA powtarza=E6 =
 skontaktuj
si=EA z administratorem.\n naci=B6nij enter aby spr=F3bowa=E6 ponownie",con=
fighost);

getchar();


        return -1;
    }

printf("po=B3=B1czenie z serwerem jest aktywne\n");
fflush(stdout);
*socke=3Dsock;
}

int makeconnection(LIBSSH2_SESSION **sesion,LIBSSH2_CHANNEL **chanel,int
*socke)
{
LIBSSH2_CHANNEL *channel;
LIBSSH2_SESSION *session;

const char *keyfile1=3D"~/.ssh/id_rsa.pub";
const char *keyfile2=3D"~/.ssh/id_rsa";

strcpy(pass,configpassword);

  unsigned long hostaddr;
    int sock, auth_pw =3D 0;
    struct sockaddr_in sin;
    const char *fingerprint;
    char *userauthlist;
sock=3D*socke;

    /* Create a session instance and start it up
     * This will trade welcome banners, exchange keys, and setup crypto,
compression, and MAC layers
     */
    session =3D libssh2_session_init();
int ind;
for(ind=3D0;ind<5;ind++)
    if (!libssh2_session_startup(session, sock))break;
 if(ind=3D=3D5)
 {
    if(sock)
{
#ifdef WIN32
    closesocket(sock);
#else
    close(sock);
#endif
}
    connection(&sock);
    for(ind=3D0;ind<5;ind++)
        if (!libssh2_session_startup(session, sock))break;
    if(ind=3D=3D5)
    {

        fprintf(stderr, "Nie uda=B3o si=EA nawi=B1za=E6 sesji SSH\n");

    return-1;
    }
    }
    fingerprint =3D libssh2_hostkey_hash(session, LIBSSH2_HOSTKEY_HASH_MD5)=
;
    /* check what authentication methods are available */
    userauthlist =3D libssh2_userauth_list(session, configusername,
strlen(configusername));
    //printf("Authentication methods: %s\n", userauthlist);
    if (strstr(userauthlist, "password") !=3D NULL) {
        auth_pw |=3D 1;
    }
    if (strstr(userauthlist, "keyboard-interactive") !=3D NULL) {
        auth_pw |=3D 2;
    }
    if (strstr(userauthlist, "publickey") !=3D NULL) {
        auth_pw |=3D 4;
    }


    if (auth_pw & 1) {
        /* We could authenticate via password */
        if (libssh2_userauth_password(session, configusername,
configpassword)) {
            printf("\nNieprawid=B3owy login lub has=B3o!\n");

            return -2; /*goto shutdown;*/
        } else {
 //           printf("\tAuthentication by password succeeded.\n");
        }
    } else if (auth_pw & 2) {
        /* Or via keyboard-interactive */
        if (libssh2_userauth_keyboard_interactive(session, configusername,
&kbd_callback) ) {
            printf("\tAuthentication by keyboard-interactive failed!\n");

            return -2; /*goto shutdown;*/
        } else {
            printf("\tAuthentication by keyboard-interactive succeeded.\n")=
;
        }
    } else if (auth_pw & 4) {
        /* Or by public key */
        if (libssh2_userauth_publickey_fromfile(session, configusername,
keyfile1, keyfile2, configpassword)) {
            printf("\tAuthentication by public key failed!\n");

            return -2; /*goto shutdown;*/
        } else {
            printf("\tAuthentication by public key succeeded.\n");
        }
    } else {
        printf("No supported authentication methods found!\n");

        return -2; /*goto shutdown;*/
    }


   /* Request a shell */
    if (!(channel =3D libssh2_channel_open_session(session))) {
        fprintf(stderr, "Unable to open a session\n");

        return -2; /*goto shutdown;*/
    }

//    libssh2_channel_setenv(channel, "FOO", "bar");

    /*
     * See /etc/termcap for more options
     */
    char *termtype;
    termtype =3D getenv("TERM");

    if (libssh2_channel_request_pty(channel, "vt102")) {
        fprintf(stderr, "Failed requesting pty\n");

        return -3; /*goto skip_shell;*/
    }

    /* Open a SHELL on that pty */
    if (libssh2_channel_shell(channel)) {
        fprintf(stderr, "Unable to request shell on allocated pty\n");

        return -2; /*goto shutdown;*/
    }


*chanel=3Dchannel;
*sesion=3Dsession;
return 1;

}

int mainloop(LIBSSH2_CHANNEL *channel)
{
char schelout[2*BUFFSIZE];
char c[2];
int readlen,flags;

            /*set stdin nonblockign*/
    flags =3D fcntl(0, F_GETFL, 0);
     flags |=3D O_NONBLOCK;
     fcntl(0, F_SETFL, flags);
            /*set ssh channel nonblockign*/
    libssh2_channel_set_blocking(channel, 0);
    libssh2_channel_handle_extended_data2(channel,
LIBSSH2_CHANNEL_EXTENDED_DATA_MERGE);

    /*set getch noecho*/

     struct termios attrs,oldattrs;
       tcgetattr( 0, &attrs );
    tcgetattr( 0, &oldattrs );
     attrs.c_cc[VINTR]    =3D 0;
    attrs.c_cc[VSUSP]    =3D 0;
    tcsetattr( 0, 0, &attrs );

int i=3D0;
initscr();
    while(1) /*main loop*/
    {
        libssh2_channel_flush_ex(channel,LIBSSH2_CHANNEL_FLUSH_ALL);
        /*reading*/
        for(i=3D0;i<BUFFSIZE;i++)schelout[i]=3D0;
        readlen=3Dlibssh2_channel_read(channel,schelout,HALFBUFFSIZE);
        if(readlen>0)
        {
            printf("%s",schelout);
            fflush(stdout);
        }
        /*writing*/
        c[0]=3Dgetch();
        c[1]=3D'\0';
        if(c[0]!=3D-1)
        {
            libssh2_channel_write(channel,c,strlen(c));
            libssh2_channel_flush(channel);
        }
if(libssh2_channel_eof(channel)=3D=3D1)break;
    }

    flags =3D fcntl(0, F_GETFL, 0); /*reseting terminal configuration*/
    flags &=3D ~O_NONBLOCK;
    fcntl(0, F_SETFL, flags);
    tcsetattr( 0, 0, &oldattrs );
return 1;
}

int main(int argc, char* argv[])
{

int sock;
char tekst[128];

session=3DNULL;
channel=3DNULL;
sock=3D0;

if(connection(&sock)=3D=3D-1)
{
exit(1);
}
if (makeconnection(&session,&channel,&sock)=3D=3D1)
{
    system("clear");
    mainloop(channel);
}
else
{
/*else faild to connect*/
    getchar();

}
/*disconnection*/
    if (channel) {
        libssh2_channel_free(channel);
        channel =3D NULL;
    }

if(session)
{
    libssh2_session_disconnect(session, "Normal Shutdown, Thank you for
playing");
    libssh2_session_free(session);
}
if(sock)
{
    close(sock);
}
    return 0;
}

--000e0cd242c45a937e049cf32d16
Content-Type: text/html; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable

<br><div class=3D"gmail_quote">2011/2/22 Daniel Stenberg <span dir=3D"ltr">=
&lt;<a href=3D"mailto:daniel@haxx.se">daniel@haxx.se</a>&gt;</span><br><blo=
ckquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204,=
 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Tue, 22 Feb 2011, Mateusz Pilski wrote:<br>
<br>
Please don&#39;t top-post, it makes it very hard to follow what&#39;s being=
 said!</blockquote><div>sorry for that. <br><br></div><blockquote class=3D"=
gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0p=
t 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class=3D"im"><br>
<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thank you for quick response. Unfortunately this isn&#39;t the solution for=
 my problem because channel is set for nonblocking few lines before code i =
pasted using<br>
</blockquote>
<br></div>
Okay, so what version are you using on what operating system?<br>
<br></blockquote><div>i&#39;m using <br>system: Debian 2.6.32-28<br>libssh2=
 version 1.2.7<br>and all of this is on quite old and slow machine:<br>cpu =
800 mhz 64 KB cache<br>memory 256 MB<br>but
still it isn&#39;t a piece of junk i remember i&#39;ve played for example q=
uake
2 on similar machine=A0 and there were no problems at all and i don&#39;t
think that sending encrypted package of 4 KB size could be more
demanding than that.<br>i have made some test on faster machine (cpu 2400 m=
hz 1024 KB chache) and everything goes fine there.<br><br></div><blockquote=
 class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); =
margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Have you tried to repeat the problem with a recent snapshot/git version?<di=
v class=3D"im"><br></div></blockquote><div>yes, nothing changed. <br></div>=
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class=3D"im">
<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
also there i use function libssh2_channel_handle_extended_data2(channel, LI=
BSSH2_CHANNEL_EXTENDED_DATA_MERGE); but i don&#39;t suppose that it have in=
fluence on my problem.<br>
</blockquote>
<br></div>
Can you help us help you and provide a full example that repeats this probl=
em?<div><div></div><div class=3D"h5"><br>
</div></div></blockquote><div>i post here mostly simplified working code wi=
th this error(compile with -lssh2 -lncurses). Code is quite long but functi=
ons connection() and makeconnection() are just lightly modified code of con=
nection example from libssh2 site (<a href=3D"http://libssh2.org/examples/s=
sh2.html">http://libssh2.org/examples/ssh2.html</a>) so the interesting par=
t is only function mainloop(). To make connection change first 3 lines of c=
ode. Because i cut most of the code result is litle messy, but what is impo=
rtant is when you connect and type command &quot;cat largefile.dat&quot; it=
 will hang just like i described before. Note that if packet will be large =
but still smaller than BUFFSIZE (for example if you change BUFFSIZE to 1240=
96 and HALFBUFFSIZE to 62048) all will go well.<br>
<br><br></div></div>#define confighost &quot;127.0.0.1&quot;<br>#define con=
figusername &quot;login&quot;<br>#define configpassword &quot;password&quot=
;<br>#include &lt;libssh2.h&gt;<br>#include &lt;ncurses.h&gt;<br>#include &=
lt;netinet/in.h&gt;<br>
#include &lt;fcntl.h&gt;<br>#include &lt;stdio.h&gt;<br>#include &lt;string=
.h&gt;=A0 /* String function definitions */<br>#include &lt;termios.h&gt; /=
* POSIX terminal control definitions */<br><br>#define BUFFSIZE 4096<br>#de=
fine HALFBUFFSIZE 2048<br>
<br>char pass[64];=A0=A0 <br>int curpos=3D0,comlen=3D0;<br><br>static void =
kbd_callback(const char *name, int name_len, <br>=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0 const char *instruction, int instruction_len, int num_prompts,=
<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 const LIBSSH2_USERAUTH_KBDINT_PROM=
PT *prompts,<br>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 LIBSSH2_USERAUTH_KBDINT_RESPONSE *resp=
onses,<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 void **abstract)<br>{<br>=A0=
=A0=A0 (void)name;<br>=A0=A0=A0 (void)name_len;<br>=A0=A0=A0 (void)instruct=
ion;<br>=A0=A0=A0 (void)instruction_len;<br>=A0=A0=A0 if (num_prompts =3D=
=3D 1) {<br>
=A0=A0=A0=A0=A0=A0=A0 responses[0].text =3D strdup(pass);<br>=A0=A0=A0=A0=
=A0=A0=A0 responses[0].length =3D strlen(pass);<br>=A0=A0=A0 }<br>=A0=A0=A0=
 (void)prompts;<br>=A0=A0=A0 (void)abstract;<br>} /* kbd_callback */<br><br=
>int block=3D0,arrow=3D0;<br>=A0=A0=A0 LIBSSH2_SESSION *session;<br>
=A0=A0=A0 LIBSSH2_CHANNEL *channel; <br>=A0 <br><br><br>int connection(int =
*socke)<br>{<br>=A0 unsigned long hostaddr;<br>=A0=A0=A0 int sock, auth_pw =
=3D 0;<br>=A0=A0=A0 struct sockaddr_in sin;<br>=A0=A0=A0 const char *finger=
print;<br>=A0=A0=A0 char *userauthlist;<br>
#ifdef WIN32<br>=A0=A0=A0 WSADATA wsadata;<br><br>=A0=A0=A0 WSAStartup(MAKE=
WORD(2,0), &amp;wsadata);<br>#endif<br><br><br>hostaddr =3D inet_addr(confi=
ghost);<br><br>=A0=A0=A0 sock =3D socket(AF_INET, SOCK_STREAM, 0);<br>#ifnd=
ef WIN32<br><br>=A0=A0=A0 fcntl(sock, F_SETFL, 0);<br>
#endif<br>=A0=A0=A0 *socke=3Dsock;<br><br>=A0=A0=A0 sin.sin_family =3D AF_I=
NET;<br>=A0=A0=A0 sin.sin_port =3D htons(22);<br>=A0=A0=A0 sin.sin_addr.s_a=
ddr =3D hostaddr;<br><br>=A0=A0=A0 if (connect(sock, (struct sockaddr*)(&am=
p;sin),<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 sizeof(struct sock=
addr_in)) !=3D 0) {<br>
=A0=A0=A0=A0=A0=A0=A0 fprintf(stderr, &quot;Nie uda=B3o si=EA nawi=B1za=E6 =
po=B3=B1czenia z %s!\nSprawd=BC swoje po=B3=B1czenie sieciowe.\nJe=B6li pro=
blem b=EAdzie si=EA powtarza=E6=A0 skontaktuj si=EA z administratorem.\n na=
ci=B6nij enter aby spr=F3bowa=E6 ponownie&quot;,confighost);<br>
=A0=A0=A0=A0 <br>getchar();<br>=A0=A0=A0 <br>=A0=A0=A0 <br>=A0=A0=A0=A0=A0=
=A0=A0 return -1;<br>=A0=A0=A0 }<br>=A0<br>printf(&quot;po=B3=B1czenie z se=
rwerem jest aktywne\n&quot;);<br>fflush(stdout);<br>*socke=3Dsock;<br>}<br>=
<br>int makeconnection(LIBSSH2_SESSION **sesion,LIBSSH2_CHANNEL **chanel,in=
t *socke)<br>
{<br>LIBSSH2_CHANNEL *channel;<br>LIBSSH2_SESSION *session;<br><br>const ch=
ar *keyfile1=3D&quot;~/.ssh/id_rsa.pub&quot;;<br>const char *keyfile2=3D&qu=
ot;~/.ssh/id_rsa&quot;;<br><br>strcpy(pass,configpassword);<br><br>=A0 unsi=
gned long hostaddr;<br>
=A0=A0=A0 int sock, auth_pw =3D 0;<br>=A0=A0=A0 struct sockaddr_in sin;<br>=
=A0=A0=A0 const char *fingerprint;<br>=A0=A0=A0 char *userauthlist;<br>sock=
=3D*socke;<br><br>=A0=A0=A0 /* Create a session instance and start it up<br=
>=A0=A0=A0=A0 * This will trade welcome banners, exchange keys, and setup c=
rypto, compression, and MAC layers<br>
=A0=A0=A0=A0 */<br>=A0=A0=A0 session =3D libssh2_session_init();<br>int ind=
;<br>for(ind=3D0;ind&lt;5;ind++)<br>=A0=A0=A0 if (!libssh2_session_startup(=
session, sock))break;<br>=A0if(ind=3D=3D5)<br>=A0{<br>=A0=A0=A0 if(sock)<br=
>{<br>#ifdef WIN32<br>=A0=A0=A0 closesocket(sock);<br>
#else<br>=A0=A0=A0 close(sock);<br>#endif<br>}<br>=A0=A0=A0 connection(&amp=
;sock);<br>=A0=A0=A0 for(ind=3D0;ind&lt;5;ind++)<br>=A0=A0=A0 =A0=A0=A0 if =
(!libssh2_session_startup(session, sock))break;<br>=A0=A0=A0 if(ind=3D=3D5)=
<br>=A0=A0=A0 {<br><br>=A0=A0=A0=A0=A0=A0=A0 fprintf(stderr, &quot;Nie uda=
=B3o si=EA nawi=B1za=E6 sesji SSH\n&quot;);<br>
=A0=A0=A0=A0=A0=A0=A0=A0 <br>=A0=A0=A0 return-1;<br>=A0=A0=A0 }<br>=A0=A0=
=A0 }<br>=A0=A0=A0 fingerprint =3D libssh2_hostkey_hash(session, LIBSSH2_HO=
STKEY_HASH_MD5);<br>=A0=A0=A0 /* check what authentication methods are avai=
lable */<br>=A0=A0=A0 userauthlist =3D libssh2_userauth_list(session, confi=
gusername, strlen(configusername));<br>
=A0=A0=A0 //printf(&quot;Authentication methods: %s\n&quot;, userauthlist);=
<br>=A0=A0=A0 if (strstr(userauthlist, &quot;password&quot;) !=3D NULL) {<b=
r>=A0=A0=A0=A0=A0=A0=A0 auth_pw |=3D 1;<br>=A0=A0=A0 }<br>=A0=A0=A0 if (str=
str(userauthlist, &quot;keyboard-interactive&quot;) !=3D NULL) {<br>
=A0=A0=A0=A0=A0=A0=A0 auth_pw |=3D 2;<br>=A0=A0=A0 }<br>=A0=A0=A0 if (strst=
r(userauthlist, &quot;publickey&quot;) !=3D NULL) {<br>=A0=A0=A0=A0=A0=A0=
=A0 auth_pw |=3D 4;<br>=A0=A0=A0 }<br><br><br>=A0=A0=A0 if (auth_pw &amp; 1=
) {<br>=A0=A0=A0=A0=A0=A0=A0 /* We could authenticate via password */<br>
=A0=A0=A0=A0=A0=A0=A0 if (libssh2_userauth_password(session, configusername=
, configpassword)) {<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 printf(&quot;\nNi=
eprawid=B3owy login lub has=B3o!\n&quot;);<br>=A0=A0=A0 <br>=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0 return -2; /*goto shutdown;*/<br>=A0=A0=A0=A0=A0=A0=A0 }=
 else {<br>
=A0//=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 printf(&quot;\tAuthentication by passwo=
rd succeeded.\n&quot;);<br>=A0=A0=A0=A0=A0=A0=A0 }<br>=A0=A0=A0 } else if (=
auth_pw &amp; 2) {<br>=A0=A0=A0=A0=A0=A0=A0 /* Or via keyboard-interactive =
*/<br>=A0=A0=A0=A0=A0=A0=A0 if (libssh2_userauth_keyboard_interactive(sessi=
on, configusername, &amp;kbd_callback) ) {<br>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 printf(&quot;\tAuthentication by keyboard=
-interactive failed!\n&quot;);<br>=A0=A0=A0 <br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0 return -2; /*goto shutdown;*/<br>=A0=A0=A0=A0=A0=A0=A0 } else {<br>=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 printf(&quot;\tAuthentication by keyboard=
-interactive succeeded.\n&quot;);<br>
=A0=A0=A0=A0=A0=A0=A0 }<br>=A0=A0=A0 } else if (auth_pw &amp; 4) {<br>=A0=
=A0=A0=A0=A0=A0=A0 /* Or by public key */<br>=A0=A0=A0=A0=A0=A0=A0 if (libs=
sh2_userauth_publickey_fromfile(session, configusername, keyfile1, keyfile2=
, configpassword)) {<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 printf(&quot;\tAu=
thentication by public key failed!\n&quot;);<br>
=A0=A0=A0 <br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -2; /*goto shutdown;=
*/<br>=A0=A0=A0=A0=A0=A0=A0 } else {<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 p=
rintf(&quot;\tAuthentication by public key succeeded.\n&quot;);<br>=A0=A0=
=A0=A0=A0=A0=A0 }<br>=A0=A0=A0 } else {<br>=A0=A0=A0=A0=A0=A0=A0 printf(&qu=
ot;No supported authentication methods found!\n&quot;);<br>
=A0=A0=A0 <br>=A0=A0=A0=A0=A0=A0=A0 return -2; /*goto shutdown;*/<br>=A0=A0=
=A0 }<br><br><br>=A0=A0 /* Request a shell */<br>=A0=A0=A0 if (!(channel =
=3D libssh2_channel_open_session(session))) {<br>=A0=A0=A0=A0=A0=A0=A0 fpri=
ntf(stderr, &quot;Unable to open a session\n&quot;);<br>
=A0=A0=A0 <br>=A0=A0=A0=A0=A0=A0=A0 return -2; /*goto shutdown;*/<br>=A0=A0=
=A0 }<br><br>//=A0=A0=A0 libssh2_channel_setenv(channel, &quot;FOO&quot;, &=
quot;bar&quot;);<br><br>=A0=A0=A0 /* <br>=A0=A0=A0=A0 * See /etc/termcap fo=
r more options<br>=A0=A0=A0=A0 */<br>=A0=A0=A0 char *termtype;<br>
=A0=A0=A0 termtype =3D getenv(&quot;TERM&quot;);<br><br>=A0=A0=A0 if (libss=
h2_channel_request_pty(channel, &quot;vt102&quot;)) {<br>=A0=A0=A0=A0=A0=A0=
=A0 fprintf(stderr, &quot;Failed requesting pty\n&quot;);<br>=A0=A0=A0 <br>=
=A0=A0=A0=A0=A0=A0=A0 return -3; /*goto skip_shell;*/<br>
=A0=A0=A0 }<br><br>=A0=A0=A0 /* Open a SHELL on that pty */<br>=A0=A0=A0 if=
 (libssh2_channel_shell(channel)) {<br>=A0=A0=A0=A0=A0=A0=A0 fprintf(stderr=
, &quot;Unable to request shell on allocated pty\n&quot;);<br>=A0=A0=A0 <br=
>=A0=A0=A0=A0=A0=A0=A0 return -2; /*goto shutdown;*/<br>
=A0=A0=A0 }<br>=A0<br><br>*chanel=3Dchannel;<br>*sesion=3Dsession;<br>retur=
n 1;<br><br>}<br><br>int mainloop(LIBSSH2_CHANNEL *channel)<br>{<br>char sc=
helout[2*BUFFSIZE];<br>char c[2];<br>int readlen,flags;<br><br>=A0=A0=A0 =
=A0=A0=A0 =A0=A0=A0 /*set stdin nonblockign*/<br>
=A0=A0=A0 flags =3D fcntl(0, F_GETFL, 0); <br>=A0=A0=A0 =A0flags |=3D O_NON=
BLOCK;=A0=A0=A0 =A0=A0=A0 <br>=A0=A0=A0 =A0fcntl(0, F_SETFL, flags);=A0=A0=
=A0 =A0=A0=A0 <br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 /*set ssh channel nonblocki=
gn*/<br>=A0=A0=A0 libssh2_channel_set_blocking(channel, 0);<br>=A0=A0=A0 li=
bssh2_channel_handle_extended_data2(channel, LIBSSH2_CHANNEL_EXTENDED_DATA_=
MERGE); <br>
<br>=A0=A0=A0 /*set getch noecho*/<br><br>=A0=A0=A0=A0 struct termios attrs=
,oldattrs;=A0=A0=A0=A0=A0=A0=A0=A0=A0 <br>=A0=A0 =A0=A0=A0 tcgetattr( 0, &a=
mp;attrs );<br>=A0=A0=A0 tcgetattr( 0, &amp;oldattrs );<br>=A0=A0=A0 =A0att=
rs.c_cc[VINTR]=A0=A0=A0 =3D 0; <br>=A0=A0=A0 attrs.c_cc[VSUSP]=A0=A0=A0 =3D=
 0;<br>
=A0=A0=A0 tcsetattr( 0, 0, &amp;attrs );<br><br>int i=3D0;<br>initscr();<br=
>=A0=A0=A0 while(1) /*main loop*/<br>=A0=A0=A0 {<br>=A0=A0=A0 =A0=A0=A0 lib=
ssh2_channel_flush_ex(channel,LIBSSH2_CHANNEL_FLUSH_ALL);<br>=A0=A0=A0 =A0=
=A0=A0 /*reading*/<br>=A0=A0=A0 =A0=A0=A0 for(i=3D0;i&lt;BUFFSIZE;i++)schel=
out[i]=3D0;<br>
=A0=A0=A0 =A0=A0=A0 readlen=3Dlibssh2_channel_read(channel,schelout,HALFBUF=
FSIZE);<br>=A0=A0=A0 =A0=A0=A0 if(readlen&gt;0)=A0=A0=A0 <br>=A0=A0=A0 =A0=
=A0=A0 {<br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 printf(&quot;%s&quot;,schelout);<=
br>=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 fflush(stdout);=A0=A0=A0 <br>=A0=A0=A0 =A0=
=A0=A0 }<br>=A0=A0=A0 =A0=A0=A0 /*writing*/<br>
=A0=A0=A0 =A0=A0=A0 c[0]=3Dgetch();<br>=A0=A0=A0 =A0=A0=A0 c[1]=3D&#39;\0&#=
39;;<br>=A0=A0=A0 =A0=A0=A0 if(c[0]!=3D-1)<br>=A0=A0=A0 =A0=A0=A0 { <br>=A0=
=A0=A0 =A0=A0=A0 =A0=A0=A0 libssh2_channel_write(channel,c,strlen(c));<br>=
=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 libssh2_channel_flush(channel);=A0=A0=A0 =A0=
=A0=A0 <br>=A0=A0=A0 =A0=A0=A0 }<br>if(libssh2_channel_eof(channel)=3D=3D1)=
break;<br>
=A0=A0=A0 }<br><br>=A0=A0=A0 flags =3D fcntl(0, F_GETFL, 0); /*reseting ter=
minal configuration*/<br>=A0=A0=A0 flags &amp;=3D ~O_NONBLOCK;=A0=A0=A0 =A0=
=A0=A0 <br>=A0=A0=A0 fcntl(0, F_SETFL, flags);<br>=A0=A0=A0 tcsetattr( 0, 0=
, &amp;oldattrs );=A0=A0=A0 <br>return 1;<br>}<br>
<br>int main(int argc, char* argv[])<br>{<br><br>int sock;<br>char tekst[12=
8];<br><br>session=3DNULL;<br>channel=3DNULL;<br>sock=3D0;<br><br>if(connec=
tion(&amp;sock)=3D=3D-1)<br>{<br>exit(1);<br>}<br>if (makeconnection(&amp;s=
ession,&amp;channel,&amp;sock)=3D=3D1)<br>
{ <br>=A0=A0=A0 system(&quot;clear&quot;);=A0=A0 <br>=A0=A0=A0 mainloop(cha=
nnel);=A0 <br>}=A0 <br>else<br>{ <br>/*else faild to connect*/<br>=A0=A0=A0=
 getchar();<br><br>}<br>/*disconnection*/ <br>=A0=A0=A0 if (channel) {<br>=
=A0=A0=A0=A0=A0=A0=A0 libssh2_channel_free(channel);<br>
=A0=A0=A0=A0=A0=A0=A0 channel =3D NULL;<br>=A0=A0=A0 } <br><br>if(session)<=
br>{<br>=A0=A0=A0 libssh2_session_disconnect(session, &quot;Normal Shutdown=
, Thank you for playing&quot;);<br>=A0=A0=A0 libssh2_session_free(session);=
<br>}<br>if(sock)<br>{<br>=A0=A0=A0 close(sock);<br>
} <br>=A0=A0=A0 return 0;<br>}<br><br>

--000e0cd242c45a937e049cf32d16--

--===============0923180457==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

--===============0923180457==--

From libssh2-devel-bounces@cool.haxx.se  Thu Feb 24 04:25:01 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1O3OYqS003409;
	Thu, 24 Feb 2011 04:24:56 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1O3OXaN003375
	for <libssh2-devel@cool.haxx.se>; Thu, 24 Feb 2011 04:24:33 +0100
Received: (qmail 27525 invoked from network); 24 Feb 2011 03:24:31 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 24 Feb 2011 03:24:31 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Thu, 24 Feb 2011 03:24:31 -0000
X-URL: http://trac.libssh2.org/
Subject: [libssh2] #213: segfault while calling some API in multithreads
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/213
Message-ID: <108.a7f69d22d707a3572c776a1f6b1bb231@libssh2.stuge.se>
X-Trac-Ticket-ID: 213
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 24 Feb 2011 04:25:01 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Thu, 24 Feb 2011 04:24:33 +0100 (CET)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p1O3OXaN003375
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p1O3OYqS003409

#213: segfault while calling some API in multithreads
---------------------------------------------------------------------------------------+
  Reporter:  www.google.com/accounts/o8/id?id=aitoawm7w0npnppytaxsfxvbcdtodu9fots4nnu  |       Owner:       
      Type:  defect                                                                    |      Status:  new  
  Priority:  normal                                                                    |   Milestone:  1.2.8
 Component:  crypto                                                                    |     Version:  1.2.7
  Keywords:                                                                            |      Blocks:       
Blocked By:                                                                            |  
---------------------------------------------------------------------------------------+
 I don't know if libssh2 is thread safe.but I think it should be that. when
 I call libssh2_session_startup(),libssh2_userauth_publickey_fromfile()....
 it will cause a segfault sometimes


 #0  0x0000000000000000 in ?? ()
 (gdb) where
 #0  0x0000000000000000 in ?? ()
 #1  0x00002b1b9b176951 in _libssh2_cipher_crypt (ctx=0x17707510,
 algo=<value optimized out>, encrypt=<value optimized out>,
     block=0x17b603f8
 "耇0\021M\232侵\a楗.蘒\224}\017餹鱘227\b赲210V^鱘222@]穃204贵\024Qu=\032酬{馶231)U‐004?2\214悯\022U]肻214\030綠1nk鱟kXrL死燶002\025\213胤T\205\235V<\234b郐轡0037205玕177!b5黒031\227|0(>v驤邀Z\035酆A(玟CTD\032\006\023芋\230k鸤237圉続\234wA`H\004\032}f覾213K醝|\221\206醆237sF矛妪\231)W騄\031鳏籺\"鋡"...)
 at openssl.c:197
 #2  0x00002b1b9b173e3d in decrypt (session=0x17b601e0,
     source=0x17b603f8
 "耇0\021M\232侵\a楗.蘒\224}\017餹鱘227\b赲210V^鱘222@]穃204贵\024Qu=\032酬{馶231)U‐004?2\214悯\022U]肻214\030綠1nk鱟kXrL死燶002\025\213胤T\205\235V<\234b郐轡0037205玕177!b5黒031\227|0(>v驤邀Z\035酆A(玟CTD\032\006\023芋\230k鸤237圉続\234wA`H\004\032}f覾213K醝|\221\206醆237sF矛妪\231)W騄\031鳏籺\"鋡"...,
 dest=0x2aaab407e63b "椽*", len=<value optimized out>) at transport.c:138
 #3  0x00002b1b9b1740dd in _libssh2_transport_read (session=0x17b601e0) at
 transport.c:538
 #4  0x00002b1b9b168345 in _libssh2_packet_requirev (session=0x17b601e0,
 packet_types=0x2b1b9b177906 "cd", data=0x4f5fbe48, data_len=0x4f5fbe40,
     match_ofs=1, match_buf=0x17b41ed8 "", match_len=4, state=0x17b41ee0)
 at packet.c:1146
 #5  0x00002b1b9b16236c in _libssh2_channel_process_startup
 (channel=0x17b41db0, request=0x40650d "exec", request_len=4,
 message=<value optimized out>,
     message_len=63) at channel.c:1295
 #6  0x00002b1b9b162475 in libssh2_channel_process_startup
 (channel=0x17b41db0, req=0x40650d "exec", req_len=4,
     msg=0x1770af90 "cd /home/work/opbin/medusa/ && ./medusaStat
 --time=201102241108", msg_len=63) at channel.c:1334
 #7  0x00000000004050f0 in ssh_exec (user=0x40654c "work", h=0x17b0bd10
 "jx-cm-as22.jx",
     cmd=0x1770af90 "cd /home/work/opbin/medusa/ && ./medusaStat
 --time=201102241108", output=0x17716790 "") at mds_crond.c:194
 #8  0x00000000004052c6 in cronworker (a=0x7fff0f95cbf0) at mds_crond.c:261
 #9  0x0000003356806367 in start_thread () from /lib64/libpthread.so.0
 #10 0x0000003355cd30ad in clone () from /lib64/libc.so.6

-- 
Ticket URL: <http://trac.libssh2.org/ticket/213>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Thu Feb 24 04:57:46 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1O3vbfE010160;
	Thu, 24 Feb 2011 04:57:45 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1O3vZFr010155
	for <libssh2-devel@cool.haxx.se>; Thu, 24 Feb 2011 04:57:35 +0100
Received: (qmail 10462 invoked from network); 24 Feb 2011 03:57:35 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 24 Feb 2011 03:57:35 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Thu, 24 Feb 2011 03:57:35 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #213: segfault while calling some API in multithreads
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/213#comment:1
Message-ID: <123.8c8dfe8ddcc6028078f7452522b118fe@libssh2.stuge.se>
References: <108.a7f69d22d707a3572c776a1f6b1bb231@libssh2.stuge.se>
X-Trac-Ticket-ID: 213
In-Reply-To: <108.a7f69d22d707a3572c776a1f6b1bb231@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 24 Feb 2011 04:57:46 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Thu, 24 Feb 2011 04:57:35 +0100 (CET)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p1O3vZFr010155
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p1O3vbfE010160

#213: segfault while calling some API in multithreads
---------------------------------------------------------------------------------------+
  Reporter:  www.google.com/accounts/o8/id?id=aitoawm7w0npnppytaxsfxvbcdtodu9fots4nnu  |        Owner:        
      Type:  defect                                                                    |       Status:  closed
  Priority:  normal                                                                    |    Milestone:  1.2.8 
 Component:  crypto                                                                    |      Version:  1.2.7 
Resolution:  invalid                                                                   |     Keywords:        
    Blocks:                                                                            |   Blocked By:        
---------------------------------------------------------------------------------------+
Changes (by stuge):

  * status:  new => closed
  * resolution:  => invalid


Old description:

> I don't know if libssh2 is thread safe.but I think it should be that.
> when I call
> libssh2_session_startup(),libssh2_userauth_publickey_fromfile().... it
> will cause a segfault sometimes
>

> #0  0x0000000000000000 in ?? ()
> (gdb) where
> #0  0x0000000000000000 in ?? ()
> #1  0x00002b1b9b176951 in _libssh2_cipher_crypt (ctx=0x17707510,
> algo=<value optimized out>, encrypt=<value optimized out>,
>     block=0x17b603f8
> "耇0\021M\232侵\a楗.蘒\224}\017餹鱘227\b赲210V^鱘222@]穃204贵\024Qu=\032酬{馶231)U‐004?2\214悯\022U]肻214\030綠1nk鱟kXrL死燶002\025\213胤T\205\235V<\234b郐轡0037205玕177!b5黒031\227|0(>v驤邀Z\035酆A(玟CTD\032\006\023芋\230k鸤237圉続\234wA`H\004\032}f覾213K醝|\221\206醆237sF矛妪\231)W騄\031鳏籺\"鋡"...)
> at openssl.c:197
> #2  0x00002b1b9b173e3d in decrypt (session=0x17b601e0,
>     source=0x17b603f8
> "耇0\021M\232侵\a楗.蘒\224}\017餹鱘227\b赲210V^鱘222@]穃204贵\024Qu=\032酬{馶231)U‐004?2\214悯\022U]肻214\030綠1nk鱟kXrL死燶002\025\213胤T\205\235V<\234b郐轡0037205玕177!b5黒031\227|0(>v驤邀Z\035酆A(玟CTD\032\006\023芋\230k鸤237圉続\234wA`H\004\032}f覾213K醝|\221\206醆237sF矛妪\231)W騄\031鳏籺\"鋡"...,
> dest=0x2aaab407e63b "椽*", len=<value optimized out>) at transport.c:138
> #3  0x00002b1b9b1740dd in _libssh2_transport_read (session=0x17b601e0) at
> transport.c:538
> #4  0x00002b1b9b168345 in _libssh2_packet_requirev (session=0x17b601e0,
> packet_types=0x2b1b9b177906 "cd", data=0x4f5fbe48, data_len=0x4f5fbe40,
>     match_ofs=1, match_buf=0x17b41ed8 "", match_len=4, state=0x17b41ee0)
> at packet.c:1146
> #5  0x00002b1b9b16236c in _libssh2_channel_process_startup
> (channel=0x17b41db0, request=0x40650d "exec", request_len=4,
> message=<value optimized out>,
>     message_len=63) at channel.c:1295
> #6  0x00002b1b9b162475 in libssh2_channel_process_startup
> (channel=0x17b41db0, req=0x40650d "exec", req_len=4,
>     msg=0x1770af90 "cd /home/work/opbin/medusa/ && ./medusaStat
> --time=201102241108", msg_len=63) at channel.c:1334
> #7  0x00000000004050f0 in ssh_exec (user=0x40654c "work", h=0x17b0bd10
> "jx-cm-as22.jx",
>     cmd=0x1770af90 "cd /home/work/opbin/medusa/ && ./medusaStat
> --time=201102241108", output=0x17716790 "") at mds_crond.c:194
> #8  0x00000000004052c6 in cronworker (a=0x7fff0f95cbf0) at
> mds_crond.c:261
> #9  0x0000003356806367 in start_thread () from /lib64/libpthread.so.0
> #10 0x0000003355cd30ad in clone () from /lib64/libc.so.6

New description:

 I don't know if libssh2 is thread safe.but I think it should be that. when
 I call libssh2_session_startup(),libssh2_userauth_publickey_fromfile()....
 it will cause a segfault sometimes


 #0  0x0000000000000000 in ?? ()
 (gdb) where
 #0  0x0000000000000000 in ?? ()
 #1  0x00002b1b9b176951 in _libssh2_cipher_crypt (ctx=0x17707510,
 algo=<value optimized out>, encrypt=<value optimized out>,
     block=0x17b603f8
 "耇0\021M\232侵\a楗.蘒\224}\017餹鱘227\b赲210V^鱘222@]穃204贵\024Qu=\032酬{馶231)U‐004?2\214悯\022U]肻214\030綠1nk鱟kXrL死燶002\025\213胤T\205\235V<\234b郐轡0037205玕177!b5黒031\227|0(>v驤邀Z\035酆A(玟CTD\032\006\023芋\230k鸤237圉続\234wA`H\004\032}f覾213K醝|\221\206醆237sF矛妪\231)W騄\031鳏籺\"鋡"...)
 at openssl.c:197
 #2  0x00002b1b9b173e3d in decrypt (session=0x17b601e0,
     source=0x17b603f8
 "耇0\021M\232侵\a楗.蘒\224}\017餹鱘227\b赲210V^鱘222@]穃204贵\024Qu=\032酬{馶231)U‐004?2\214悯\022U]肻214\030綠1nk鱟kXrL死燶002\025\213胤T\205\235V<\234b郐轡0037205玕177!b5黒031\227|0(>v驤邀Z\035酆A(玟CTD\032\006\023芋\230k鸤237圉続\234wA`H\004\032}f覾213K醝|\221\206醆237sF矛妪\231)W騄\031鳏籺\"鋡"...,
 dest=0x2aaab407e63b "椽*", len=<value optimized out>) at transport.c:138
 #3  0x00002b1b9b1740dd in _libssh2_transport_read (session=0x17b601e0) at
 transport.c:538
 #4  0x00002b1b9b168345 in _libssh2_packet_requirev (session=0x17b601e0,
 packet_types=0x2b1b9b177906 "cd", data=0x4f5fbe48, data_len=0x4f5fbe40,
     match_ofs=1, match_buf=0x17b41ed8 "", match_len=4, state=0x17b41ee0)
 at packet.c:1146
 #5  0x00002b1b9b16236c in _libssh2_channel_process_startup
 (channel=0x17b41db0, request=0x40650d "exec", request_len=4,
 message=<value optimized out>,
     message_len=63) at channel.c:1295
 #6  0x00002b1b9b162475 in libssh2_channel_process_startup
 (channel=0x17b41db0, req=0x40650d "exec", req_len=4,
     msg=0x1770af90 "cd /home/work/opbin/medusa/ && ./medusaStat
 --time=201102241108", msg_len=63) at channel.c:1334
 #7  0x00000000004050f0 in ssh_exec (user=0x40654c "work", h=0x17b0bd10
 "jx-cm-as22.jx",
     cmd=0x1770af90 "cd /home/work/opbin/medusa/ && ./medusaStat
 --time=201102241108", output=0x17716790 "") at mds_crond.c:194
 #8  0x00000000004052c6 in cronworker (a=0x7fff0f95cbf0) at mds_crond.c:261
 #9  0x0000003356806367 in start_thread () from /lib64/libpthread.so.0
 #10 0x0000003355cd30ad in clone () from /lib64/libc.so.6

--

Comment:

 Replying to [ticket:213
 www.google.com/accounts/o8/id?id=aitoawm7w0npnppytaxsfxvbcdtodu9fots4nnu]:
 > I don't know if libssh2 is thread safe.

 It is not.

 > but I think it should be that.

 That would be great. Please come discuss it on the mailing list, or just
 send patches.

 Thanks!

-- 
Ticket URL: <http://trac.libssh2.org/ticket/213#comment:1>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Thu Feb 24 05:01:05 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1O413d1012754;
	Thu, 24 Feb 2011 05:01:05 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with SMTP id p1O412m0012724
	for <libssh2-devel@cool.haxx.se>; Thu, 24 Feb 2011 05:01:02 +0100
Received: (qmail 27810 invoked by uid 501); 24 Feb 2011 04:01:02 -0000
Message-ID: <20110224040102.27809.qmail@stuge.se>
Date: Thu, 24 Feb 2011 05:01:02 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: [libssh2] #213: segfault while calling some API in multithreads
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <108.a7f69d22d707a3572c776a1f6b1bb231@libssh2.stuge.se>
	<123.8c8dfe8ddcc6028078f7452522b118fe@libssh2.stuge.se>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <123.8c8dfe8ddcc6028078f7452522b118fe@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 24 Feb 2011 05:01:05 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Thu, 24 Feb 2011 05:01:02 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

libssh2 Trac wrote:
> Old description:
..
> New description:

Argh. Don't use chrome with trac. It seems to f* up the line endings.


//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Thu Feb 24 05:23:34 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1O4NTZo028155;
	Thu, 24 Feb 2011 05:23:33 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with SMTP id p1O4NRhG028128
	for <libssh2-devel@cool.haxx.se>; Thu, 24 Feb 2011 05:23:27 +0100
Received: (qmail 536 invoked by uid 501); 24 Feb 2011 04:23:28 -0000
Message-ID: <20110224042328.535.qmail@stuge.se>
Date: Thu, 24 Feb 2011 05:23:28 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: problem with big data packages using libssh2_channel_read
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <AANLkTinjM64VPmM2yUaFKarU06DNRVAca=oNtP4K4jq=@mail.gmail.com>
	<alpine.DEB.2.00.1102212325010.25402@tvnag.unkk.fr>
	<AANLkTikK_o5-odavc_DHoEH2ZCPj2zwiv8-nVzRO9kb-@mail.gmail.com>
	<alpine.DEB.2.00.1102221616560.1378@tvnag.unkk.fr>
	<AANLkTi=S6j+i+21U276YRwGD1KELM1Ma6Q_3v_ZyMjQ_@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <AANLkTi=S6j+i+21U276YRwGD1KELM1Ma6Q_3v_ZyMjQ_@mail.gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 24 Feb 2011 05:23:34 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Thu, 24 Feb 2011 05:23:27 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Mateusz Pilski wrote:
> > Can you help us help you and provide a full example that repeats this
> > problem?
> 
> i post here mostly simplified working code with this error

Your code is horribly formatted. For your own sake and everyone
else's who might have to read it, it would be good if you clean
it up.


> the interesting part is only function mainloop().

Yes.

>     while(1) /*main loop*/
>     {
>         libssh2_channel_flush_ex(channel,LIBSSH2_CHANNEL_FLUSH_ALL);
>         /*reading*/
>         for(i=0;i<BUFFSIZE;i++)schelout[i]=0;
>         readlen=libssh2_channel_read(channel,schelout,HALFBUFFSIZE);
>         if(readlen>0)
>         {
>             printf("%s",schelout);
>             fflush(stdout);
>         }
>         /*writing*/
>         c[0]=getch();
>         c[1]='\0';
>         if(c[0]!=-1)
>         {
>             libssh2_channel_write(channel,c,strlen(c));
>             libssh2_channel_flush(channel);
>         }
> if(libssh2_channel_eof(channel)==1)break;
>     }

This code is incorrect. Look at example/direct_tcpip.c for the method
which you *must* use when you want to handle both a libssh2 channel
and some other communications channel. (stdin in your case)

I bet that if you press enter in this ssh client then you will get
some more "missing" data displayed on your screen.


//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Fri Feb 25 13:30:34 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1PCU6ej032318;
	Fri, 25 Feb 2011 13:30:30 +0100
Received: from mail.icesoft.ro (mail.icesoft.ro [89.42.24.215])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1PCU40x032053
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 25 Feb 2011 13:30:04 +0100
Received: from unknown-00-1b-77-6f-f5-f5.lan (unknown [89.122.225.202])
	by mail.icesoft.ro (Postfix) with ESMTP id 3FCA124401A
	for <libssh2-devel@cool.haxx.se>; Fri, 25 Feb 2011 14:30:03 +0200 (EET)
From: Serghei Amelian <serghei.amelian@gmail.com>
To: libssh2-devel@cool.haxx.se
Subject: sftp - errors
Date: Fri, 25 Feb 2011 14:30:16 +0200
User-Agent: KMail/1.9.10 (enterprise35 0.20100827.1168748)
MIME-Version: 1.0
Content-Disposition: inline
Message-Id: <201102251430.16298.serghei.amelian@gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 25 Feb 2011 13:30:34 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Fri, 25 Feb 2011 13:30:04 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hello list,

I developing a sftp kioslave for trinity desktop environment and I want to 
give to users useful message when, for example, a file cannot be opened for 
some reason (file doesn't exists, access denied, etc). libssh2_sftp_open() 
returns LIBSSH2_ERROR_SFTP_PROTOCOL in these cases, which are completely 
meaningless for an user. Is any way to get a more friendly/explicit message?

-- 
Serghei
Trinity Desktop Environment
http://trinity.pearsoncomputing.net/
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Fri Feb 25 17:10:47 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1PGAWQI022421;
	Fri, 25 Feb 2011 17:10:45 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with SMTP id p1PGAVX8022387
	for <libssh2-devel@cool.haxx.se>; Fri, 25 Feb 2011 17:10:31 +0100
Received: (qmail 20514 invoked by uid 501); 25 Feb 2011 16:10:31 -0000
Message-ID: <20110225161031.20513.qmail@stuge.se>
Date: Fri, 25 Feb 2011 17:10:31 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: sftp - errors
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <201102251430.16298.serghei.amelian@gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <201102251430.16298.serghei.amelian@gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 25 Feb 2011 17:10:47 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Fri, 25 Feb 2011 17:10:31 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Serghei Amelian wrote:
> I want to give to users useful message when, for example, a file
> cannot be opened for some reason .. libssh2_sftp_open() returns
> LIBSSH2_ERROR_SFTP_PROTOCOL in these cases .. Is any way to get
> a more friendly/explicit message?

Did you look at the code yourself before sending this email to occupy
the time of others?

Did you look at the secsh-filexfer protocol to find out if the
protocol allows a message from the server or if structured errors are
returned?

Did you look at libssh2 headers or documentation for any API that may
offer you more information about errors?

Did you look inside libssh2 to find out if any message or error code
is returned from the server and how it may be exposed by libssh2 to
an application?


//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Sat Feb 26 01:57:53 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1Q0vRal020339;
	Sat, 26 Feb 2011 01:57:47 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1Q0vPnQ020314
	for <libssh2-devel@cool.haxx.se>; Sat, 26 Feb 2011 01:57:25 +0100
Received: (qmail 17557 invoked from network); 26 Feb 2011 00:57:27 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 26 Feb 2011 00:57:27 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Sat, 26 Feb 2011 00:57:27 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #211: size mismatch between struct transportpacket
	fields causes libssh2 to get stuck
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/211#comment:2
Message-ID: <123.4695122ed511cd67a08584340af7cfdd@libssh2.stuge.se>
References: <108.62cba77b47352402c1cd0687daecf8b2@libssh2.stuge.se>
X-Trac-Ticket-ID: 211
In-Reply-To: <108.62cba77b47352402c1cd0687daecf8b2@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Sat, 26 Feb 2011 01:57:53 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Sat, 26 Feb 2011 01:57:25 +0100 (CET)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p1Q0vPnQ020314
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#211: size mismatch between struct transportpacket fields causes libssh2 to get
stuck
---------------------------------------------------------------------------------------+
  Reporter:  www.google.com/accounts/o8/id?id=aitoawlhggg_yplkl7grwwpbbum-omtqud4rmna  |        Owner:          
      Type:  defect                                                                    |       Status:  reopened
  Priority:  normal                                                                    |    Milestone:  1.2.8   
 Component:  protocol                                                                  |      Version:  1.2.7   
Resolution:                                                                            |     Keywords:          
    Blocks:                                                                            |   Blocked By:          
---------------------------------------------------------------------------------------+
Changes (by www.google.com/accounts/o8/id?id=aitoawlhggg_yplkl7grwwpbbum-omtqud4rmna):

  * status:  closed => reopened
  * resolution:  fixed =>


Comment:

 I am reopening this bug as just using size_t does not resolve the problem.
 libssh2 just gets stuck in the next read call on the session. Initially I
 thought this was a problem with my code, since it was issuing reads even
 after an error was returned. However on closer inspection, this read is
 coming as a result of calling libssh_channel_free after the error. To
 illustrate, here is the backtrace.

 #0  0x0000000000a5b8db in _libssh2_transport_read (session=0x7f42e368ff80)
 at transport.c:536
 #1  0x0000000000a531e1 in _libssh2_channel_close (channel=0x7f42e3606a20)
 at channel.c:2257
 #2  0x0000000000a5339b in _libssh2_channel_free (channel=0x7f42e3606a20)
 at channel.c:2386
 #3  0x0000000000a533d8 in libssh2_channel_free (channel=0x7f42e3606a20) at
 channel.c:2461
 #4  0x00000000005b917a in SSHSession::clearChannel (this=0x7f42e29e11a0)
 at sessions/ssh-session.cc:61
 #5  0x00000000005b8247 in SSHSession::disconnect (this=0x7f42e29e11a0) at
 sessions/ssh-session.cc:45
 #6  0x00000000005beaf0 in QuerySession::errorOccurred
 (this=0x7f42e29e11a0, sessErr=@0x1058640)
     at sessions/query-session.cc:243
 #7  0x00000000005bfc41 in QuerySession::doRead (this=0x7f42e29e11a0) at
 sessions/query-session.cc:330
 #8  0x00000000005b68f2 in SSHSession::doRead (this=0x7f42e29e11a0) at
 sessions/ssh-session.cc:331
 #9  0x00000000005c2091 in QuerySession::fdReadReady (this=0x7f42e29e11a0)
 at sessions/query-session.cc:150
 #10 0x00000000005b81ef in SSHSession::fdReadReady (this=0x7f42e29e11a0) at
 sessions/ssh-session.cc:237
 #11 0x00000000009f6481 in Scheduler::run ()
 #12 0x000000000065f4b4 in main (argc=8, argv=0x7fffd9d24a18) at
 main.cc:389
 Current language:  auto; currently c

 i.e. the same bogus packet length value is causing libssh2 to get stuck in
 the same way as described in comment #0.
 Suggested solution - if returning an error (rc < 0) other than EAGAIN, set
 session.packet.total_num = 0.  An easy way to do this is to add a level on
 indirection to _libssh2_transport_read for example by making
 _libssh2_trasport_read be defined as

 int _libssh2_tranport_read(LIBSSH2_SESSION * session){
   int rc = libssh2_transport_read(session);
   if (rc < 0 && rc != LIBSSH2_ERROR_EAGAIN)
     session.packet.total_num = 0;
   return rc;
 }
 where libssh2_trasport_read is the same as _libssh2_trasport_read is
 current code.
 For consistency of naming I could add a similar indirection in
 _libssh2_transport_send. But since there is no point adding a extra
 function call there we could define _libssh2_transport_send with a macro
 (that just calls libssh2_transport_send).

 Alternatively if it is important to not add the extra function call cost
 to libssh2_transport_read. I can reset the session.packet.total_num value
 inside the function in case of error. However this is more error prone.
 Please reply and I can roll you a patch for this.

-- 
Ticket URL: <http://trac.libssh2.org/ticket/211#comment:2>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Sat Feb 26 05:24:43 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1Q4OM4s030118;
	Sat, 26 Feb 2011 05:24:40 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1Q4OKMr030076
	for <libssh2-devel@cool.haxx.se>; Sat, 26 Feb 2011 05:24:20 +0100
Received: (qmail 6192 invoked from network); 26 Feb 2011 04:24:20 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 26 Feb 2011 04:24:20 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Sat, 26 Feb 2011 04:24:20 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #211: size mismatch between struct transportpacket
	fields causes libssh2 to get stuck
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/211#comment:3
Message-ID: <123.97ad0fc4affbf8cecadc76e01e9398cd@libssh2.stuge.se>
References: <108.62cba77b47352402c1cd0687daecf8b2@libssh2.stuge.se>
X-Trac-Ticket-ID: 211
In-Reply-To: <108.62cba77b47352402c1cd0687daecf8b2@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Sat, 26 Feb 2011 05:24:43 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Sat, 26 Feb 2011 05:24:20 +0100 (CET)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p1Q4OKMr030076
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p1Q4OM4s030118

#211: size mismatch between struct transportpacket fields causes libssh2 to get
stuck
---------------------------------------------------------------------------------------+
  Reporter:  www.google.com/accounts/o8/id?id=aitoawlhggg_yplkl7grwwpbbum-omtqud4rmna  |        Owner:  Peter Stuge <peter@…>       
      Type:  defect                                                                    |       Status:  closed                      
  Priority:  normal                                                                    |    Milestone:  1.2.8                       
 Component:  protocol                                                                  |      Version:  1.2.7                       
Resolution:  fixed                                                                     |     Keywords:                              
    Blocks:                                                                            |   Blocked By:                              
---------------------------------------------------------------------------------------+
Changes (by Peter Stuge <peter@…>):

  * owner:  => Peter Stuge <peter@…>
  * status:  reopened => closed
  * resolution:  => fixed


Comment:

 In [516fa7fdd9b55def83c124f223889c70b9e021ab/libssh2]:
 {{{
 #!CommitTicketReference repository="libssh2"
 revision="516fa7fdd9b55def83c124f223889c70b9e021ab"
 Don't save allocated packet size until it has actually been allocated

 The allocated packet size is internal state which needs to match reality
 in order to avoid problems. This commit fixes #211.
 }}}

-- 
Ticket URL: <http://trac.libssh2.org/ticket/211#comment:3>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Sat Feb 26 05:43:10 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1Q4h4oj013109;
	Sat, 26 Feb 2011 05:43:09 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with SMTP id p1Q4h2v1013060
	for <libssh2-devel@cool.haxx.se>; Sat, 26 Feb 2011 05:43:02 +0100
Received: (qmail 3082 invoked by uid 501); 26 Feb 2011 04:43:03 -0000
Message-ID: <20110226044303.3079.qmail@stuge.se>
Date: Sat, 26 Feb 2011 05:43:03 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: [libssh2] Trac commands in commit messages
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <108.62cba77b47352402c1cd0687daecf8b2@libssh2.stuge.se>
	<123.97ad0fc4affbf8cecadc76e01e9398cd@libssh2.stuge.se>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <123.97ad0fc4affbf8cecadc76e01e9398cd@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Sat, 26 Feb 2011 05:43:10 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Sat, 26 Feb 2011 05:43:02 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p1Q4h4oj013109

libssh2 Trac wrote:
> ---------------------------------------------------------------------------------------+
> Changes (by Peter Stuge <peter@…>):
> 
>   * owner:  => Peter Stuge <peter@…>
>   * status:  reopened => closed
>   * resolution:  => fixed

I used a trick here which I haven't documented before, but which has
been available on the server for a while now.

Commit messages can contain commands that automatically add a comment
to a ticket, and also optionally close it.

--8<-- commit_updater.py docs
Update tickets based on commit messages.

This component hooks into changeset notifications and searches commit
messages for text in the form of:
{{{
command #1
command #1, #2
command #1 & #2 
command #1 and #2
}}}

Instead of the short-hand syntax "#1", "ticket:1" can be used as well,
e.g.:
{{{
command ticket:1
command ticket:1, ticket:2
command ticket:1 & ticket:2 
command ticket:1 and ticket:2
}}}

In addition, the ':' character can be omitted and issue or bug can be used
instead of ticket.

You can have more than one command in a message. The following commands
are supported. There is more than one spelling for each command, to make
this as user-friendly as possible.

  close, closed, closes, fix, fixed, fixes::
    The specified tickets are closed, and the commit message is added to
    them as a comment.

  references, refs, addresses, re, see::
    The specified tickets are left in their current status, and the commit
    message is added to them as a comment. 

A fairly complicated example of what you can do is with a commit message
of:

    Changed blah and foo to do this or that. Fixes #10 and #12,
    and refs #12.

This will close #10 and #12, and add a note to #12.
-->8--


I forgot a setting that makes TracGit map email addresses to
registered user names, which is why it put my full name and email
instead of my username as owner. I've fixed the setting now, so next
time someone uses this it will work, as long as your email address
configured in Trac is the same as the email address configured in Git
when you create the commit.


//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Mon Feb 28 23:34:38 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1SMYGav011458;
	Mon, 28 Feb 2011 23:34:34 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p1SMYFlh011441
	for <libssh2-devel@cool.haxx.se>; Mon, 28 Feb 2011 23:34:15 +0100
Received: (qmail 371 invoked from network); 28 Feb 2011 22:34:17 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 28 Feb 2011 22:34:17 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Mon, 28 Feb 2011 22:34:17 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #211: size mismatch between struct transportpacket
	fields causes libssh2 to get stuck
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/211#comment:4
Message-ID: <123.c13ea96b4489941154298a1e72fd621a@libssh2.stuge.se>
References: <108.62cba77b47352402c1cd0687daecf8b2@libssh2.stuge.se>
X-Trac-Ticket-ID: 211
In-Reply-To: <108.62cba77b47352402c1cd0687daecf8b2@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Mon, 28 Feb 2011 23:34:38 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]); Mon, 28 Feb 2011 23:34:15 +0100 (CET)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p1SMYFlh011441
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p1SMYGav011458

#211: size mismatch between struct transportpacket fields causes libssh2 to get
stuck
---------------------------------------------------------------------------------------+
  Reporter:  www.google.com/accounts/o8/id?id=aitoawlhggg_yplkl7grwwpbbum-omtqud4rmna  |        Owner:  Peter Stuge <peter@…>       
      Type:  defect                                                                    |       Status:  closed                      
  Priority:  normal                                                                    |    Milestone:  1.2.8                       
 Component:  protocol                                                                  |      Version:  1.2.7                       
Resolution:  fixed                                                                     |     Keywords:                              
    Blocks:                                                                            |   Blocked By:                              
---------------------------------------------------------------------------------------+

Comment (by www.google.com/accounts/o8/id?id=aitoawlhggg_yplkl7grwwpbbum-omtqud4rmna):

 Replying to [comment:3 Peter Stuge <peter@…>]:
 > In [516fa7fdd9b55def83c124f223889c70b9e021ab/libssh2]:
 > {{{
 > #!CommitTicketReference repository="libssh2"
 revision="516fa7fdd9b55def83c124f223889c70b9e021ab"
 > Don't save allocated packet size until it has actually been allocated
 >
 Thanks for the fix. However won't this get us into trouble if there was a
 error after p->total_num was set (for example while decrypting a chunk).
 Now if we try to free a channel in response to that error, we would get
 the same problem as reported in comment #2.
 Jasmeet

-- 
Ticket URL: <http://trac.libssh2.org/ticket/211#comment:4>
libssh2 <http://trac.libssh2.org/>
C library for writing portable SSH2 clients

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

