From libssh2-devel-bounces@cool.haxx.se  Mon Aug  1 21:30:00 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p71JTXvv017571;
	Mon, 1 Aug 2011 21:29:56 +0200
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 p71JTVm9017552
	for <libssh2-devel@cool.haxx.se>; Mon, 1 Aug 2011 21:29:31 +0200
Date: Mon, 1 Aug 2011 21:29:31 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: not getting file handles
In-Reply-To: <4ED7646E-DC10-4C77-9BE1-F7CD538DE5C5@cirrusthinking.eu>
Message-ID: <alpine.DEB.2.00.1108012129000.11717@tvnag.unkk.fr>
References: <4ED7646E-DC10-4C77-9BE1-F7CD538DE5C5@cirrusthinking.eu>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Mon, 01 Aug 2011 21:30:00 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Mon, 01 Aug 2011 21:29:31 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Wed, 27 Jul 2011, Alessandro Diaferia wrote:

> I'm experiencing some issues with LIBSSH2_SFTP_HANDLEs. Suddenly in my app I 
> cannot manage anymore to get valid file handles for files I'm 100% sure they 
> exist. And I cannot really track exactly when this happens since it looks 
> sudden to me. Every time it occurs, programmatically disconnecting and 
> re-connecting my ssh session fixes the issue. Do you have any hint for me?

Do you open many handles? The server might deny you to open any more at any 
time it sees fit.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Thu Aug  4 04:12:49 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p742CJE0028855;
	Thu, 4 Aug 2011 04:12:44 +0200
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 p742CHHS028850
	for <libssh2-devel@cool.haxx.se>; Thu, 4 Aug 2011 04:12:17 +0200
Received: (qmail 23804 invoked from network); 4 Aug 2011 02:12:15 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 4 Aug 2011 02:12:15 -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, 04 Aug 2011 02:12:15 -0000
X-URL: http://trac.libssh2.org/
Subject: [libssh2] #221: getttimeofday namespace pollution in windows build
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/221
Message-ID: <046.92f1013e089c02a81209e02a230e15d3@libssh2.stuge.se>
X-Trac-Ticket-ID: 221
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 04 Aug 2011 04:12:49 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 04 Aug 2011 04:12:17 +0200 (CEST)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p742CHHS028850
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

#221: getttimeofday namespace pollution in windows build
-------------------------+--------------------------------------------------
  Reporter:  billsegall  |       Owner:       
      Type:  defect      |      Status:  new  
  Priority:  normal      |   Milestone:  1.2.9
 Component:  misc        |     Version:  1.2.8
  Keywords:  namespace   |      Blocks:       
Blocked By:              |  
-------------------------+--------------------------------------------------
 My project uses both libssh2 and net-snmp and I build both libraries
 statically for Win32. Unfortunately, both define a getttimeofday symbol
 which then conflicts when linking. The following patch to libssh2-1.2.28
 fixes this by renaming getttimeofday on the Windows platform.

 Thanks,
 Bill.

 --- misc.c.orig 2010-12-22 23:32:23.000000000 +1000
 +++ misc.c      2011-08-03 10:29:46.666602903 +1000
 @@ -418,7 +418,11 @@
          }
      }

 +#if defined(LIBSSH2_WIN32) && !defined(__MINGW32__)
 +    libssh2_gettimeofday(&now, NULL);
 +#else
      gettimeofday(&now, NULL);
 +#endif
      if(!firstsec) {
          firstsec = now.tv_sec;
      }
 @@ -586,7 +590,7 @@
  #define _W32_FT_OFFSET (116444736000000000)


 -int __cdecl gettimeofday(struct timeval *tp,
 +int __cdecl libssh2_gettimeofday(struct timeval *tp,
                           void *tzp)
   {
    union {

-- 
Ticket URL: <http://trac.libssh2.org/ticket/221>
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  Fri Aug  5 20:12:14 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p75IBl61008053;
	Fri, 5 Aug 2011 20:12:09 +0200
Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com
	[209.85.216.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p75IBjPA008015
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 5 Aug 2011 20:11:46 +0200
Received: by qyk9 with SMTP id 9so1706502qyk.20
	for <libssh2-devel@cool.haxx.se>; Fri, 05 Aug 2011 11:11:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=A/euwXdUvynGf9xVMh9pRIIZGdXbTVAOozIas9pYyqo=;
	b=ow8GJhzoVi2lBtC1mTg1+yei1KGV3bryoG/EuPD/QfT+yjpT0wubOaTTm8b/YubY5G
	YH7KCiV07zrGtLxaQ0YxxgA6bEzQdgh0O/v8IhlJXLGuJhD0x9PStVXfYJcdctMaqb7m
	CEerulCV2EuTyUvjS0WdPrenVywz4i2kY+7Ig=
MIME-Version: 1.0
Received: by 10.229.101.93 with SMTP id b29mr2017194qco.112.1312567904426;
	Fri, 05 Aug 2011 11:11:44 -0700 (PDT)
Received: by 10.229.24.199 with HTTP; Fri, 5 Aug 2011 11:11:44 -0700 (PDT)
Date: Fri, 5 Aug 2011 11:11:44 -0700
Message-ID: <CAPYUv_7Bv6=HUX=xz7zdcHMkSYmyWju+0s-4HeF17QW363h4XQ@mail.gmail.com>
Subject: pkg-config issue 1.2.8
From: "A. Mark" <gougolith@gmail.com>
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 05 Aug 2011 20:12:14 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 05 Aug 2011 20:11:46 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============2140885267=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============2140885267==
Content-Type: multipart/alternative; boundary=001636499237afdc3c04a9c607bc

--001636499237afdc3c04a9c607bc
Content-Type: text/plain; charset=ISO-8859-1

Hi,

It appears that `pkg-config libssh2 --modversion` does not retrurn any
sensible version information thus cmake version detection fails.

A.Mark.S

--001636499237afdc3c04a9c607bc
Content-Type: text/html; charset=ISO-8859-1

Hi,<br><br>It appears that `pkg-config libssh2 --modversion` does not retrurn any sensible version information thus cmake version detection fails.<br><br>A.Mark.S<br>

--001636499237afdc3c04a9c607bc--

--===============2140885267==
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

--===============2140885267==--

From libssh2-devel-bounces@cool.haxx.se  Fri Aug  5 22:10:24 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p75KA8xp004102;
	Fri, 5 Aug 2011 22:10:23 +0200
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 p75KA7H1004093
	for <libssh2-devel@cool.haxx.se>; Fri, 5 Aug 2011 22:10:07 +0200
Date: Fri, 5 Aug 2011 22:10:07 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: pkg-config issue 1.2.8
In-Reply-To: <CAPYUv_7Bv6=HUX=xz7zdcHMkSYmyWju+0s-4HeF17QW363h4XQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108052209330.12158@tvnag.unkk.fr>
References: <CAPYUv_7Bv6=HUX=xz7zdcHMkSYmyWju+0s-4HeF17QW363h4XQ@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 05 Aug 2011 22:10:24 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 05 Aug 2011 22:10:07 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Fri, 5 Aug 2011, A. Mark wrote:

> It appears that `pkg-config libssh2 --modversion` does not retrurn any 
> sensible version information thus cmake version detection fails.

I don't understand why. Doesn't that use the Version: field from the .pc file? 
Doesn't libssh2.pc get the current version number set in there?

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Fri Aug  5 23:00:45 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p75L0Z3U027944;
	Fri, 5 Aug 2011 23:00:43 +0200
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p75L0WJp027751
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 5 Aug 2011 23:00:33 +0200
Received: by qwc9 with SMTP id 9so6499qwc.41
	for <libssh2-devel@cool.haxx.se>; Fri, 05 Aug 2011 14:00:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=CiK+CTUU9ZoRW0PpvWn/Xh7hKVeFkJ/cT0v8+yGBv8s=;
	b=xPeSJ3cAgC35hxc64IiB/VNA6LNUmEiuLZJ4iXC4svXii92Km/O1rmZ9Sq3WogmIBs
	08fpMgqnZ5fNL0fMEtyfXTSexGkHiaIDtJ2EZj72+ZeXW7kE0QqagdzVvL1GMICJZ3jF
	rP6vcX00ci8rcRuX00KHHs7NwiabI8P9VwRrA=
MIME-Version: 1.0
Received: by 10.229.78.164 with SMTP id l36mr2102823qck.226.1312578031809;
	Fri, 05 Aug 2011 14:00:31 -0700 (PDT)
Received: by 10.229.24.199 with HTTP; Fri, 5 Aug 2011 14:00:31 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108052209330.12158@tvnag.unkk.fr>
References: <CAPYUv_7Bv6=HUX=xz7zdcHMkSYmyWju+0s-4HeF17QW363h4XQ@mail.gmail.com>
	<alpine.DEB.2.00.1108052209330.12158@tvnag.unkk.fr>
Date: Fri, 5 Aug 2011 14:00:31 -0700
Message-ID: <CAPYUv_4ZC3m1V=y2OWNokUHSAvCKiE0kiM=neO5=rZjUJRuxUQ@mail.gmail.com>
Subject: Re: pkg-config issue 1.2.8
From: "A. Mark" <gougolith@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 05 Aug 2011 23:00:45 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 05 Aug 2011 23:00:33 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1991358895=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1991358895==
Content-Type: multipart/alternative; boundary=002354470c8053738604a9c8637d

--002354470c8053738604a9c8637d
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Aug 5, 2011 at 1:10 PM, Daniel Stenberg <daniel@haxx.se> wrote:

> I don't understand why. Doesn't that use the Version: field from the .pc
> file? Doesn't libssh2.pc get the current version number set in there?
>
>
Yes it should, but this is what's inside... and so you only get "-".

###########################################################################
# libssh2 installation details
###########################################################################

prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: libssh2
URL: http://www.libssh2.org/
Description: Library for SSH based connunication
Version: -
Libs: -L${libdir} -lssh2
Libs.private:
Cflags: -I${includedir}


A.Mark.S

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

<br><div class=3D"gmail_quote">On Fri, Aug 5, 2011 at 1:10 PM, Daniel Stenb=
erg <span dir=3D"ltr">&lt;<a href=3D"mailto:daniel@haxx.se">daniel@haxx.se<=
/a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:=
 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left=
: 1ex;">

I don&#39;t understand why. Doesn&#39;t that use the Version: field from th=
e .pc file? Doesn&#39;t libssh2.pc get the current version number set in th=
ere?<br><font color=3D"#888888">
<br></font></blockquote><br>Yes it should, but this is what&#39;s inside...=
 and so you only get &quot;-&quot;.<br>
<br>
###########################################################################=
<br>
# libssh2 installation details<br>
###########################################################################=
<br>
<br>
prefix=3D/usr/local<br>
exec_prefix=3D${prefix}<br>
libdir=3D${exec_prefix}/lib<br>
includedir=3D${prefix}/include<br>
<br>
Name: libssh2<br>
URL: <a href=3D"http://www.libssh2.org/">http://www.libssh2.org/</a><br>
Description: Library for SSH based connunication<br>
Version: -<br>
Libs: -L${libdir} -lssh2=A0 <br>
Libs.private: <br>
Cflags: -I${includedir}<br><br><br>A.Mark.S<br>
<br></div>

--002354470c8053738604a9c8637d--

--===============1991358895==
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

--===============1991358895==--

From libssh2-devel-bounces@cool.haxx.se  Fri Aug  5 23:04:47 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p75L4jT9032567;
	Fri, 5 Aug 2011 23:04:47 +0200
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 p75L4hKE032505
	for <libssh2-devel@cool.haxx.se>; Fri, 5 Aug 2011 23:04:43 +0200
Date: Fri, 5 Aug 2011 23:04:43 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: pkg-config issue 1.2.8
In-Reply-To: <CAPYUv_4ZC3m1V=y2OWNokUHSAvCKiE0kiM=neO5=rZjUJRuxUQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108052303520.12158@tvnag.unkk.fr>
References: <CAPYUv_7Bv6=HUX=xz7zdcHMkSYmyWju+0s-4HeF17QW363h4XQ@mail.gmail.com>
	<alpine.DEB.2.00.1108052209330.12158@tvnag.unkk.fr>
	<CAPYUv_4ZC3m1V=y2OWNokUHSAvCKiE0kiM=neO5=rZjUJRuxUQ@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 05 Aug 2011 23:04:47 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 05 Aug 2011 23:04:43 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Fri, 5 Aug 2011, A. Mark wrote:

>> I don't understand why. Doesn't that use the Version: field from the .pc 
>> file? Doesn't libssh2.pc get the current version number set in there?
>>
> Yes it should, but this is what's inside... and so you only get "-".

Ah right, now I remember. That problem existed in 1.2.8 but has been fixed 
since in git. See commit f0a37bdadc311b...

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Fri Aug  5 23:52:53 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p75LpmEK021728;
	Fri, 5 Aug 2011 23:52:49 +0200
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 p75LpllM021724
	for <libssh2-devel@cool.haxx.se>; Fri, 5 Aug 2011 23:51:47 +0200
Received: (qmail 25484 invoked from network); 5 Aug 2011 21:51:51 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 5 Aug 2011 21:51:51 -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: Fri, 05 Aug 2011 21:51:51 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #221: getttimeofday namespace pollution in windows build
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/221#comment:1
Message-ID: <061.2851a532ea1bce8779dfd01dcbcbeae0@libssh2.stuge.se>
References: <046.92f1013e089c02a81209e02a230e15d3@libssh2.stuge.se>
X-Trac-Ticket-ID: 221
In-Reply-To: <046.92f1013e089c02a81209e02a230e15d3@libssh2.stuge.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 05 Aug 2011 23:52:53 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 05 Aug 2011 23:51:47 +0200 (CEST)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p75LpllM021724
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

#221: getttimeofday namespace pollution in windows build
-------------------------+--------------------------------------------------
  Reporter:  billsegall  |        Owner:           
      Type:  defect      |       Status:  closed   
  Priority:  normal      |    Milestone:  1.2.9    
 Component:  misc        |      Version:  1.2.8    
Resolution:  fixed       |     Keywords:  namespace
    Blocks:              |   Blocked By:           
-------------------------+--------------------------------------------------
Changes (by bagder):

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


Comment:

 commit 79f48e48813322d1 fixes this, using your approach as inspiration but
 slightly extended.

 Thanks a lot for reporting!

-- 
Ticket URL: <http://trac.libssh2.org/ticket/221#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 Aug  9 23:19:18 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p79LItqN011549;
	Tue, 9 Aug 2011 23:19:13 +0200
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 p79LIsga011545
	for <libssh2-devel@cool.haxx.se>; Tue, 9 Aug 2011 23:18:54 +0200
Date: Tue, 9 Aug 2011 23:18:54 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: release time coming
Message-ID: <alpine.DEB.2.00.1108092317200.3973@tvnag.unkk.fr>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 09 Aug 2011 23:19:17 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 09 Aug 2011 23:18:54 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

Hi friends,

I think it is about time to put together a new release to make sure more 
people use our latest bug fixes etc.

My plan is thus to release libssh2 1.2.9 in exactly 7 days, on August 16th.

If you want things merged/added before then, please speak up and/or remind us 
about them!

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Tue Aug  9 23:35:18 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p79LZCAC019197;
	Tue, 9 Aug 2011 23:35:17 +0200
Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com
	[209.85.212.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p79LZ938019016
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 9 Aug 2011 23:35:10 +0200
Received: by vws18 with SMTP id 18so530877vws.41
	for <libssh2-devel@cool.haxx.se>; Tue, 09 Aug 2011 14:35:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=lqg37s5YAEHb3gpIsXj3niOEbItlkgOntM1wT7f1Fxw=;
	b=SWVFzK0Ho+lGpO9h9dp18t7dO68DdaKIhHkJu/Dn4p17jA37zZoFeyhAmq5rmE3exF
	pby6Nh7i438FU9HSA6ll9+xIZpa4fj43GQBeIkEfK3hYvG3Aed9MZHFcDiuRCie/IM7Z
	4ZyHBID7hMkbY2m1hQuQo8YXbl/9y5T9AsTrs=
MIME-Version: 1.0
Received: by 10.220.98.133 with SMTP id q5mr475435vcn.199.1312925710050; Tue,
	09 Aug 2011 14:35:10 -0700 (PDT)
Received: by 10.220.194.205 with HTTP; Tue, 9 Aug 2011 14:35:09 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108092317200.3973@tvnag.unkk.fr>
References: <alpine.DEB.2.00.1108092317200.3973@tvnag.unkk.fr>
Date: Tue, 9 Aug 2011 23:35:09 +0200
Message-ID: <CAMq1adoTGtUELQ5VxK5zKTO0itU97pTmjPG7M2XUH320kcmHAw@mail.gmail.com>
Subject: Re: release time coming
From: Vincent Torri <vincent.torri@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 09 Aug 2011 23:35:18 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 09 Aug 2011 23:35:10 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1627490248=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1627490248==
Content-Type: multipart/alternative; boundary=0016e646a3cc9063ec04aa195642

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

On Tue, Aug 9, 2011 at 11:18 PM, Daniel Stenberg <daniel@haxx.se> wrote:

> Hi friends,
>
> I think it is about time to put together a new release to make sure more
> people use our latest bug fixes etc.
>
> My plan is thus to release libssh2 1.2.9 in exactly 7 days, on August 16th.
>
> If you want things merged/added before then, please speak up and/or remind
> us about them!
>

I guess it's too late to add nettle support, right ?

Vincent Torri

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

<br><br><div class=3D"gmail_quote">On Tue, Aug 9, 2011 at 11:18 PM, Daniel =
Stenberg <span dir=3D"ltr">&lt;<a href=3D"mailto:daniel@haxx.se">daniel@hax=
x.se</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi friends,<br>
<br>
I think it is about time to put together a new release to make sure more pe=
ople use our latest bug fixes etc.<br>
<br>
My plan is thus to release libssh2 1.2.9 in exactly 7 days, on August 16th.=
<br>
<br>
If you want things merged/added before then, please speak up and/or remind =
us about them!<br></blockquote><div><br>I guess it&#39;s too late to add ne=
ttle support, right ?<br><br>Vincent Torri <br></div></div>

--0016e646a3cc9063ec04aa195642--

--===============1627490248==
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

--===============1627490248==--

From libssh2-devel-bounces@cool.haxx.se  Tue Aug  9 23:36:51 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p79Laml4019681;
	Tue, 9 Aug 2011 23:36:50 +0200
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 p79LalWZ019676
	for <libssh2-devel@cool.haxx.se>; Tue, 9 Aug 2011 23:36:47 +0200
Date: Tue, 9 Aug 2011 23:36:47 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: release time coming
In-Reply-To: <CAMq1adoTGtUELQ5VxK5zKTO0itU97pTmjPG7M2XUH320kcmHAw@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108092335350.3973@tvnag.unkk.fr>
References: <alpine.DEB.2.00.1108092317200.3973@tvnag.unkk.fr>
	<CAMq1adoTGtUELQ5VxK5zKTO0itU97pTmjPG7M2XUH320kcmHAw@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 09 Aug 2011 23:36:51 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 09 Aug 2011 23:36:47 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Tue, 9 Aug 2011, Vincent Torri wrote:

> I guess it's too late to add nettle support, right ?

Well, if you want to work on that I guess we can postpone the release 
somewhat, or we can aim on doing a 1.3.0 release after 1.2.9 as soon as the 
nettle support is in and seems to work?

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Tue Aug  9 23:47:05 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p79Lkxbr028689;
	Tue, 9 Aug 2011 23:47:04 +0200
Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com
	[209.85.220.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p79Lkvkk028608
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 9 Aug 2011 23:46:58 +0200
Received: by vxh11 with SMTP id 11so528245vxh.41
	for <libssh2-devel@cool.haxx.se>; Tue, 09 Aug 2011 14:46:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=z3ePS1IOP7TVFL9DT0fMV/vc0IYmg60S+yu/88SdPK8=;
	b=B/1apYPuVkju+Qs49HixIU3NkFHmrrqNHqzgPD2mrOxwi45xqVfo8Gyjkq+cFnw4sE
	9Oh1pZEBTmB27Z6vAjPakVCJhHKJd2+zVvafBxfzuceStfwGcExAs6xsxTg4FPfFViUJ
	KFDfgDJLWGHb5r1XI7FdLyprnTIwMpeptTGI8=
MIME-Version: 1.0
Received: by 10.220.108.75 with SMTP id e11mr2049393vcp.164.1312926417654;
	Tue, 09 Aug 2011 14:46:57 -0700 (PDT)
Received: by 10.220.194.205 with HTTP; Tue, 9 Aug 2011 14:46:57 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108092335350.3973@tvnag.unkk.fr>
References: <alpine.DEB.2.00.1108092317200.3973@tvnag.unkk.fr>
	<CAMq1adoTGtUELQ5VxK5zKTO0itU97pTmjPG7M2XUH320kcmHAw@mail.gmail.com>
	<alpine.DEB.2.00.1108092335350.3973@tvnag.unkk.fr>
Date: Tue, 9 Aug 2011 23:46:57 +0200
Message-ID: <CAMq1adpXgPvEZMksOgyh-Rzvz4sCMyTeo3Dzp5Xrsy2rV+gVQg@mail.gmail.com>
Subject: Re: release time coming
From: Vincent Torri <vincent.torri@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 09 Aug 2011 23:47:05 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 09 Aug 2011 23:46:58 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1470484411=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1470484411==
Content-Type: multipart/alternative; boundary=f46d042f910cbd926304aa19807c

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

On Tue, Aug 9, 2011 at 11:36 PM, Daniel Stenberg <daniel@haxx.se> wrote:

> On Tue, 9 Aug 2011, Vincent Torri wrote:
>
>  I guess it's too late to add nettle support, right ?
>>
>
> Well, if you want to work on that I guess we can postpone the release
> somewhat, or we can aim on doing a 1.3.0 release after 1.2.9 as soon as the
> nettle support is in and seems to work?
>

unfortunately, i'm just a user of libssh2, I have no knowledge of security
stuff :( If nobody can't work on it, no problem. I guess that there are some
important bug fixes, so don't postpone.

Vincent Torri

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

<br><br><div class=3D"gmail_quote">On Tue, Aug 9, 2011 at 11:36 PM, Daniel =
Stenberg <span dir=3D"ltr">&lt;<a href=3D"mailto:daniel@haxx.se">daniel@hax=
x.se</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class=3D"im">On Tue, 9 Aug 2011, Vincent Torri wrote:<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
I guess it&#39;s too late to add nettle support, right ?<br>
</blockquote>
<br></div>
Well, if you want to work on that I guess we can postpone the release somew=
hat, or we can aim on doing a 1.3.0 release after 1.2.9 as soon as the nett=
le support is in and seems to work?<br></blockquote><div><br>unfortunately,=
 i&#39;m just a user of libssh2, I have no knowledge of security stuff :( I=
f nobody can&#39;t work on it, no problem. I guess that there are some impo=
rtant bug fixes, so don&#39;t postpone.<br>
<br>Vincent Torri <br></div></div>

--f46d042f910cbd926304aa19807c--

--===============1470484411==
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

--===============1470484411==--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 10 17:26:56 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AFQZxL017982;
	Wed, 10 Aug 2011 17:26:52 +0200
Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com
	[209.85.213.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AFQXFd017959
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 10 Aug 2011 17:26:34 +0200
Received: by yxl31 with SMTP id 31so1067384yxl.41
	for <libssh2-devel@cool.haxx.se>; Wed, 10 Aug 2011 08:26:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=123U3abR4jLuxdfvtsfrEfReVndnvZ1bsQqF46lsCfY=;
	b=ECp/H49zHvB/K8vAoSJudQyaFixDSeQqZSp3t0fstefLNYtMfLC0Hg9j56cadYQRsc
	zV0RUUnWF37UQPvDP4M/iKve/GfNnYgAin5kf4J6rrjhLbeviikPrL6zHw0BYdMqXi6p
	tadV03llIjYhwPteglajGopUn0FB3Fv16o5fA=
MIME-Version: 1.0
Received: by 10.142.222.14 with SMTP id u14mr6884488wfg.309.1312989991098;
	Wed, 10 Aug 2011 08:26:31 -0700 (PDT)
Received: by 10.68.51.197 with HTTP; Wed, 10 Aug 2011 08:26:31 -0700 (PDT)
Date: Wed, 10 Aug 2011 17:26:31 +0200
Message-ID: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
Subject: writing to channel limited to 2 Mb?
From: =?ISO-8859-2?Q?Przemys=B3aw_Szczygielski?= <qus123@gmail.com>
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 10 Aug 2011 17:26:56 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 10 Aug 2011 17:26:34 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1631903663=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1631903663==
Content-Type: multipart/alternative; boundary=000e0cd144ba03593804aa284e58

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

Hello,

I am trying to implement my own file transfer protocol and encountered a
problem when client or server is connected via libssh2 (the protocol works
flawlessly on "normal" network).

I am writing small amounts of data (not more than 4096 bytes) to ssh
channel, using libssh2_channel_write_ex. Up to 2Mb sent, the function
returns actual bytes written. But around 2Mb (the boundary is not constant,
but it fails around  2093051, 2080764, 2083684 or 2092906) it begins
returning 0 and of course - no data reaches destination.

If I transfer a file that is a bit smaller than 2Mb - it goes through, the
channel gets OK response and I can send another less than 2Mb file (it seems
that reading my protocol's "OK" message from ssh channel somehow unclogs
it...)

I googled around for "libssh2" and "2097152" finding several posts
describing, I guess, similar problem.

This may be also connected with windows RDP protocol forwarded via
libssh2_channel_forward_listen_ex problem. I can connect to forwarded
channel and log in, but as soon as I log in and a huge amount of data
(current remote screen) is to be written to libssh channel, the connection
hangs - surely there's more than 2Mb of data written to the channel...

Is this a bug, a feature or am I just doing something wrong?

Regards,

Przemek.

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

Hello,<br><br>I am trying to implement my own file transfer protocol and en=
countered a problem when client or server is connected via libssh2 (the pro=
tocol works flawlessly on &quot;normal&quot; network).<br><br>I am writing =
small amounts of data (not more than 4096 bytes) to ssh channel, using libs=
sh2_channel_write_ex. Up to 2Mb sent, the function returns actual bytes wri=
tten. But around 2Mb (the boundary is not constant, but it fails around=A0 =
2093051, 2080764, 2083684 or 2092906) it begins returning 0 and of course -=
 no data reaches destination.<br>
<br>If I transfer a file that is a bit smaller than 2Mb - it goes through, =
the channel gets OK response and I can send another less than 2Mb file (it =
seems that reading my protocol&#39;s &quot;OK&quot; message from ssh channe=
l somehow unclogs it...)<br>
<br><span style=3D"color: rgb(128, 0, 128);">I googled around for &quot;lib=
ssh2&quot; and &quot;</span>2097152&quot; finding several posts describing,=
 I guess, similar problem. <br><br>This may be also connected with windows =
RDP protocol forwarded via libssh2_channel_forward_listen_ex problem. I can=
 connect to forwarded channel and log in, but as soon as I log in and a hug=
e amount of data (current remote screen) is to be written to libssh channel=
, the connection hangs - surely there&#39;s more than 2Mb of data written t=
o the channel...<br>
<br>Is this a bug, a feature or am I just doing something wrong?<br><br>Reg=
ards,<br><br>Przemek.<br><br>

--000e0cd144ba03593804aa284e58--

--===============1631903663==
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

--===============1631903663==--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 10 18:59:24 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AGx9dh004404;
	Wed, 10 Aug 2011 18:59:22 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AGx93W004393
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 10 Aug 2011 18:59:09 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7AGx8f6016145; Wed, 10 Aug 2011 16:59:11 GMT
Received: from henrik ([127.0.0.1]) (authenticated bits=0)
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7AGwsvG016385
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Wed, 10 Aug 2011 18:58:58 +0200
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>,
        =?UTF-8?Q?Przemys=C5=82aw?= Szczygielski <qus123@gmail.com>
Subject: Re: writing to channel limited to 2 Mb?
X-Mailer: Modest 3.2
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
In-Reply-To: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
Content-ID: <1312995532.1576.1.camel@Nokia-N900>
Date: Wed, 10 Aug 2011 18:58:53 +0200
Message-Id: <1312995533.1576.2.camel@Nokia-N900>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 10 Aug 2011 18:59:24 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Wed, 10 Aug 2011 18:59:09 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Wed, 10 Aug 2011 16:59:12 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>,
        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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p7AGx9dh004404

Are you sure it returns 0 and not an error?

And why such small writes if you are doing file transfers? Bigger writes makes better use of ssh framing and compression.


----- Ursprungsmeddelande -----
> Hello,
> 
> I am trying to implement my own file transfer protocol and encountered a
> problem when client or server is connected via libssh2 (the protocol
> works flawlessly on "normal" network).
> 
> I am writing small amounts of data (not more than 4096 bytes) to ssh
> channel, using libssh2_channel_write_ex. Up to 2Mb sent, the function
> returns actual bytes written. But around 2Mb (the boundary is not
> constant, but it fails aroundÂ   2093051, 2080764, 2083684 or 2092906) it
> begins returning 0 and of course - no data reaches destination.
> 
> If I transfer a file that is a bit smaller than 2Mb - it goes through,
> the channel gets OK response and I can send another less than 2Mb file
> (it seems that reading my protocol's "OK" message from ssh channel
> somehow unclogs it...)
> 
> I googled around for "libssh2" and "2097152" finding several posts
> describing, I guess, similar problem.
> 
> This may be also connected with windows RDP protocol forwarded via
> libssh2_channel_forward_listen_ex problem. I can connect to forwarded
> channel and log in, but as soon as I log in and a huge amount of data
> (current remote screen) is to be written to libssh channel, the
> connection hangs - surely there's more than 2Mb of data written to the
> channel...
> 
> Is this a bug, a feature or am I just doing something wrong?
> 
> Regards,
> 
> Przemek.

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

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 10 19:34:43 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AHYUXp023242;
	Wed, 10 Aug 2011 19:34:42 +0200
Received: from mail-pz0-f43.google.com (mail-pz0-f43.google.com
	[209.85.210.43])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AHYR8E023222
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 10 Aug 2011 19:34:29 +0200
Received: by pzk1 with SMTP id 1so3132822pzk.30
	for <libssh2-devel@cool.haxx.se>; Wed, 10 Aug 2011 10:34:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=i/HrXJ4hNYmhfqB1QhCJ9ZKUzmBDjqiaj3b3vZg1swg=;
	b=mjAVMI1agNav/JBvpW8CDe0fbe+wU2N/dEJ+DfMD5aD0jHUresXES3q++Ppq33YwoZ
	VyRqTq1dRvxz9sVJgCCFWIzqElw/sGCsNriTGMQlXQ/atQOQ8rQ7K+gEXaswN0Q7+fYq
	3QgGtArg8FFHSrQAYLRWYd+9momvXjb80U8/A=
MIME-Version: 1.0
Received: by 10.142.169.4 with SMTP id r4mr7695090wfe.423.1312997666728; Wed,
	10 Aug 2011 10:34:26 -0700 (PDT)
Received: by 10.68.51.197 with HTTP; Wed, 10 Aug 2011 10:34:26 -0700 (PDT)
In-Reply-To: <1312995533.1576.2.camel@Nokia-N900>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<1312995533.1576.2.camel@Nokia-N900>
Date: Wed, 10 Aug 2011 19:34:26 +0200
Message-ID: <CAD+sJOM0DbujUPbMXR2eNDexZA2f7evHbYSEdDhupTOOm23Kqw@mail.gmail.com>
Subject: Re: writing to channel limited to 2 Mb?
From: =?ISO-8859-2?Q?Przemys=B3aw_Szczygielski?= <qus123@gmail.com>
To: =?ISO-8859-1?Q?Henrik_Nordstr=F6m?= <henrik@henriknordstrom.net>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 10 Aug 2011 19:34:43 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 10 Aug 2011 19:34:29 +0200 (CEST)
Cc: libssh2 development <libssh2-devel@cool.haxx.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1003596024=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1003596024==
Content-Type: multipart/alternative; boundary=000e0cd331dc842d2d04aa2a1776

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

Wel, I'd say I am pretty sure... look at below code:

qint64 QxtSshChannel::writeData(const char* buff, qint64 len){
    ssize_t ret=3Dlibssh2_channel_write_ex(d->d_channel,
d->d_write_stream_id,buff, len);
    if(ret<0){
        if(ret=3D=3DLIBSSH2_ERROR_EAGAIN){
            return 0;
        }else{
#ifdef QXT_DEBUG_SSH
            qDebug()<<"write err"<<ret;
#endif
            return -1;
        }
    }
    if (len!=3Dret)
    {
        qDebug()<<QString("QxtSshChannel::writeData ******FKUP!!!! ssh wrot=
e
less than it should!!! (%1/%2)").arg(ret).arg(len);
    }

    return ret;
}

Don't mind small writes, it's just testing stage, I will make it bigger
later. Also - this protocol is not based on ssh, as I have stated. It works
via TCP/IP (withour a problem) but when one party is on SSH forwarded port,
write to SSH port fails...

W dniu 10 sierpnia 2011 18:58 u=BFytkownik Henrik Nordstr=F6m <
henrik@henriknordstrom.net> napisa=B3:

> Are you sure it returns 0 and not an error?
>
> And why such small writes if you are doing file transfers? Bigger writes
> makes better use of ssh framing and compression.
>
>
> ----- Ursprungsmeddelande -----
> > Hello,
> >
> > I am trying to implement my own file transfer protocol and encountered =
a
> > problem when client or server is connected via libssh2 (the protocol
> > works flawlessly on "normal" network).
> >
> > I am writing small amounts of data (not more than 4096 bytes) to ssh
> > channel, using libssh2_channel_write_ex. Up to 2Mb sent, the function
> > returns actual bytes written. But around 2Mb (the boundary is not
> > constant, but it fails around   2093051, 2080764, 2083684 or 2092906) i=
t
> > begins returning 0 and of course - no data reaches destination.
> >
> > If I transfer a file that is a bit smaller than 2Mb - it goes through,
> > the channel gets OK response and I can send another less than 2Mb file
> > (it seems that reading my protocol's "OK" message from ssh channel
> > somehow unclogs it...)
> >
> > I googled around for "libssh2" and "2097152" finding several posts
> > describing, I guess, similar problem.
> >
> > This may be also connected with windows RDP protocol forwarded via
> > libssh2_channel_forward_listen_ex problem. I can connect to forwarded
> > channel and log in, but as soon as I log in and a huge amount of data
> > (current remote screen) is to be written to libssh channel, the
> > connection hangs - surely there's more than 2Mb of data written to the
> > channel...
> >
> > Is this a bug, a feature or am I just doing something wrong?
> >
> > Regards,
> >
> > Przemek.
>
>

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

Wel, I&#39;d say I am pretty sure... look at below code:<br><br>qint64 QxtS=
shChannel::writeData(const char* buff, qint64 len){<br>=A0=A0=A0 ssize_t re=
t=3Dlibssh2_channel_write_ex(d-&gt;d_channel, d-&gt;d_write_stream_id,buff,=
 len);<br>
=A0=A0=A0 if(ret&lt;0){<br>=A0=A0=A0=A0=A0=A0=A0 if(ret=3D=3DLIBSSH2_ERROR_=
EAGAIN){<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return 0;<br>=A0=A0=A0=A0=A0=
=A0=A0 }else{<br>#ifdef QXT_DEBUG_SSH<br>=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
qDebug()&lt;&lt;&quot;write err&quot;&lt;&lt;ret;<br>#endif<br>=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0 return -1;<br>
=A0=A0=A0=A0=A0=A0=A0 }<br>=A0=A0=A0 }<br>=A0=A0=A0 if (len!=3Dret)<br>=A0=
=A0=A0 {<br>=A0=A0=A0=A0=A0=A0=A0 qDebug()&lt;&lt;QString(&quot;QxtSshChann=
el::writeData ******FKUP!!!! ssh wrote less than it should!!! (%1/%2)&quot;=
).arg(ret).arg(len);<br>=A0=A0=A0 }<br><br>=A0=A0=A0 return ret;<br>
}<br><br>Don&#39;t mind small writes, it&#39;s just testing stage, I will m=
ake it bigger later. Also - this protocol is not based on ssh, as I have st=
ated. It works via TCP/IP (withour a problem) but when one party is on SSH =
forwarded port, write to SSH port fails...<br>
<br><div class=3D"gmail_quote">W dniu 10 sierpnia 2011 18:58 u=BFytkownik H=
enrik Nordstr=F6m <span dir=3D"ltr">&lt;<a href=3D"mailto:henrik@henriknord=
strom.net">henrik@henriknordstrom.net</a>&gt;</span> napisa=B3:<br><blockqu=
ote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: =
1px solid rgb(204, 204, 204); padding-left: 1ex;">
Are you sure it returns 0 and not an error?<br>
<br>
And why such small writes if you are doing file transfers? Bigger writes ma=
kes better use of ssh framing and compression.<br>
<br>
<br>
----- Ursprungsmeddelande -----<br>
<div><div></div><div class=3D"h5">&gt; Hello,<br>
&gt;<br>
&gt; I am trying to implement my own file transfer protocol and encountered=
 a<br>
&gt; problem when client or server is connected via libssh2 (the protocol<b=
r>
&gt; works flawlessly on &quot;normal&quot; network).<br>
&gt;<br>
&gt; I am writing small amounts of data (not more than 4096 bytes) to ssh<b=
r>
&gt; channel, using libssh2_channel_write_ex. Up to 2Mb sent, the function<=
br>
&gt; returns actual bytes written. But around 2Mb (the boundary is not<br>
&gt; constant, but it fails around=A0 =A02093051, 2080764, 2083684 or 20929=
06) it<br>
&gt; begins returning 0 and of course - no data reaches destination.<br>
&gt;<br>
&gt; If I transfer a file that is a bit smaller than 2Mb - it goes through,=
<br>
&gt; the channel gets OK response and I can send another less than 2Mb file=
<br>
&gt; (it seems that reading my protocol&#39;s &quot;OK&quot; message from s=
sh channel<br>
&gt; somehow unclogs it...)<br>
&gt;<br>
&gt; I googled around for &quot;libssh2&quot; and &quot;2097152&quot; findi=
ng several posts<br>
&gt; describing, I guess, similar problem.<br>
&gt;<br>
&gt; This may be also connected with windows RDP protocol forwarded via<br>
&gt; libssh2_channel_forward_listen_ex problem. I can connect to forwarded<=
br>
&gt; channel and log in, but as soon as I log in and a huge amount of data<=
br>
&gt; (current remote screen) is to be written to libssh channel, the<br>
&gt; connection hangs - surely there&#39;s more than 2Mb of data written to=
 the<br>
&gt; channel...<br>
&gt;<br>
&gt; Is this a bug, a feature or am I just doing something wrong?<br>
&gt;<br>
&gt; Regards,<br>
&gt;<br>
&gt; Przemek.<br>
<br>
</div></div></blockquote></div><br>

--000e0cd331dc842d2d04aa2a1776--

--===============1003596024==
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

--===============1003596024==--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 10 19:44:04 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AHi06j030358;
	Wed, 10 Aug 2011 19:44:03 +0200
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 p7AHhxJM030327
	for <libssh2-devel@cool.haxx.se>; Wed, 10 Aug 2011 19:43:59 +0200
Date: Wed, 10 Aug 2011 19:43:59 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: writing to channel limited to 2 Mb?
In-Reply-To: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED;
	BOUNDARY="1129329158-1068927256-1312998173=:28155"
Content-ID: <alpine.DEB.2.00.1108101943020.28155@tvnag.unkk.fr>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 10 Aug 2011 19:44:04 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 10 Aug 2011 19:43:59 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-1068927256-1312998173=:28155
Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.DEB.2.00.1108101943021.28155@tvnag.unkk.fr>

On Wed, 10 Aug 2011, Przemys³aw Szczygielski wrote:

> I am writing small amounts of data (not more than 4096 bytes) to ssh 
> channel, using libssh2_channel_write_ex. Up to 2Mb sent, the function 
> returns actual bytes written. But around 2Mb (the boundary is not constant, 
> but it fails around 2093051, 2080764, 2083684 or 2092906) it begins 
> returning 0 and of course - no data reaches destination.

0 is not an error and is not the end of the stream though. It just meant that 
no payload data was sent.

What do you do after you get the 0 return code?

-- 

  / daniel.haxx.se
--1129329158-1068927256-1312998173=:28155
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

--1129329158-1068927256-1312998173=:28155--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 10 19:56:46 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AHudP7005640;
	Wed, 10 Aug 2011 19:56:44 +0200
Received: from mail-pz0-f43.google.com (mail-pz0-f43.google.com
	[209.85.210.43])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AHuZGS005622
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 10 Aug 2011 19:56:36 +0200
Received: by pzk1 with SMTP id 1so3180418pzk.30
	for <libssh2-devel@cool.haxx.se>; Wed, 10 Aug 2011 10:56:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=lIjCXzuo9TIEeWlkfaFXJeAVLY392joRlNjZH6+ZdAI=;
	b=ZcK6Gx9BJhCMB03VD67TApqViS/pihyn5E4uX7rSEM3qRC5JkPmeVVX0YlhoOZFr5b
	kkwdMDbu3Ysw39umBRJz+Ix8XxI+bMqXFKaFjnk6CEYt6k1+ZuVEt7ttVj4VXpNbIhWa
	PrSoJayac8gi4lNzmJUSeQVyPQpU25QURDlOU=
MIME-Version: 1.0
Received: by 10.143.97.26 with SMTP id z26mr7241477wfl.81.1312998994511; Wed,
	10 Aug 2011 10:56:34 -0700 (PDT)
Received: by 10.68.51.197 with HTTP; Wed, 10 Aug 2011 10:56:34 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
Date: Wed, 10 Aug 2011 19:56:34 +0200
Message-ID: <CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
Subject: Re: writing to channel limited to 2 Mb?
From: =?ISO-8859-2?Q?Przemys=B3aw_Szczygielski?= <qus123@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 10 Aug 2011 19:56:45 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 10 Aug 2011 19:56:37 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1331213060=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1331213060==
Content-Type: multipart/alternative; boundary=0015174ff0e8a887de04aa2a66f1

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

Wait, wait? What do you mean no payload was sent? I can see in my debug
output how following 4096 byte packets get properly sent by writeData(const
char* buff, qint64 len). Then when about 2Mb of bytes is sent the attached
procedure will show:

QxtSshChannel::writeData ******FKUP!!!! ssh wrote less than it should!!!
(171/4096) // 171 is just some value, which shows that the packet fot
partially written! All following packets don't get written at all
QxtSshChannel::writeData ******FKUP!!!! ssh wrote less than it should!!!
(0/4096)
QxtSshChannel::writeData ******FKUP!!!! ssh wrote less than it should!!!
(0/4096)
QxtSshChannel::writeData ******FKUP!!!! ssh wrote less than it should!!!
(0/4096)
QxtSshChannel::writeData ******FKUP!!!! ssh wrote less than it should!!!
(0/4096)
.
.
.

Which shows clearly that writeData gets a buffer of 4096, but
libssh2_channel_write_ex at some point decides not to write it.

So this also answers your question - after ret is 0 I keep writing packets,
but I do this because I discovered only today, that writing to ssh channel
fails. So I don't really know what else should I do ;-)

W dniu 10 sierpnia 2011 19:43 u=BFytkownik Daniel Stenberg
<daniel@haxx.se>napisa=B3:

> On Wed, 10 Aug 2011, Przemys=B3aw Szczygielski wrote:
>
>  I am writing small amounts of data (not more than 4096 bytes) to ssh
>> channel, using libssh2_channel_write_ex. Up to 2Mb sent, the function
>> returns actual bytes written. But around 2Mb (the boundary is not consta=
nt,
>> but it fails around 2093051, 2080764, 2083684 or 2092906) it begins
>> returning 0 and of course - no data reaches destination.
>>
>
> 0 is not an error and is not the end of the stream though. It just meant
> that no payload data was sent.
>
> What do you do after you get the 0 return code?
>
> --
>
>  / daniel.haxx.se
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>
>

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

Wait, wait? What do you mean no payload was sent? I can see in my debug out=
put how following 4096 byte packets get properly sent by writeData(const ch=
ar* buff, qint64 len). Then when about 2Mb of bytes is sent the attached pr=
ocedure will show:<br>
<br>QxtSshChannel::writeData ******FKUP!!!! ssh wrote less than it should!!=
! (171/4096) // 171 is just some value, which shows that the packet fot par=
tially written! All following packets don&#39;t get written at all<br>QxtSs=
hChannel::writeData ******FKUP!!!! ssh wrote less than it should!!! (0/4096=
)<br>
QxtSshChannel::writeData ******FKUP!!!! ssh wrote less than it should!!! (0=
/4096)<br>QxtSshChannel::writeData ******FKUP!!!! ssh wrote less than it sh=
ould!!! (0/4096)<br>QxtSshChannel::writeData ******FKUP!!!! ssh wrote less =
than it should!!! (0/4096)<br>
.<br>.<br>.<br><br>Which shows clearly that writeData gets a buffer of 4096=
, but libssh2_channel_write_ex at some point decides not to write it.<br><b=
r>So this also answers your question - after ret is 0 I keep writing packet=
s, but I do this because I discovered only today, that writing to ssh chann=
el fails. So I don&#39;t really know what else should I do ;-)<br>
<br><div class=3D"gmail_quote">W dniu 10 sierpnia 2011 19:43 u=BFytkownik D=
aniel Stenberg <span dir=3D"ltr">&lt;<a href=3D"mailto:daniel@haxx.se">dani=
el@haxx.se</a>&gt;</span> napisa=B3:<br><blockquote class=3D"gmail_quote" s=
tyle=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204=
); padding-left: 1ex;">
<div class=3D"im">On Wed, 10 Aug 2011, Przemys=B3aw Szczygielski wrote:<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; borde=
r-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I am writing small amounts of data (not more than 4096 bytes) to ssh channe=
l, using libssh2_channel_write_ex. Up to 2Mb sent, the function returns act=
ual bytes written. But around 2Mb (the boundary is not constant, but it fai=
ls around 2093051, 2080764, 2083684 or 2092906) it begins returning 0 and o=
f course - no data reaches destination.<br>

</blockquote>
<br></div>
0 is not an error and is not the end of the stream though. It just meant th=
at no payload data was sent.<br>
<br>
What do you do after you get the 0 return code?<br><font color=3D"#888888">
<br>
-- <br>
<br>
=A0/ <a href=3D"http://daniel.haxx.se" target=3D"_blank">daniel.haxx.se</a>=
</font><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>
<br></blockquote></div><br>

--0015174ff0e8a887de04aa2a66f1--

--===============1331213060==
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

--===============1331213060==--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 10 20:01:29 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AI1J6h010322;
	Wed, 10 Aug 2011 20:01:27 +0200
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 p7AI1ICg010291
	for <libssh2-devel@cool.haxx.se>; Wed, 10 Aug 2011 20:01:18 +0200
Date: Wed, 10 Aug 2011 20:01:18 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: writing to channel limited to 2 Mb?
In-Reply-To: <CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED;
	BOUNDARY="1129329158-1360697132-1312999278=:28155"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 10 Aug 2011 20:01:29 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 10 Aug 2011 20:01:18 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-1360697132-1312999278=:28155
Content-Type: TEXT/PLAIN; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 8BIT

On Wed, 10 Aug 2011, Przemys³aw Szczygielski wrote:

(please don't top-post, it makes it hard to have a mail conversation)

> Wait, wait? What do you mean no payload was sent?

I meant that none of the bytes you provided in a buffer to libssh2 was sent. 
libssh2 might've sent a few "control bytes" though. The return code says how 
much of the provided data that was sent.

> I can see in my debug output how following 4096 byte packets get properly 
> sent by writeData(const char* buff, qint64 len). Then when about 2Mb of 
> bytes is sent the attached procedure will show:
>
> QxtSshChannel::writeData ******FKUP!!!! ssh wrote less than it should!!!
> (171/4096) // 171 is just some value, which shows that the packet fot
> partially written!

Right, this shows libssh2 only sent 171 bytes due to some reason. Possibly if 
you build debug-enabled and enabling tracing you'll see more details and an 
explanation to why it doesn't send more.

It almost looks as if there's no window given for the channel from the server 
for libssh2 to use.

> So this also answers your question - after ret is 0 I keep writing packets, 
> but I do this because I discovered only today, that writing to ssh channel 
> fails. So I don't really know what else should I do ;-)

debug! =)

-- 

  / daniel.haxx.se
--1129329158-1360697132-1312999278=:28155
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

--1129329158-1360697132-1312999278=:28155--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 10 20:07:57 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AI7qqf016659;
	Wed, 10 Aug 2011 20:07:56 +0200
Received: from mail-pz0-f43.google.com (mail-pz0-f43.google.com
	[209.85.210.43])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AI7nQN016628
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 10 Aug 2011 20:07:50 +0200
Received: by pzk1 with SMTP id 1so3204050pzk.30
	for <libssh2-devel@cool.haxx.se>; Wed, 10 Aug 2011 11:07:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=3n8vtydn31HdZ+fYHLzTTb3595Z6CDYSIq3LuPUio5M=;
	b=DkiPNjUnZAPyu/f9jZOeurr1wns/kMh59Bblie75XPLUVTEdV+3lHnS45il/aVu4Ys
	9D+fWShBcwlOXjz39IKLL5Avyo0eeD5JD2qj1zZ2UZWUn08LNoL4mdSmoGEFJalombao
	KnCIo5KiXGQwuy88KKy09lxcIszsu0IbUMpus=
MIME-Version: 1.0
Received: by 10.143.97.26 with SMTP id z26mr7245981wfl.81.1312999668265; Wed,
	10 Aug 2011 11:07:48 -0700 (PDT)
Received: by 10.68.51.197 with HTTP; Wed, 10 Aug 2011 11:07:48 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
Date: Wed, 10 Aug 2011 20:07:48 +0200
Message-ID: <CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
Subject: Re: writing to channel limited to 2 Mb?
From: =?ISO-8859-2?Q?Przemys=B3aw_Szczygielski?= <qus123@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 10 Aug 2011 20:07:57 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 10 Aug 2011 20:07:51 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1890296946=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1890296946==
Content-Type: multipart/alternative; boundary=0015174ff0e8d1342b04aa2a8e25

--0015174ff0e8d1342b04aa2a8e25
Content-Type: text/plain; charset=ISO-8859-1

> Right, this shows libssh2 only sent 171 bytes due to some reason. Possibly
> if you build debug-enabled and enabling tracing you'll see more details and
> an explanation to why it doesn't send more.
>
> It almost looks as if there's no window given for the channel from the
> server for libssh2 to use.


So you mean it might be ssh server's fault? Quite likely, this is SSH server
on OpenWRT, it might be somehow limited because of router's limited
resources.


>
>
>  So this also answers your question - after ret is 0 I keep writing
>> packets, but I do this because I discovered only today, that writing to ssh
>> channel fails. So I don't really know what else should I do ;-)
>>
>
> debug! =)
>
> OK, how do I enable that besides setting trace to proper flags? The problem
is this is libssh2 inside libqxt network, which outputs its debug output to
Qt Creator. I am able to see debug output of libqxt, but don't see anything
out of libssh2... Also - which flags do you recommend setting?

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

<br><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"m=
argin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); paddin=
g-left: 1ex;">Right, this shows libssh2 only sent 171 bytes due to some rea=
son. Possibly if you build debug-enabled and enabling tracing you&#39;ll se=
e more details and an explanation to why it doesn&#39;t send more.<br>

<br>
It almost looks as if there&#39;s no window given for the channel from the =
server for libssh2 to use.</blockquote><div><br>So you mean it might be ssh=
 server&#39;s fault? Quite likely, this is SSH server on OpenWRT, it might =
be somehow limited because of router&#39;s limited resources.<br>
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8=
ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div cla=
ss=3D"im"><br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; borde=
r-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
So this also answers your question - after ret is 0 I keep writing packets,=
 but I do this because I discovered only today, that writing to ssh channel=
 fails. So I don&#39;t really know what else should I do ;-)<br>
</blockquote>
<br></div>
debug! =3D)<br><font color=3D"#888888">
</font><br></blockquote><div><font color=3D"#888888">OK, how do I enable th=
at besides setting trace to proper flags? The problem is this is libssh2 in=
side libqxt network, which outputs its debug output to Qt Creator. I am abl=
e to see debug output of libqxt, but don&#39;t see anything out of libssh2.=
.. Also - which flags do you recommend setting?</font>=A0</div>
</div>

--0015174ff0e8d1342b04aa2a8e25--

--===============1890296946==
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

--===============1890296946==--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 10 20:21:46 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AILdQp022544;
	Wed, 10 Aug 2011 20:21:45 +0200
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 p7AILcuv022530
	for <libssh2-devel@cool.haxx.se>; Wed, 10 Aug 2011 20:21:38 +0200
Date: Wed, 10 Aug 2011 20:21:38 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: writing to channel limited to 2 Mb?
In-Reply-To: <CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="1129329158-98949636-1313000498=:28155"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 10 Aug 2011 20:21:46 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 10 Aug 2011 20:21:38 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-98949636-1313000498=:28155
Content-Type: TEXT/PLAIN; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 8BIT

On Wed, 10 Aug 2011, Przemys³aw Szczygielski wrote:

>> It almost looks as if there's no window given for the channel from the 
>> server for libssh2 to use.
>
> So you mean it might be ssh server's fault? Quite likely, this is SSH server 
> on OpenWRT, it might be somehow limited because of router's limited 
> resources.

Well, I can't really blame it without more details, I'm just making a blind 
guess around what it could be about.

>> debug! =)
>>
> OK, how do I enable that besides setting trace to proper flags?

You build libcurl with debug enabled (as in non-debug enabled libssh2 builds 
the trace function doesn't do anything).

> The problem is this is libssh2 inside libqxt network, which outputs its 
> debug output to Qt Creator. I am able to see debug output of libqxt, but 
> don't see anything out of libssh2...

And you have enabled libssh2 trace?

> Also - which flags do you recommend setting?

Set them all to start with: libssh2_trace(ssh_session, ~0)

-- 

  / daniel.haxx.se
--1129329158-98949636-1313000498=:28155
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

--1129329158-98949636-1313000498=:28155--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 10 22:34:15 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AKXtvc024809;
	Wed, 10 Aug 2011 22:34:13 +0200
Received: from mail-pz0-f43.google.com (mail-pz0-f43.google.com
	[209.85.210.43])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AKXq8G024793
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 10 Aug 2011 22:33:53 +0200
Received: by pzk1 with SMTP id 1so3477514pzk.30
	for <libssh2-devel@cool.haxx.se>; Wed, 10 Aug 2011 13:33:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=l229pwlcs48eY3dF4jBi1awhUMgK2asvEH1c5fykx04=;
	b=nNP+qcaOIMkm293PDzyV43uoZ8sDJzubtiNNQHUegtrtE9oSA9cJZlmbjfz+swKo/k
	dtZPIPmd+dEJAErNQO7ggggOrzHmK6Yu0H+/BbhGA9wGI/cy6dHypgvOR6JQmZS5KW65
	0kEW+5IZjnNDLZIFTAqqFWAcR4Hmyk/5j/O8A=
MIME-Version: 1.0
Received: by 10.143.97.26 with SMTP id z26mr7306387wfl.81.1313008431824; Wed,
	10 Aug 2011 13:33:51 -0700 (PDT)
Received: by 10.68.51.197 with HTTP; Wed, 10 Aug 2011 13:33:51 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
Date: Wed, 10 Aug 2011 22:33:51 +0200
Message-ID: <CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
Subject: Re: writing to channel limited to 2 Mb?
From: =?ISO-8859-2?Q?Przemys=B3aw_Szczygielski?= <qus123@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 10 Aug 2011 22:34:15 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 10 Aug 2011 22:33:54 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1533673772=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1533673772==
Content-Type: multipart/alternative; boundary=0015174ff0e82a7f3104aa2c9903

--0015174ff0e82a7f3104aa2c9903
Content-Type: text/plain; charset=ISO-8859-1

OK, so one last question. As I am not very fluent with SSH terminology, I am
sure you would be able to answer me without digging into docs. Is it
possible that my problem is because "The default session window in OpenSSH
is 2MB already."?

--0015174ff0e82a7f3104aa2c9903
Content-Type: text/html; charset=ISO-8859-1

OK, so one last question. As I am not very fluent with SSH terminology, I am sure you would be able to answer me without digging into docs. Is it possible that my problem is because &quot;The default session window in OpenSSH is 2MB already.&quot;?

--0015174ff0e82a7f3104aa2c9903--

--===============1533673772==
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

--===============1533673772==--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 10 22:49:19 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AKnERl030827;
	Wed, 10 Aug 2011 22:49:18 +0200
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 p7AKnD9g030821
	for <libssh2-devel@cool.haxx.se>; Wed, 10 Aug 2011 22:49:13 +0200
Date: Wed, 10 Aug 2011 22:49:13 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: writing to channel limited to 2 Mb?
In-Reply-To: <CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED;
	BOUNDARY="1129329158-822929720-1313009353=:28768"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 10 Aug 2011 22:49:19 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 10 Aug 2011 22:49:13 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-822929720-1313009353=:28768
Content-Type: TEXT/PLAIN; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 8BIT

On Wed, 10 Aug 2011, Przemys³aw Szczygielski wrote:

> OK, so one last question. As I am not very fluent with SSH terminology, I am 
> sure you would be able to answer me without digging into docs. Is it 
> possible that my problem is because "The default session window in OpenSSH 
> is 2MB already."?

Not really.

In SSH, each channel tells the other side a window with how much data that it 
can accept. You then know how much data you can send to the other side. In 
typical scenarios the other side then send updates to the window along the way 
to inform that it is ready to receive more data.

In order to reach a good flow and transfer speed, you never let the window 
size reach zero. Of course there might still be cases where you really cannot 
accept more data for the moment and then you tell the other side to not send 
more by setting the window to 0.

If the default window size is 2MB then each channel by default will accept 2MB 
of data, but that doesn't say what it does with the window once the transfer 
is in progress.

-- 

  / daniel.haxx.se
--1129329158-822929720-1313009353=:28768
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

--1129329158-822929720-1313009353=:28768--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 00:04:20 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AM40fM032316;
	Thu, 11 Aug 2011 00:04:17 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AM3xdY032307
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 00:03:59 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7AM430D001926
	for <libssh2-devel@cool.haxx.se>; Wed, 10 Aug 2011 22:04:04 GMT
Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged))
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7AM42wx003704
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 00:04:02 +0200
Subject: Re: writing to channel limited to 2 Mb?
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Thu, 11 Aug 2011 00:04:02 +0200
In-Reply-To: <alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Message-ID: <1313013842.20733.10.camel@henriknordstrom.net>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 00:04:19 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Thu, 11 Aug 2011 00:03:59 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Wed, 10 Aug 2011 22:04:04 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

ons 2011-08-10 klockan 22:49 +0200 skrev Daniel Stenberg:

> In order to reach a good flow and transfer speed, you never let the window 
> size reach zero. Of course there might still be cases where you really cannot 
> accept more data for the moment and then you tell the other side to not send 
> more by setting the window to 0.

What is a good method to wait for the window to reopen in libssh2?
Should ret = 0 be handled like EAGAIN? Or is some special handling
needed?

The examples seem to busywait if this happens.

Regards
Henrik

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

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 00:47:33 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7AMlMnR015935;
	Thu, 11 Aug 2011 00:47:31 +0200
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 p7AMlLYT015877
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 00:47:21 +0200
Received: (qmail 32403 invoked from network); 10 Aug 2011 22:47:23 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 10 Aug 2011 22:47:23 -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, 10 Aug 2011 22:47:23 -0000
X-URL: http://trac.libssh2.org/
Subject: [libssh2] #222: Windows build settings enhancement request (diff
	included)
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/222
Message-ID: <043.17e137e6ba31a6fbdefab6765628a089@libssh2.stuge.se>
X-Trac-Ticket-ID: 222
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 00:47:33 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 11 Aug 2011 00:47:21 +0200 (CEST)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p7AMlLYT015877
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

#222: Windows build settings enhancement request (diff included)
------------------------+---------------------------------------------------
  Reporter:  kdekker    |       Owner:       
      Type:  defect     |      Status:  new  
  Priority:  normal     |   Milestone:  1.2.9
 Component:  misc       |     Version:  1.2.8
  Keywords:  win build  |      Blocks:       
Blocked By:             |  
------------------------+---------------------------------------------------
 Facilitate Windows build to set other openssl/zlib directories as default.

 Please apply the following diffs.
 1. On libssh2-1.2.8\src\NMakefile (to add the possibility to create a
 static library):

 {{{
 12a13
 >       $(INTDIR)\knownhost.obj \
 25a27,29
 > STATICLIB=$(INTDIR)\libssh2.lib
 > AR = lib
 > ARFLAGS = -nologo /LTCG
 29,30c33,37
 <
 < all: $(DLL)
 ---
 >
 > $(STATICLIB): $(OBJECT)
 >       $(AR) $(ARFLAGS) -out:$@ $(OBJECTS)
 >
 > all: $(DLL) $(STATICLIB)
 33d39
 <
 }}}

 2. on libssh2-1.2.8\win32\config.mk to bypass predefined settings and use
 another openssl directory. Also deprecated option (for Visual Studio 2005)
 /Og has been removed.

 {{{
 1d0
 <
 3,4c2,4
 < OPENSSLINC=..\openssl-0.9.8q\inc32
 < OPENSSLLIB=..\openssl-0.9.8q\out32dll
 ---
 > !if "$(OPENSSLINC)" == ""
 > OPENSSLINC=..\openssl-0.9.8o\inc32
 > !endif
 5a6,10
 > !if "$(OPENSSLLIB)" == ""
 > OPENSSLLIB=..\openssl-0.9.8o\out32dll
 > !endif
 >
 > !if "$(ZLIBINC)" == ""
 6a12,13
 > !endif
 > !if "$(ZLIBLIB)" == ""
 7a15
 > !endif
 18c26
 < CPPFLAGS=/Og /Oi /O2 /Oy /GF /Y- /MD /DNDEBUG
 ---
 > CPPFLAGS=/Oi /O2 /Oy /GF /Y- /MD /DNDEBUG
 22c30
 < CPPFLAGS=/nologo /GL /Zi /EHsc $(CPPFLAGS) /Iwin32 /Iinclude
 /I$(OPENSSLINC) $(ZLIBINC) -DLIBSSH2_WIN32
 ---
 > CPPFLAGS=/nologo /EHsc $(CPPFLAGS) /Iwin32 /Iinclude /I$(OPENSSLINC)
 $(ZLIBINC) -DLIBSSH2_WIN32
 }}}

-- 
Ticket URL: <http://trac.libssh2.org/ticket/222>
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 Aug 11 08:26:51 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B6QRls018270;
	Thu, 11 Aug 2011 08:26:48 +0200
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 p7B6QQbo018265
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 08:26:26 +0200
Date: Thu, 11 Aug 2011 08:26:26 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: writing to channel limited to 2 Mb?
In-Reply-To: <1313013842.20733.10.camel@henriknordstrom.net>
Message-ID: <alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED;
	BOUNDARY="1129329158-1127902481-1313043986=:14697"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 08:26:51 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 11 Aug 2011 08:26:26 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-1127902481-1313043986=:14697
Content-Type: TEXT/PLAIN; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8BIT

On Thu, 11 Aug 2011, Henrik Nordström wrote:

>> In order to reach a good flow and transfer speed, you never let the window 
>> size reach zero. Of course there might still be cases where you really 
>> cannot accept more data for the moment and then you tell the other side to 
>> not send more by setting the window to 0.
>
> What is a good method to wait for the window to reopen in libssh2? Should 
> ret = 0 be handled like EAGAIN? Or is some special handling needed?
>
> The examples seem to busywait if this happens.

Right, this function should only return 0 if it truly sent _something_.

It shouldn't repeatedly return 0 if the window size is 0 as then it probably 
not send anything at all and return EAGAIN instead...

I'm not ruling out a bug but this window size theory is only a guess so far.

-- 

  / daniel.haxx.se
--1129329158-1127902481-1313043986=:14697
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

--1129329158-1127902481-1313043986=:14697--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 09:30:45 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B7USNS023273;
	Thu, 11 Aug 2011 09:30:44 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B7URq2023268
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 09:30:27 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7B7US6R013480
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 07:30:29 GMT
Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged))
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7B7URs4026800
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 09:30:27 +0200
Subject: Re: writing to channel limited to 2 Mb?
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Thu, 11 Aug 2011 09:30:27 +0200
In-Reply-To: <alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Message-ID: <1313047827.26614.3.camel@henriknordstrom.net>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 09:30:45 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Thu, 11 Aug 2011 09:30:27 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Thu, 11 Aug 2011 07:30:29 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

tor 2011-08-11 klockan 08:26 +0200 skrev Daniel Stenberg:

> Right, this function should only return 0 if it truly sent _something_.

_libssh2_channel_write() clearly do return 0 immedately if the window
have collapsed after draining the incoming transport.

        if(channel->local.window_size <= 0)
            /* there's no room for data so we stop */
            return 0;


I guess it should
a) Block if not non-blocking.
b) Return EAGAIN if non-blocking and indicate it needs to read from the
transport (wait for window update)

Regards
Henrik

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

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 10:23:33 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B8NPxI023448;
	Thu, 11 Aug 2011 10:23:32 +0200
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 p7B8NN0C023409
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 10:23:23 +0200
Date: Thu, 11 Aug 2011 10:23:23 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: writing to channel limited to 2 Mb?
In-Reply-To: <1313047827.26614.3.camel@henriknordstrom.net>
Message-ID: <alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED;
	BOUNDARY="1129329158-1649848113-1313051003=:14697"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 10:23:32 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 11 Aug 2011 10:23:23 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-1649848113-1313051003=:14697
Content-Type: TEXT/PLAIN; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8BIT

On Thu, 11 Aug 2011, Henrik Nordström wrote:

> _libssh2_channel_write() clearly do return 0 immedately if the window
> have collapsed after draining the incoming transport.
>
>        if(channel->local.window_size <= 0)
>            /* there's no room for data so we stop */
>            return 0;
>
>
> I guess it should
> a) Block if not non-blocking.
> b) Return EAGAIN if non-blocking and indicate it needs to read from the
> transport (wait for window update)

I agree.

As it calls _libssh2_transport_read() just before that, I'm thinking that 
perhaps we should just make a patch like below. It would work because 
_libssh2_transport_read() itself stores the correct bits that the app should 
wait for after EAGAIN is returned.

diff --git a/src/channel.c b/src/channel.c
index efb2b48..be6a680 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -2022,7 +2022,7 @@ _libssh2_channel_write(LIBSSH2_CHANNEL *channel, int 
strea

          if(channel->local.window_size <= 0)
              /* there's no room for data so we stop */
-            return 0;
+            return (rc==LIBSSH2_ERROR_EAGAIN?rc:0);

          channel->write_bufwrite = buflen;


-- 

  / daniel.haxx.se
--1129329158-1649848113-1313051003=:14697
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

--1129329158-1649848113-1313051003=:14697--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 10:35:02 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B8Ync1029635;
	Thu, 11 Aug 2011 10:35:00 +0200
Received: from mail-pz0-f43.google.com (mail-pz0-f43.google.com
	[209.85.210.43])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B8YlqO029620
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 10:34:48 +0200
Received: by pzk1 with SMTP id 1so4828860pzk.30
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 01:34:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=FG7k1CtJyx46FbFiMRXV3FC6b2yzTUdBGhnIXSMkg40=;
	b=ujnqlojZfNCEqYvAgxo7u7rj0rEHf/u1VS+kym36ZfHtz/8hP4y0dlKuACtWla3neO
	f9r3/I2o+Ox+jJkdaTC1Pgg42V8UlP8bN6ZC99vym1V4rppbnLLRRbVJIY7LhQ9ZTM4f
	Jz/OPb9ORz2wJPh6o+UAuo2K4Udydi9Zoj4hA=
MIME-Version: 1.0
Received: by 10.143.97.26 with SMTP id z26mr7614319wfl.81.1313051681954; Thu,
	11 Aug 2011 01:34:41 -0700 (PDT)
Received: by 10.68.51.197 with HTTP; Thu, 11 Aug 2011 01:34:41 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
Date: Thu, 11 Aug 2011 10:34:41 +0200
Message-ID: <CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
Subject: Re: writing to channel limited to 2 Mb?
From: =?ISO-8859-2?Q?Przemys=B3aw_Szczygielski?= <qus123@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 10:35:02 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 11 Aug 2011 10:34:49 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1342453620=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1342453620==
Content-Type: multipart/alternative; boundary=0015174ff0e8131b3104aa36ab98

--0015174ff0e8131b3104aa36ab98
Content-Type: text/plain; charset=ISO-8859-1

>
>
>         if(channel->local.window_size <= 0)
>             /* there's no room for data so we stop */
> -            return 0;
> +            return (rc==LIBSSH2_ERROR_EAGAIN?rc:**0);
>
>
 If I patch my version of libssh2 like above, should I use some additional
magic to resolve this EAGAIN condition? Send some window adjustment packet,
or whatever (sorry, I have no idea what I am talking about...) Or just wait
until this EAGAIN goes away?

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

<div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margi=
n: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-le=
ft: 1ex;"><div class=3D"im">
<br>
 =A0 =A0 =A0 =A0 if(channel-&gt;local.window_size &lt;=3D 0)<br>
 =A0 =A0 =A0 =A0 =A0 =A0 /* there&#39;s no room for data so we stop */<br>
- =A0 =A0 =A0 =A0 =A0 =A0return 0;<br></div>
+ =A0 =A0 =A0 =A0 =A0 =A0return (rc=3D=3DLIBSSH2_ERROR_EAGAIN?rc:<u></u>0);=
<br>
<br></blockquote><div><br>=A0If I patch my version of libssh2 like above, s=
hould I use some additional magic to resolve this EAGAIN condition? Send so=
me window adjustment packet, or whatever (sorry, I have no idea what I am t=
alking about...) Or just wait until this EAGAIN goes away?</div>
</div>

--0015174ff0e8131b3104aa36ab98--

--===============1342453620==
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

--===============1342453620==--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 10:42:23 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B8gJGY000616;
	Thu, 11 Aug 2011 10:42:22 +0200
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 p7B8gIS6000605
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 10:42:18 +0200
Date: Thu, 11 Aug 2011 10:42:18 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: writing to channel limited to 2 Mb?
In-Reply-To: <CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED;
	BOUNDARY="1129329158-1920534432-1313052138=:14697"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 10:42:23 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 11 Aug 2011 10:42:18 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-1920534432-1313052138=:14697
Content-Type: TEXT/PLAIN; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 8BIT

On Thu, 11 Aug 2011, Przemys³aw Szczygielski wrote:

>> +            return (rc==LIBSSH2_ERROR_EAGAIN?rc:**0);

> If I patch my version of libssh2 like above, should I use some additional 
> magic to resolve this EAGAIN condition? Send some window adjustment packet, 
> or whatever (sorry, I have no idea what I am talking about...) Or just wait 
> until this EAGAIN goes away?

Are you using the API in a blocking or non-blocking way?

If blocking: the existing "wrapper functions" will detect the EAGAIN and wait 
for it to signal data to be readable accordingly.

If non-blocking: your code should already be prepared to handle EAGAIN and act 
accordingly when that happens => call libssh2_session_block_directions() to 
see what to wait for, then wait and then call libssh2 again when things 
happen.

Both cases: this patch should not change the way your application would work 
and you should not have to edit any code at all in your application.

-- 

  / daniel.haxx.se
--1129329158-1920534432-1313052138=:14697
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

--1129329158-1920534432-1313052138=:14697--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 10:52:01 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B8pFSc004464;
	Thu, 11 Aug 2011 10:51:18 +0200
Received: from mail-pz0-f43.google.com (mail-pz0-f43.google.com
	[209.85.210.43])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B8pCR1004449
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 10:51:13 +0200
Received: by pzk1 with SMTP id 1so4858915pzk.30
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 01:51:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=4d5dWkpUa/K+vyAGZh2nrJu6wMrks+D4NE/OwuC3Tek=;
	b=MV7G8ny97OmDZlP5RTUx8vDV2O7Y9gafEOMrThJpTSKgXxcbSUzaSnXne7Fjv6F1Iv
	iHCV7Us1lwIgxZtL9X/4ggbYOFdYSesEkzyfwzGIkw7OZshij4eh2f/QIAdHG4FlwWRJ
	nFxVZxlGuebE6LClol8UKG+QSBbGjZohI4lq0=
MIME-Version: 1.0
Received: by 10.142.169.4 with SMTP id r4mr8131341wfe.423.1313052669479; Thu,
	11 Aug 2011 01:51:09 -0700 (PDT)
Received: by 10.68.51.197 with HTTP; Thu, 11 Aug 2011 01:51:09 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
Date: Thu, 11 Aug 2011 10:51:09 +0200
Message-ID: <CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
Subject: Re: writing to channel limited to 2 Mb?
From: =?ISO-8859-2?Q?Przemys=B3aw_Szczygielski?= <qus123@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 10:52:01 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 11 Aug 2011 10:51:14 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============0670191912=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0670191912==
Content-Type: multipart/alternative; boundary=000e0cd331dcef8d6204aa36e51c

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

>
> Are you using the API in a blocking or non-blocking way?
>
> Non-blocking.

>
> If non-blocking: your code should already be prepared to handle EAGAIN and
> act accordingly when that happens => call libssh2_session_block_**directions()
> to see what to wait for, then wait and then call libssh2 again when things
> happen.
>
>
Well, it isn't exactly my code, as it is part of a library that is a wrapper
to libssh2:

qint64 QxtSshChannel::writeData(const char* buff, qint64 len){

    ssize_t ret=libssh2_channel_write_ex(d->d_channel,
d->d_write_stream_id,buff, len);

    if(ret<0){

        if(ret==LIBSSH2_ERROR_EAGAIN){

            return 0;

        }else{

#ifdef QXT_DEBUG_SSH

            qDebug()<<"write err"<<ret;

#endif

            return -1;

        }

    }

    if (len!=ret)

    {

        qDebug()<<QString("QxtSshChannel::writeData
******KRYTYCZNY!!!! do SSH zapisalo mniej niz dostalo!!!
(%1/%2)").arg(ret).arg(len);

    }

    return ret;

}


So instead of "return 0" I should call libssh2_session_block_directions()
and wait until either read or write to channel is available, depending on
block_directions result?

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

<br>
<div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margi=
n: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-le=
ft: 1ex;"><div class=3D"im">
<br></div>
Are you using the API in a blocking or non-blocking way?<br>
<br></blockquote><div>Non-blocking. <br></div><blockquote class=3D"gmail_qu=
ote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 20=
4, 204); padding-left: 1ex;"><br>
If non-blocking: your code should already be prepared to handle EAGAIN and =
act accordingly when that happens =3D&gt; call libssh2_session_block_<u></u=
>directions() to see what to wait for, then wait and then call libssh2 agai=
n when things happen.<br>

<br></blockquote><div>=A0<br>Well, it isn&#39;t exactly my code, as it is p=
art of a library that is a wrapper to libssh2:<br><br></div><div><span styl=
e=3D"color: rgb(128, 0, 128);">qint64</span><span style=3D"color: rgb(192, =
192, 192);"> </span><span style=3D"color: rgb(128, 0, 128);">QxtSshChannel<=
/span><span style=3D"color: rgb(0, 0, 0);">::</span><span style=3D"font-sty=
le: italic; color: rgb(0, 0, 0);">writeData</span><span style=3D"color: rgb=
(0, 0, 0);">(</span><span style=3D"color: rgb(128, 128, 0);">const</span><s=
pan style=3D"color: rgb(192, 192, 192);"> </span><span style=3D"color: rgb(=
128, 128, 0);">char</span><span style=3D"color: rgb(0, 0, 0);">*</span><spa=
n style=3D"color: rgb(192, 192, 192);"> </span><span style=3D"color: rgb(0,=
 0, 0);">buff</span><span style=3D"color: rgb(0, 0, 0);">,</span><span styl=
e=3D"color: rgb(192, 192, 192);"> </span><span style=3D"color: rgb(128, 0, =
128);">qint64</span><span style=3D"color: rgb(192, 192, 192);"> </span><spa=
n style=3D"color: rgb(0, 0, 0);">len</span><span style=3D"color: rgb(0, 0, =
0);">){</span>
<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(192=
, 192, 192);">    </span><span style=3D"color: rgb(128, 0, 128);">ssize_t</=
span><span style=3D"color: rgb(192, 192, 192);"> </span><span style=3D"colo=
r: rgb(0, 0, 0);">ret</span><span style=3D"color: rgb(0, 0, 0);">=3D</span>=
libssh2_channel_write_ex<span style=3D"color: rgb(0, 0, 0);">(</span><span =
style=3D"color: rgb(128, 0, 0);">d</span><span style=3D"color: rgb(0, 0, 0)=
;">-&gt;</span><span style=3D"color: rgb(128, 0, 0);">d_channel</span><span=
 style=3D"color: rgb(0, 0, 0);">,</span><span style=3D"color: rgb(192, 192,=
 192);"> </span><span style=3D"color: rgb(128, 0, 0);">d</span><span style=
=3D"color: rgb(0, 0, 0);">-&gt;</span><span style=3D"color: rgb(128, 0, 0);=
">d_write_stream_id</span><span style=3D"color: rgb(0, 0, 0);">,</span><spa=
n style=3D"color: rgb(0, 0, 0);">buff</span><span style=3D"color: rgb(0, 0,=
 0);">,</span><span style=3D"color: rgb(192, 192, 192);"> </span><span styl=
e=3D"color: rgb(0, 0, 0);">len</span><span style=3D"color: rgb(0, 0, 0);">)=
;</span></pre>

<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(192=
, 192, 192);">    </span><span style=3D"color: rgb(128, 128, 0);">if</span>=
<span style=3D"color: rgb(0, 0, 0);">(</span><span style=3D"color: rgb(0, 0=
, 0);">ret</span><span style=3D"color: rgb(0, 0, 0);">&lt;</span><span styl=
e=3D"color: rgb(0, 0, 128);">0</span><span style=3D"color: rgb(0, 0, 0);">)=
{</span></pre>

<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(192=
, 192, 192);">        </span><span style=3D"color: rgb(128, 128, 0);">if</s=
pan><span style=3D"color: rgb(0, 0, 0);">(</span><span style=3D"color: rgb(=
0, 0, 0);">ret</span><span style=3D"color: rgb(0, 0, 0);">=3D=3D</span>LIBS=
SH2_ERROR_EAGAIN<span style=3D"color: rgb(0, 0, 0);">){</span></pre>

<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(192=
, 192, 192);">            </span><span style=3D"color: rgb(128, 128, 0);">r=
eturn</span><span style=3D"color: rgb(192, 192, 192);"> </span><span style=
=3D"color: rgb(0, 0, 128);">0</span><span style=3D"color: rgb(0, 0, 0);">;<=
/span></pre>

<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(192=
, 192, 192);">        </span><span style=3D"color: rgb(0, 0, 0);">}</span><=
span style=3D"color: rgb(128, 128, 0);">else</span><span style=3D"color: rg=
b(0, 0, 0);">{</span></pre>

<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(0, =
0, 128);">#ifdef</span><span style=3D"color: rgb(192, 192, 192);"> </span>Q=
XT_DEBUG_SSH</pre>
<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(192=
, 192, 192);">            </span>qDebug<span style=3D"color: rgb(0, 0, 0);"=
>()&lt;&lt;</span><span style=3D"color: rgb(0, 128, 0);">&quot;write</span>=
<span style=3D"color: rgb(192, 192, 192);"> </span><span style=3D"color: rg=
b(0, 128, 0);">err&quot;</span><span style=3D"color: rgb(0, 0, 0);">&lt;&lt=
;</span>ret<span style=3D"color: rgb(0, 0, 0);">;</span></pre>

<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(0, =
0, 128);">#endif</span></pre>
<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(192=
, 192, 192);">            </span><span style=3D"color: rgb(128, 128, 0);">r=
eturn</span><span style=3D"color: rgb(192, 192, 192);"> </span><span style=
=3D"color: rgb(0, 0, 0);">-</span><span style=3D"color: rgb(0, 0, 128);">1<=
/span><span style=3D"color: rgb(0, 0, 0);">;</span></pre>

<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(192=
, 192, 192);">        </span><span style=3D"color: rgb(0, 0, 0);">}</span><=
/pre>
<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(192=
, 192, 192);">    </span><span style=3D"color: rgb(0, 0, 0);">}</span></pre=
>
<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(192=
, 192, 192);">    </span><span style=3D"color: rgb(128, 128, 0);">if</span>=
<span style=3D"color: rgb(192, 192, 192);"> </span><span style=3D"color: rg=
b(0, 0, 0);">(</span><span style=3D"color: rgb(0, 0, 0);">len</span><span s=
tyle=3D"color: rgb(0, 0, 0);">!=3D</span><span style=3D"color: rgb(0, 0, 0)=
;">ret</span><span style=3D"color: rgb(0, 0, 0);">)</span></pre>

<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(192=
, 192, 192);">    </span><span style=3D"color: rgb(0, 0, 0);">{</span></pre=
>
<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(192=
, 192, 192);">        </span>qDebug<span style=3D"color: rgb(0, 0, 0);">()&=
lt;&lt;</span><span style=3D"color: rgb(128, 0, 128);">QString</span><span =
style=3D"color: rgb(0, 0, 0);">(</span><span style=3D"color: rgb(0, 128, 0)=
;">&quot;QxtSshChannel::writeData</span><span style=3D"color: rgb(192, 192,=
 192);"> </span><span style=3D"color: rgb(0, 128, 0);">******KRYTYCZNY!!!!<=
/span><span style=3D"color: rgb(192, 192, 192);"> </span><span style=3D"col=
or: rgb(0, 128, 0);">do</span><span style=3D"color: rgb(192, 192, 192);"> <=
/span><span style=3D"color: rgb(0, 128, 0);">SSH</span><span style=3D"color=
: rgb(192, 192, 192);"> </span><span style=3D"color: rgb(0, 128, 0);">zapis=
alo</span><span style=3D"color: rgb(192, 192, 192);"> </span><span style=3D=
"color: rgb(0, 128, 0);">mniej</span><span style=3D"color: rgb(192, 192, 19=
2);"> </span><span style=3D"color: rgb(0, 128, 0);">niz</span><span style=
=3D"color: rgb(192, 192, 192);"> </span><span style=3D"color: rgb(0, 128, 0=
);">dostalo!!!</span><span style=3D"color: rgb(192, 192, 192);"> </span><sp=
an style=3D"color: rgb(0, 128, 0);">(%1/%2)&quot;</span><span style=3D"colo=
r: rgb(0, 0, 0);">).</span>arg<span style=3D"color: rgb(0, 0, 0);">(</span>=
<span style=3D"color: rgb(0, 0, 0);">ret</span><span style=3D"color: rgb(0,=
 0, 0);">).</span>arg<span style=3D"color: rgb(0, 0, 0);">(</span><span sty=
le=3D"color: rgb(0, 0, 0);">len</span><span style=3D"color: rgb(0, 0, 0);">=
);</span></pre>

<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(192=
, 192, 192);">    </span><span style=3D"color: rgb(0, 0, 0);">}</span></pre=
>

<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(192=
, 192, 192);">    </span><span style=3D"color: rgb(128, 128, 0);">return</s=
pan><span style=3D"color: rgb(192, 192, 192);"> </span><span style=3D"color=
: rgb(0, 0, 0);">ret</span><span style=3D"color: rgb(0, 0, 0);">;</span></p=
re>

<pre style=3D"margin: 0px; text-indent: 0px;"><span style=3D"color: rgb(0, =
0, 0);">}</span></pre>=A0<br>So instead of &quot;return 0&quot; I should ca=
ll libssh2_session_block_directions() and wait until either read or write t=
o channel is available, depending on block_directions result?<br>
</div></div>

--000e0cd331dcef8d6204aa36e51c--

--===============0670191912==
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

--===============0670191912==--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 11:07:50 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B97h3w015277;
	Thu, 11 Aug 2011 11:07:49 +0200
Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com
	[209.85.218.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B97f8D015252
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 11:07:42 +0200
Received: by yib19 with SMTP id 19so1608164yib.41
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 02:07:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=I4GBQiU8UCwAB2ksi11WKKb2H+yEafBz+Mk04Sz48KA=;
	b=CBweh41r0gtXLtZIYScqKXd8LiNead69PwOXLb4slZmN9nNInHuB0ktbE/X+L3ls+e
	ANaYFUwixc+sSzeXgHK9kqQSl0p3ZnwauZ5q+mgqOrSryZZm/QBNx3JSLEN99YK4YmT1
	Bc9mdGeJ3ocDHfcKqbwNmjN7k7UxE/752wXAk=
MIME-Version: 1.0
Received: by 10.143.97.26 with SMTP id z26mr7628393wfl.81.1313053653738; Thu,
	11 Aug 2011 02:07:33 -0700 (PDT)
Received: by 10.68.51.197 with HTTP; Thu, 11 Aug 2011 02:07:33 -0700 (PDT)
In-Reply-To: <CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
Date: Thu, 11 Aug 2011 11:07:33 +0200
Message-ID: <CAD+sJONbrj5cG4gRuF9NbU--dVa7i_bupqGxYKQoMKjA_Tihjg@mail.gmail.com>
Subject: Re: writing to channel limited to 2 Mb?
From: =?ISO-8859-2?Q?Przemys=B3aw_Szczygielski?= <qus123@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 11:07:50 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 11 Aug 2011 11:07:42 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============0415902824=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0415902824==
Content-Type: multipart/alternative; boundary=0015174ff0e89a258e04aa37207c

--0015174ff0e89a258e04aa37207c
Content-Type: text/plain; charset=ISO-8859-1

OK, after calling block_directions before return 0 (just to test) it returns
LIBSSH2_SESSION_BLOCK_INBOUND. So this means I should wait for data
available on this channel?

--0015174ff0e89a258e04aa37207c
Content-Type: text/html; charset=ISO-8859-1

OK, after calling block_directions before return 0 (just to test) it returns <span class="bold">LIBSSH2_SESSION_BLOCK_INBOUND.</span> So this means I should wait for data available on this channel?<br>

--0015174ff0e89a258e04aa37207c--

--===============0415902824==
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

--===============0415902824==--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 11:07:55 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B97smx015351;
	Thu, 11 Aug 2011 11:07:55 +0200
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 p7B97rZq015340
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 11:07:53 +0200
Date: Thu, 11 Aug 2011 11:07:53 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: writing to channel limited to 2 Mb?
In-Reply-To: <CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="1129329158-593477814-1313053673=:2795"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 11:07:55 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 11 Aug 2011 11:07:53 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-593477814-1313053673=:2795
Content-Type: TEXT/PLAIN; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 8BIT

On Thu, 11 Aug 2011, Przemys³aw Szczygielski wrote:

> Well, it isn't exactly my code, as it is part of a library that is a wrapper
> to libssh2:

Ah right. And it looks like libqxt uses a bundled version of libssh2 1.2.6 so 
you may in fact be suffering from older bugs too. (Unless you can configure it 
to use an externally provided version.)

> So instead of "return 0" I should call libssh2_session_block_directions() 
> and wait until either read or write to channel is available, depending on 
> block_directions result?

Yes, it should. This is of course completely unrelated to this patch as that's 
just how the libssh2 non-blocking API works!

-- 

  / daniel.haxx.se
--1129329158-593477814-1313053673=:2795
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

--1129329158-593477814-1313053673=:2795--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 11:10:34 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B9AWYC016693;
	Thu, 11 Aug 2011 11:10:33 +0200
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 p7B9AURG016680
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 11:10:30 +0200
Date: Thu, 11 Aug 2011 11:10:30 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: writing to channel limited to 2 Mb?
In-Reply-To: <CAD+sJONbrj5cG4gRuF9NbU--dVa7i_bupqGxYKQoMKjA_Tihjg@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108111109480.2795@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
	<CAD+sJONbrj5cG4gRuF9NbU--dVa7i_bupqGxYKQoMKjA_Tihjg@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="1129329158-801396339-1313053830=:2795"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 11:10:34 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 11 Aug 2011 11:10:30 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-801396339-1313053830=:2795
Content-Type: TEXT/PLAIN; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 8BIT

On Thu, 11 Aug 2011, Przemys³aw Szczygielski wrote:

> OK, after calling block_directions before return 0 (just to test) it returns 
> LIBSSH2_SESSION_BLOCK_INBOUND. So this means I should wait for data 
> available on this channel?

Yes. And since you can only do that on a socket-basis you should wait for 
readable data on the socket and then call the libssh2 function again.

-- 

  / daniel.haxx.se
--1129329158-801396339-1313053830=:2795
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

--1129329158-801396339-1313053830=:2795--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 11:13:43 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B9DeqZ017941;
	Thu, 11 Aug 2011 11:13:43 +0200
Received: from mail-pz0-f43.google.com (mail-pz0-f43.google.com
	[209.85.210.43])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B9Da2q017906
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 11:13:38 +0200
Received: by pzk1 with SMTP id 1so4902380pzk.30
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 02:13:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=YBckaZxmSg2bTeopNOTcrVF6m0qwU/i8MbFzi00Krik=;
	b=DrqrSsukE6atbbYycNwN+4f38H/zGuWgV/7braK3nVaOx04AUoFE80XH7HVrsCfU0r
	yeZN52mHvxP3Rwwgz9l+jEHDJ/yRYlNZvbaZ2Rbdovtgl4xs0Kj/exYKqHSxXwr1nhz1
	Vg+EEtAV96zi4Ug/mdzFgwfC07j47p3boQVGE=
MIME-Version: 1.0
Received: by 10.142.3.27 with SMTP id 27mr7608657wfc.366.1313054014176; Thu,
	11 Aug 2011 02:13:34 -0700 (PDT)
Received: by 10.68.51.197 with HTTP; Thu, 11 Aug 2011 02:13:34 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108101942330.28155@tvnag.unkk.fr>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
	<alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
Date: Thu, 11 Aug 2011 11:13:34 +0200
Message-ID: <CAD+sJONY8CXFJFO57wMrKpY8vnvDp7-+yB4Mp9ip4_k3tJz0PQ@mail.gmail.com>
Subject: Re: writing to channel limited to 2 Mb?
From: =?ISO-8859-2?Q?Przemys=B3aw_Szczygielski?= <qus123@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 11:13:43 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 11 Aug 2011 11:13:38 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============0484237676=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0484237676==
Content-Type: multipart/alternative; boundary=00504502ad0d15fda704aa37368a

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

W dniu 11 sierpnia 2011 11:07 u=BFytkownik Daniel Stenberg
<daniel@haxx.se>napisa=B3:

> On Thu, 11 Aug 2011, Przemys=B3aw Szczygielski wrote:
>
>  Well, it isn't exactly my code, as it is part of a library that is a
>> wrapper
>> to libssh2:
>>
>
> Ah right. And it looks like libqxt uses a bundled version of libssh2 1.2.=
6
> so you may in fact be suffering from older bugs too. (Unless you can
> configure it to use an externally provided version.)
>
> Actualy - yes. It is compiled with libssh2 not older than 2 months, patch=
ed
manually by me. BTW - will the callback patches used by libqxt ever
incorporated in libssh2?


>
>  So instead of "return 0" I should call libssh2_session_block_**direction=
s()
>> and wait until either read or write to channel is available, depending o=
n
>> block_directions result?
>>
>
> Yes, it should. This is of course completely unrelated to this patch as
> that's just how the libssh2 non-blocking API works!
>
> return LIBSSH2_ERROR_EAGAIN instead of 0 won't probably work, as writeDat=
a
is overloaded virtual function of QIODevice, I guess...

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

<br><br><div class=3D"gmail_quote">W dniu 11 sierpnia 2011 11:07 u=BFytkown=
ik Daniel Stenberg <span dir=3D"ltr">&lt;<a href=3D"mailto:daniel@haxx.se">=
daniel@haxx.se</a>&gt;</span> napisa=B3:<br><blockquote class=3D"gmail_quot=
e" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204,=
 204); padding-left: 1ex;">
<div class=3D"im">On Thu, 11 Aug 2011, Przemys=B3aw Szczygielski wrote:<br>
<br>
</div><div class=3D"im"><blockquote class=3D"gmail_quote" style=3D"margin: =
0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left:=
 1ex;">
Well, it isn&#39;t exactly my code, as it is part of a library that is a wr=
apper<br>
to libssh2:<br>
</blockquote>
<br></div>
Ah right. And it looks like libqxt uses a bundled version of libssh2 1.2.6 =
so you may in fact be suffering from older bugs too. (Unless you can config=
ure it to use an externally provided version.)<div class=3D"im"><br></div>
</blockquote><div>Actualy - yes. It is compiled with libssh2 not older than=
 2 months, patched manually by me. BTW - will the callback patches used by =
libqxt ever incorporated in libssh2?<br>=A0</div><blockquote class=3D"gmail=
_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204,=
 204, 204); padding-left: 1ex;">
<div class=3D"im">
<br>
<blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; borde=
r-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
So instead of &quot;return 0&quot; I should call libssh2_session_block_<u><=
/u>directions() and wait until either read or write to channel is available=
, depending on block_directions result?<br>
</blockquote>
<br></div>
Yes, it should. This is of course completely unrelated to this patch as tha=
t&#39;s just how the libssh2 non-blocking API works!<br><br></blockquote><d=
iv>return LIBSSH2_ERROR_EAGAIN instead of 0 won&#39;t probably work, as wri=
teData is overloaded virtual function of QIODevice, I guess... <br>
</div></div>

--00504502ad0d15fda704aa37368a--

--===============0484237676==
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

--===============0484237676==--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 11:15:26 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B9FO3I019092;
	Thu, 11 Aug 2011 11:15:26 +0200
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 p7B9FN7k019078
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 11:15:23 +0200
Date: Thu, 11 Aug 2011 11:15:23 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: writing to channel limited to 2 Mb?
In-Reply-To: <CAD+sJONY8CXFJFO57wMrKpY8vnvDp7-+yB4Mp9ip4_k3tJz0PQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108111114350.2795@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
	<alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
	<CAD+sJONY8CXFJFO57wMrKpY8vnvDp7-+yB4Mp9ip4_k3tJz0PQ@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="1129329158-236706722-1313054123=:2795"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 11:15:26 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 11 Aug 2011 11:15:23 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-236706722-1313054123=:2795
Content-Type: TEXT/PLAIN; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 8BIT

On Thu, 11 Aug 2011, Przemys³aw Szczygielski wrote:

> will the callback patches used by libqxt ever incorporated in libssh2?

If they would be posted to us for review we would of course consider that. I 
don't recall having seen any.

-- 

  / daniel.haxx.se
--1129329158-236706722-1313054123=:2795
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

--1129329158-236706722-1313054123=:2795--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 11:20:59 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B9Kp5f022069;
	Thu, 11 Aug 2011 11:20:57 +0200
Received: from mail-pz0-f43.google.com (mail-pz0-f43.google.com
	[209.85.210.43])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B9Km6D021956
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 11:20:49 +0200
Received: by pzk1 with SMTP id 1so4916768pzk.30
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 02:20:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=KN0kiGAm8oPltbY2ry44Ixcd58QD5y0XhRHG1fe+cg0=;
	b=G6W6nqvgcBjK0xPx9TedBMwsATmD8k0Vdh0e6YHrKBz11X7ywpQ54uQH/gxKbllWoJ
	sGsklfdfyvQ5+p3m9yfIEl5+kyppFvptijbDJgAl0w2xsfAa5Q5khT4iIu9V5YojRXsQ
	clneyS+2MsWYfLaBLFVFF8x+VbSRDUtTVVIn0=
MIME-Version: 1.0
Received: by 10.142.118.33 with SMTP id q33mr3865947wfc.24.1313054445796; Thu,
	11 Aug 2011 02:20:45 -0700 (PDT)
Received: by 10.68.51.197 with HTTP; Thu, 11 Aug 2011 02:20:45 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108111114350.2795@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
	<alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
	<CAD+sJONY8CXFJFO57wMrKpY8vnvDp7-+yB4Mp9ip4_k3tJz0PQ@mail.gmail.com>
	<alpine.DEB.2.00.1108111114350.2795@tvnag.unkk.fr>
Date: Thu, 11 Aug 2011 11:20:45 +0200
Message-ID: <CAD+sJOMpxWftPtdrr1nUfTthgnXOt7HYVSLoBOm2Qe8k=fhj8w@mail.gmail.com>
Subject: Re: writing to channel limited to 2 Mb?
From: =?ISO-8859-2?Q?Przemys=B3aw_Szczygielski?= <qus123@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 11:20:59 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 11 Aug 2011 11:20:50 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============0266737309=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0266737309==
Content-Type: multipart/alternative; boundary=001636e1f8a5cffee604aa374fd4

--001636e1f8a5cffee604aa374fd4
Content-Type: text/plain; charset=ISO-8859-1

will the callback patches used by libqxt ever incorporated in libssh2?

>
> If they would be posted to us for review we would of course consider that.
> I don't recall having seen any.
>
>

Indeed? Well, they are there in libqxt
src\3rdparty\libssh2\libssh2_rw_callbacks.patch


I am not connected to libqxt anyway, but I can send you the file if you
want.

--001636e1f8a5cffee604aa374fd4
Content-Type: text/html; charset=ISO-8859-1

will the callback patches used by libqxt ever incorporated in libssh2?<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
<br></div>
If they would be posted to us for review we would of course consider that. I don&#39;t recall having seen any.<br><font color="#888888">
</font><br></blockquote><div><font color="#888888"><br><br>Indeed? Well, they are there in libqxt src\3rdparty\libssh2</font>\libssh2_rw_callbacks.patch <br><br>I am not connected to libqxt anyway, but I can send you the file if you want.</div>
</div>

--001636e1f8a5cffee604aa374fd4--

--===============0266737309==
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

--===============0266737309==--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 11:44:18 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7B9huUr005780;
	Thu, 11 Aug 2011 11:44:14 +0200
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 p7B9ht6L005740
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 11:43:55 +0200
Date: Thu, 11 Aug 2011 11:43:55 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: send/recv callbacks (was Re: writing to channel limited to 2 Mb?)
In-Reply-To: <CAD+sJOMpxWftPtdrr1nUfTthgnXOt7HYVSLoBOm2Qe8k=fhj8w@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108111138240.2795@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
	<alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
	<CAD+sJONY8CXFJFO57wMrKpY8vnvDp7-+yB4Mp9ip4_k3tJz0PQ@mail.gmail.com>
	<alpine.DEB.2.00.1108111114350.2795@tvnag.unkk.fr>
	<CAD+sJOMpxWftPtdrr1nUfTthgnXOt7HYVSLoBOm2Qe8k=fhj8w@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="1129329158-497420124-1313055835=:2795"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 11:44:18 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 11 Aug 2011 11:43:55 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-497420124-1313055835=:2795
Content-Type: TEXT/PLAIN; charset=ISO-8859-2; format=flowed
Content-Transfer-Encoding: 8BIT

On Thu, 11 Aug 2011, Przemys³aw Szczygielski wrote:

> Indeed? Well, they are there in libqxt 
> src\3rdparty\libssh2\libssh2_rw_callbacks.patch
>
> I am not connected to libqxt anyway, but I can send you the file if you 
> want.

No need to, we can find it here:
http://dev.libqxt.org/libqxt/src/67c3ebd625f2/src/3rdparty/libssh2/libssh2_rw_callbacks.patch

I can see how we can add support for user-provided send/recv functions and I 
believe we've discussed that before and I'm for it. I would however prefer to 
better hide that within the _libssh2_recv() and _libssh2_send() functions to 
make the existing code (basically) unmodified and easier to read, make it 
easier to have future code use the same concept and make it affect _all_ 
reads/writes.

The above mentioned patch fails at some of that.

To make that work, we'll have to change _libssh2_recv() and _libssh2_send() to 
take a session pointer instead of the socket as the first argument, but that 
shouldn't be too hard.

-- 

  / daniel.haxx.se
--1129329158-497420124-1313055835=:2795
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

--1129329158-497420124-1313055835=:2795--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 14:30:45 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7BCUUbi010053;
	Thu, 11 Aug 2011 14:30:44 +0200
Received: from mail-pz0-f43.google.com (mail-pz0-f43.google.com
	[209.85.210.43])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7BCUQ6N010027
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 14:30:28 +0200
Received: by pzk1 with SMTP id 1so5278440pzk.30
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 05:30:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=W1A8WBEgyM/9UUZU3rCWHM/xQKQQOFmcLJ1qRil4cuY=;
	b=r8/qIN7AYypCcdXgaKc1nhGY3ex20c20oOKc30oFYEhe8UTg2OqCrh5rn+O00K+lvO
	EFquXSC6ZUBZk5Tmo1vsixWiawGyD8setlOvit+ZIGIxPcNMRGRcbOUtA+cHoo53Y8mD
	QHV9n2+XV4x3YZYfrBMpzXykjwdjYE6FwLTFY=
MIME-Version: 1.0
Received: by 10.142.157.16 with SMTP id f16mr8006505wfe.195.1313065824915;
	Thu, 11 Aug 2011 05:30:24 -0700 (PDT)
Received: by 10.68.51.197 with HTTP; Thu, 11 Aug 2011 05:30:24 -0700 (PDT)
In-Reply-To: <CAD+sJOMpxWftPtdrr1nUfTthgnXOt7HYVSLoBOm2Qe8k=fhj8w@mail.gmail.com>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
	<alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
	<CAD+sJONY8CXFJFO57wMrKpY8vnvDp7-+yB4Mp9ip4_k3tJz0PQ@mail.gmail.com>
	<alpine.DEB.2.00.1108111114350.2795@tvnag.unkk.fr>
	<CAD+sJOMpxWftPtdrr1nUfTthgnXOt7HYVSLoBOm2Qe8k=fhj8w@mail.gmail.com>
Date: Thu, 11 Aug 2011 14:30:24 +0200
Message-ID: <CAD+sJOOjT99AOXv0m91MWciB1B=DUeD5QqqOcMFwgF4_uzBFhw@mail.gmail.com>
Subject: Re: writing to channel limited to 2 Mb?
From: =?ISO-8859-2?Q?Przemys=B3aw_Szczygielski?= <qus123@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 14:30:45 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 11 Aug 2011 14:30:28 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1543418060=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1543418060==
Content-Type: multipart/alternative; boundary=000e0cd20cec0f92bf04aa39f6a8

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

OK, thank you very much guys, that seems to solve the problem. Files bigger
than 2048 get pushed now, (they do loose some bytes in the process, but I
guess it's due to my quick and dirty fix).

W dniu 11 sierpnia 2011 11:20 u=BFytkownik Przemys=B3aw Szczygielski <
qus123@gmail.com> napisa=B3:

> will the callback patches used by libqxt ever incorporated in libssh2?
>
>>
>> If they would be posted to us for review we would of course consider tha=
t.
>> I don't recall having seen any.
>>
>>
>
> Indeed? Well, they are there in libqxt src\3rdparty\libssh2\libssh2_rw_ca=
llbacks.patch
>
>
> I am not connected to libqxt anyway, but I can send you the file if you
> want.
>

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

OK, thank you very much guys, that seems to solve the problem. Files bigger=
 than 2048 get pushed now, (they do loose some bytes in the process, but I =
guess it&#39;s due to my quick and dirty fix).<br><br><div class=3D"gmail_q=
uote">
W dniu 11 sierpnia 2011 11:20 u=BFytkownik Przemys=B3aw Szczygielski <span =
dir=3D"ltr">&lt;<a href=3D"mailto:qus123@gmail.com">qus123@gmail.com</a>&gt=
;</span> napisa=B3:<br><blockquote class=3D"gmail_quote" style=3D"margin: 0=
pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: =
1ex;">
<div class=3D"im">will the callback patches used by libqxt ever incorporate=
d in libssh2?<br>
</div><div class=3D"gmail_quote"><div class=3D"im"><blockquote class=3D"gma=
il_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(20=
4, 204, 204); padding-left: 1ex;"><div>
<br></div>
If they would be posted to us for review we would of course consider that. =
I don&#39;t recall having seen any.<br><font color=3D"#888888">
</font><br></blockquote></div><div><font color=3D"#888888"><br><br>Indeed? =
Well, they are there in libqxt src\3rdparty\libssh2</font>\libssh2_rw_callb=
acks.patch <br><br>I am not connected to libqxt anyway, but I can send you =
the file if you want.</div>

</div>
</blockquote></div><br>

--000e0cd20cec0f92bf04aa39f6a8--

--===============1543418060==
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

--===============1543418060==--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 16:14:03 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7BEDijv010286;
	Thu, 11 Aug 2011 16:14:00 +0200
Received: from mail-pz0-f43.google.com (mail-pz0-f43.google.com
	[209.85.210.43])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7BEDeAL010235
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 16:13:42 +0200
Received: by pzk1 with SMTP id 1so5474430pzk.30
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 07:13:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=yrcqnreMc6hf5KX0RX6HSZp7nw2leDY9s04Ro0FlIZc=;
	b=XINKWFoYJdTr84dCBu7DYluvmSKMSN5CGaqN0qhoBlzUrt0Jq5Aw6d5wRBz4Ow5O4J
	PNQaBelw+KgmK49U016bUXq45aglSlxJ1i8NJWRGrIoPMv2wL3u0SrmUkkqLSV3Pyb3i
	GDqVqeCcgFVT5Zgx3sT5EmVB9yAC3zEFTjGYY=
MIME-Version: 1.0
Received: by 10.143.90.14 with SMTP id s14mr8083116wfl.138.1313072019253; Thu,
	11 Aug 2011 07:13:39 -0700 (PDT)
Received: by 10.68.51.197 with HTTP; Thu, 11 Aug 2011 07:13:39 -0700 (PDT)
In-Reply-To: <CAD+sJOOjT99AOXv0m91MWciB1B=DUeD5QqqOcMFwgF4_uzBFhw@mail.gmail.com>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<CAD+sJOOgXKsCKb3bXVc45296afEW51OLby41qj7BztpRWw5KgA@mail.gmail.com>
	<alpine.DEB.2.00.1108101957460.28155@tvnag.unkk.fr>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
	<alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
	<CAD+sJONY8CXFJFO57wMrKpY8vnvDp7-+yB4Mp9ip4_k3tJz0PQ@mail.gmail.com>
	<alpine.DEB.2.00.1108111114350.2795@tvnag.unkk.fr>
	<CAD+sJOMpxWftPtdrr1nUfTthgnXOt7HYVSLoBOm2Qe8k=fhj8w@mail.gmail.com>
	<CAD+sJOOjT99AOXv0m91MWciB1B=DUeD5QqqOcMFwgF4_uzBFhw@mail.gmail.com>
Date: Thu, 11 Aug 2011 16:13:39 +0200
Message-ID: <CAD+sJOP6NMqYq6OGWcnkFs9Ohn2F0JT6HARoUanriOF+wq3J+Q@mail.gmail.com>
Subject: Re: writing to channel limited to 2 Mb?
From: =?ISO-8859-2?Q?Przemys=B3aw_Szczygielski?= <qus123@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 16:14:03 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 11 Aug 2011 16:13:42 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============0995131820=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0995131820==
Content-Type: multipart/alternative; boundary=000e0cd245e045aa5404aa3b67c9

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

One (probably) last question. I am using libssh2 1.2.8 with today's patch.
Are there more important patches to 1.2.8 you would advise?

--000e0cd245e045aa5404aa3b67c9
Content-Type: text/html; charset=ISO-8859-1

One (probably) last question. I am using libssh2 1.2.8 with today&#39;s patch. Are there more important patches to 1.2.8 you would advise?<br>

--000e0cd245e045aa5404aa3b67c9--

--===============0995131820==
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

--===============0995131820==--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 22:41:23 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7BKexmJ025368;
	Thu, 11 Aug 2011 22:41:18 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7BKew4x025365
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 22:40:58 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7BKf2gi029887
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 20:41:03 GMT
Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged))
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7BKexg5021782
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 22:40:59 +0200
Subject: Re: send/recv callbacks (was Re: writing to channel limited to 2 Mb?)
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Thu, 11 Aug 2011 22:40:59 +0200
In-Reply-To: <alpine.DEB.2.00.1108111138240.2795@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<CAD+sJOPFt5HQ2_2V_wV86-rXXsf-r-EscAQzp2h_ESMDAmhCCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102018230.28155@tvnag.unkk.fr>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
	<alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
	<CAD+sJONY8CXFJFO57wMrKpY8vnvDp7-+yB4Mp9ip4_k3tJz0PQ@mail.gmail.com>
	<alpine.DEB.2.00.1108111114350.2795@tvnag.unkk.fr>
	<CAD+sJOMpxWftPtdrr1nUfTthgnXOt7HYVSLoBOm2Qe8k=fhj8w@mail.gmail.com>
	<alpine.DEB.2.00.1108111138240.2795@tvnag.unkk.fr>
Content-Type: multipart/mixed; boundary="=-eDEvnqhEZedK5bzqqRcs"
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Message-ID: <1313095259.26614.21.camel@henriknordstrom.net>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 22:41:23 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Thu, 11 Aug 2011 22:40:58 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Thu, 11 Aug 2011 20:41:03 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se


--=-eDEvnqhEZedK5bzqqRcs
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit

tor 2011-08-11 klockan 11:43 +0200 skrev Daniel Stenberg:

> I can see how we can add support for user-provided send/recv functions and I 
> believe we've discussed that before and I'm for it. I would however prefer to 
> better hide that within the _libssh2_recv() and _libssh2_send() functions to 
> make the existing code (basically) unmodified and easier to read, make it 
> easier to have future code use the same concept and make it affect _all_ 
> reads/writes.

I think a simpler way is to make all SSH send/recv go via
session->send/recv set by default to _libssh2_send/recv

Additionally agent.c is also using _libssh2_send/recv with a slightly
different usage pattern, doing I/O on the agent fd and not the libssh2
session fd.

Reworked patch attached. Can also be found in my github repository where
various other small changes also resides while I am reading the code. 

  github.com/hno/libssh2

Regards
Henrik

--=-eDEvnqhEZedK5bzqqRcs
Content-Description: 
Content-Disposition: inline; filename="libssh2_io_callbacks.patch"
Content-Type: text/x-patch; name="libssh2_io_callbacks.patch"; charset="UTF-8"
Content-Transfer-Encoding: 7bit

commit a894d38506813138d7669d4867ff920643eaea38
Author: Henrik Nordstrom <henrik@henriknordstrom.net>
Date:   Thu Aug 11 22:26:56 2011 +0200

    Custom callbacks for performing low level socket I/O

diff --git a/docs/libssh2_session_callback_set.3 b/docs/libssh2_session_callback_set.3
index 4e5aa9c..1a42401 100644
--- a/docs/libssh2_session_callback_set.3
+++ b/docs/libssh2_session_callback_set.3
@@ -33,6 +33,12 @@ Called when a mismatched MAC has been detected in the transport layer. If the
 function returns 0, the packet will be accepted nonetheless.
 .IP LIBSSH2_CALLBACK_X11
 Called when an X11 connection has been accepted
+.IP LIBSSH2_CALLBACK_SEND
+Called when libssh2 wants to send some data on the connection.
+Can be set to a custom function to handle I/O your own way.
+.IP LIBSSH2_CALLBACK_RECV
+Called when libssh2 wants to receive some data from the connection.
+Can be set to a custom function to handle I/O your own way.
 .SH RETURN VALUE
 Pointer to previous callback handler. Returns NULL if no prior callback
 handler was set or the callback type was unknown.
diff --git a/include/libssh2.h b/include/libssh2.h
index 2a997ae..f5c791a 100644
--- a/include/libssh2.h
+++ b/include/libssh2.h
@@ -237,12 +237,22 @@ typedef struct _LIBSSH2_USERAUTH_KBDINT_RESPONSE
   void name(LIBSSH2_SESSION *session, void **session_abstract, \
             LIBSSH2_CHANNEL *channel, void **channel_abstract)
 
+/* I/O callbacks */
+#define LIBSSH2_RECV_FUNC(name)  ssize_t name(int socket, \
+                                              void *buffer, size_t length, \
+                                              int flags, void **abstract)
+#define LIBSSH2_SEND_FUNC(name)  ssize_t name(int socket, \
+                                              const void *buffer, size_t length,\
+                                              int flags, void **abstract)
+
 /* libssh2_session_callback_set() constants */
 #define LIBSSH2_CALLBACK_IGNORE             0
 #define LIBSSH2_CALLBACK_DEBUG              1
 #define LIBSSH2_CALLBACK_DISCONNECT         2
 #define LIBSSH2_CALLBACK_MACERROR           3
 #define LIBSSH2_CALLBACK_X11                4
+#define LIBSSH2_CALLBACK_SEND               5
+#define LIBSSH2_CALLBACK_RECV               6
 
 /* libssh2_session_method_pref() constants */
 #define LIBSSH2_METHOD_KEX          0
diff --git a/src/agent.c b/src/agent.c
index 7c6eaa3..5a9e81c 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -177,7 +177,7 @@ agent_transact_unix(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx)
     /* Send the length of the request */
     if (transctx->state == agent_NB_state_request_created) {
         _libssh2_htonu32(buf, transctx->request_len);
-        rc = _libssh2_send(agent->fd, buf, sizeof buf, 0);
+        rc = LIBSSH2_SEND_FD(agent->session, agent->fd, buf, sizeof buf, 0);
         if (rc == -EAGAIN)
             return LIBSSH2_ERROR_EAGAIN;
         else if (rc < 0)
@@ -188,7 +188,7 @@ agent_transact_unix(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx)
 
     /* Send the request body */
     if (transctx->state == agent_NB_state_request_length_sent) {
-        rc = _libssh2_send(agent->fd, transctx->request,
+        rc = LIBSSH2_SEND_FD(agent->session, agent->fd, transctx->request,
                            transctx->request_len, 0);
         if (rc == -EAGAIN)
             return LIBSSH2_ERROR_EAGAIN;
@@ -200,7 +200,7 @@ agent_transact_unix(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx)
 
     /* Receive the length of a response */
     if (transctx->state == agent_NB_state_request_sent) {
-        rc = _libssh2_recv(agent->fd, buf, sizeof buf, 0);
+        rc = LIBSSH2_RECV_FD(agent->session, agent->fd, buf, sizeof buf, 0);
         if (rc < 0) {
             if (rc == -EAGAIN)
                 return LIBSSH2_ERROR_EAGAIN;
@@ -218,7 +218,7 @@ agent_transact_unix(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx)
 
     /* Receive the response body */
     if (transctx->state == agent_NB_state_response_length_received) {
-        rc = _libssh2_recv(agent->fd, transctx->response,
+        rc = LIBSSH2_RECV_FD(agent->session, agent->fd, transctx->response,
                            transctx->response_len, 0);
         if (rc < 0) {
             if (rc == -EAGAIN)
diff --git a/src/libssh2_priv.h b/src/libssh2_priv.h
index 473e9c3..d2f8054 100644
--- a/src/libssh2_priv.h
+++ b/src/libssh2_priv.h
@@ -171,6 +171,12 @@ static inline int writev(int sock, struct iovec *iov, int nvecs)
 
 #define LIBSSH2_CHANNEL_CLOSE(session, channel)                     channel->close_cb((session), &(session)->abstract, (channel), &(channel)->abstract)
 
+#define LIBSSH2_SEND_FD(session, fd, buffer, length, flags)                session->send(fd, buffer, length, flags, &session->abstract)
+#define LIBSSH2_RECV_FD(session, fd, buffer, length, flags)                session->recv(fd, buffer, length, flags, &session->abstract)
+
+#define LIBSSH2_SEND(session, buffer, length, flags)                LIBSSH2_SEND_FD(session, session->socket_fd, buffer, length, flags)
+#define LIBSSH2_RECV(session, buffer, length, flags)                LIBSSH2_SEND_FD(session, session->socket_fd, buffer, length, flags)
+
 typedef struct _LIBSSH2_KEX_METHOD LIBSSH2_KEX_METHOD;
 typedef struct _LIBSSH2_HOSTKEY_METHOD LIBSSH2_HOSTKEY_METHOD;
 typedef struct _LIBSSH2_CRYPT_METHOD LIBSSH2_CRYPT_METHOD;
@@ -539,6 +545,8 @@ struct _LIBSSH2_SESSION
       LIBSSH2_DISCONNECT_FUNC((*ssh_msg_disconnect));
       LIBSSH2_MACERROR_FUNC((*macerror));
       LIBSSH2_X11_OPEN_FUNC((*x11));
+      LIBSSH2_SEND_FUNC((*send));
+      LIBSSH2_RECV_FUNC((*recv));
 
     /* Method preferences -- NULL yields "load order" */
     char *kex_prefs;
@@ -972,9 +980,9 @@ _libssh2_debug(LIBSSH2_SESSION * session, int context, const char *format, ...)
 #define SSH_OPEN_RESOURCE_SHORTAGE           4
 
 ssize_t _libssh2_recv(libssh2_socket_t socket, void *buffer,
-                      size_t length, int flags);
+                      size_t length, int flags, void **abstract);
 ssize_t _libssh2_send(libssh2_socket_t socket, const void *buffer,
-                      size_t length, int flags);
+                      size_t length, int flags, void **abstract);
 
 #define LIBSSH2_READ_TIMEOUT 60 /* generic timeout in seconds used when
                                    waiting for more data to arrive */
diff --git a/src/misc.c b/src/misc.c
index cc07fc6..a9f423a 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -94,7 +94,7 @@ static int wsa2errno(void)
  * Replacement for the standard recv, return -errno on failure.
  */
 ssize_t
-_libssh2_recv(libssh2_socket_t sock, void *buffer, size_t length, int flags)
+_libssh2_recv(libssh2_socket_t sock, void *buffer, size_t length, int flags, void **abstract)
 {
     ssize_t rc = recv(sock, buffer, length, flags);
 #ifdef WIN32
@@ -126,7 +126,7 @@ _libssh2_recv(libssh2_socket_t sock, void *buffer, size_t length, int flags)
  */
 ssize_t
 _libssh2_send(libssh2_socket_t sock, const void *buffer, size_t length,
-              int flags)
+              int flags, void **abstract)
 {
     ssize_t rc = send(sock, buffer, length, flags);
 #ifdef WIN32
diff --git a/src/session.c b/src/session.c
index 46ef016..50d08ee 100644
--- a/src/session.c
+++ b/src/session.c
@@ -115,7 +115,7 @@ banner_receive(LIBSSH2_SESSION * session)
         /* no incoming block yet! */
         session->socket_block_directions &= ~LIBSSH2_SESSION_BLOCK_INBOUND;
 
-        ret = _libssh2_recv(session->socket_fd, &c, 1,
+        ret = LIBSSH2_RECV(session, &c, 1,
                             LIBSSH2_SOCKET_RECV_FLAGS(session));
         if (ret < 0) {
             if(session->api_block_mode || (ret != -EAGAIN))
@@ -227,7 +227,7 @@ banner_send(LIBSSH2_SESSION * session)
     /* no outgoing block yet! */
     session->socket_block_directions &= ~LIBSSH2_SESSION_BLOCK_OUTBOUND;
 
-    ret = _libssh2_send(session->socket_fd,
+    ret = LIBSSH2_SEND(session,
                         banner + session->banner_TxRx_total_send,
                         banner_len - session->banner_TxRx_total_send,
                         LIBSSH2_SOCKET_SEND_FLAGS(session));
@@ -481,6 +481,8 @@ libssh2_session_init_ex(LIBSSH2_ALLOC_FUNC((*my_alloc)),
         session->alloc = local_alloc;
         session->free = local_free;
         session->realloc = local_realloc;
+        session->send = _libssh2_send;
+        session->recv = _libssh2_recv;
         session->abstract = abstract;
         session->api_timeout = 0; /* timeout-free API by default */
         session->api_block_mode = 1; /* blocking API by default */
@@ -532,6 +534,15 @@ libssh2_session_callback_set(LIBSSH2_SESSION * session,
         session->x11 = callback;
         return oldcb;
 
+    case LIBSSH2_CALLBACK_SEND:
+        oldcb = session->send;
+        session->send = callback;
+        return oldcb;
+
+    case LIBSSH2_CALLBACK_RECV:
+        oldcb = session->recv;
+        session->recv = callback;
+        return oldcb;
     }
     _libssh2_debug(session, LIBSSH2_TRACE_TRANS, "Setting Callback %d", cbtype);
 
diff --git a/src/transport.c b/src/transport.c
index 0cb7b63..29be2a2 100644
--- a/src/transport.c
+++ b/src/transport.c
@@ -357,9 +357,9 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session)
 
             /* now read a big chunk from the network into the temp buffer */
             nread =
-                _libssh2_recv(session->socket_fd, &p->buf[remainbuf],
+                session->recv(session->socket_fd, &p->buf[remainbuf],
                               PACKETBUFSIZE - remainbuf,
-                              LIBSSH2_SOCKET_RECV_FLAGS(session));
+                              LIBSSH2_SOCKET_RECV_FLAGS(session),&session->abstract);
             if (nread <= 0) {
                 /* check if this is due to EAGAIN and return the special
                    return code if so, error out normally otherwise */
@@ -610,7 +610,7 @@ send_existing(LIBSSH2_SESSION *session, const unsigned char *data,
     /* number of bytes left to send */
     length = p->ototal_num - p->osent;
 
-    rc = _libssh2_send(session->socket_fd, &p->outbuf[p->osent], length,
+    rc = LIBSSH2_SEND(session, &p->outbuf[p->osent], length,
                        LIBSSH2_SOCKET_SEND_FLAGS(session));
     if (rc < 0)
         _libssh2_debug(session, LIBSSH2_TRACE_SOCKET,
@@ -823,7 +823,7 @@ int _libssh2_transport_send(LIBSSH2_SESSION *session,
 
     session->local.seqno++;
 
-    ret = _libssh2_send(session->socket_fd, p->outbuf, total_length,
+    ret = LIBSSH2_SEND(session, p->outbuf, total_length,
                         LIBSSH2_SOCKET_SEND_FLAGS(session));
     if (ret < 0)
         _libssh2_debug(session, LIBSSH2_TRACE_SOCKET,

--=-eDEvnqhEZedK5bzqqRcs
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

--=-eDEvnqhEZedK5bzqqRcs--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 22:57:14 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7BKv87M031135;
	Thu, 11 Aug 2011 22:57:14 +0200
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 p7BKv6xZ031129
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 22:57:06 +0200
Date: Thu, 11 Aug 2011 22:57:06 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: send/recv callbacks (was Re: writing to channel limited to 2 Mb?)
In-Reply-To: <1313095259.26614.21.camel@henriknordstrom.net>
Message-ID: <alpine.DEB.2.00.1108112254180.26845@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
	<alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
	<CAD+sJONY8CXFJFO57wMrKpY8vnvDp7-+yB4Mp9ip4_k3tJz0PQ@mail.gmail.com>
	<alpine.DEB.2.00.1108111114350.2795@tvnag.unkk.fr>
	<CAD+sJOMpxWftPtdrr1nUfTthgnXOt7HYVSLoBOm2Qe8k=fhj8w@mail.gmail.com>
	<alpine.DEB.2.00.1108111138240.2795@tvnag.unkk.fr>
	<1313095259.26614.21.camel@henriknordstrom.net>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED;
	BOUNDARY="1129329158-553238134-1313096226=:26845"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 22:57:14 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 11 Aug 2011 22:57:06 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-553238134-1313096226=:26845
Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8BIT

On Thu, 11 Aug 2011, Henrik NordstrÃ¶m wrote:

> I think a simpler way is to make all SSH send/recv go via session->send/recv 
> set by default to _libssh2_send/recv
>
> Additionally agent.c is also using _libssh2_send/recv with a slightly 
> different usage pattern, doing I/O on the agent fd and not the libssh2 
> session fd.
>
> Reworked patch attached. Can also be found in my github repository where 
> various other small changes also resides while I am reading the code.

I think it looks really good. Is there anyone around with (different) opinions 
on Henrik's approach?

-- 

  / daniel.haxx.se

--1129329158-553238134-1313096226=:26845
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

--1129329158-553238134-1313096226=:26845--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 11 23:34:51 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7BLYeQe018577;
	Thu, 11 Aug 2011 23:34:49 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7BLYcti018557
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 23:34:38 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7BLYfZ1009322
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 21:34:42 GMT
Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged))
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7BLYdIX027374
	for <libssh2-devel@cool.haxx.se>; Thu, 11 Aug 2011 23:34:40 +0200
Subject: Re: send/recv callbacks (was Re: writing to channel limited to 2 Mb?)
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Thu, 11 Aug 2011 23:34:39 +0200
In-Reply-To: <alpine.DEB.2.00.1108112254180.26845@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<CAD+sJOMZ_hXGhOH9Mk3s72dEHYkV0u1NCrw6ALJ-M0a=wLxpCQ@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
	<alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
	<CAD+sJONY8CXFJFO57wMrKpY8vnvDp7-+yB4Mp9ip4_k3tJz0PQ@mail.gmail.com>
	<alpine.DEB.2.00.1108111114350.2795@tvnag.unkk.fr>
	<CAD+sJOMpxWftPtdrr1nUfTthgnXOt7HYVSLoBOm2Qe8k=fhj8w@mail.gmail.com>
	<alpine.DEB.2.00.1108111138240.2795@tvnag.unkk.fr>
	<1313095259.26614.21.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108112254180.26845@tvnag.unkk.fr>
Content-Type: multipart/mixed; boundary="=-AELYAPPypZUGK9oQ4UnH"
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Message-ID: <1313098480.26614.26.camel@henriknordstrom.net>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 11 Aug 2011 23:34:51 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Thu, 11 Aug 2011 23:34:38 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Thu, 11 Aug 2011 21:34:43 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se


--=-AELYAPPypZUGK9oQ4UnH
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

tor 2011-08-11 klockan 22:57 +0200 skrev Daniel Stenberg:
> On Thu, 11 Aug 2011, Henrik NordstrÃ¶m wrote:
> 
> > I think a simpler way is to make all SSH send/recv go via session->send/recv 
> > set by default to _libssh2_send/recv
> >
> > Additionally agent.c is also using _libssh2_send/recv with a slightly 
> > different usage pattern, doing I/O on the agent fd and not the libssh2 
> > session fd.
> >
> > Reworked patch attached. Can also be found in my github repository where 
> > various other small changes also resides while I am reading the code.
> 
> I think it looks really good. Is there anyone around with (different) opinions 
> on Henrik's approach?

Just saw a slight omission in the patch. In transport.c there was one
direct use of session->send instead of using the LIBSSH2_SEND macro
wrapper. Updated patch attached.

Regards
Henrik

--=-AELYAPPypZUGK9oQ4UnH
Content-Disposition: attachment; filename="libssh2_io_callbacks.patch"
Content-Type: text/x-patch; name="libssh2_io_callbacks.patch"; charset="UTF-8"
Content-Transfer-Encoding: 7bit

commit b266c5323004b9b66898a69af7ab4dd44b1556f9
Author: Henrik Nordstrom <henrik@henriknordstrom.net>
Date:   Thu Aug 11 22:26:56 2011 +0200

    Custom callbacks for performing low level socket I/O

diff --git a/docs/libssh2_session_callback_set.3 b/docs/libssh2_session_callback_set.3
index 4e5aa9c..1a42401 100644
--- a/docs/libssh2_session_callback_set.3
+++ b/docs/libssh2_session_callback_set.3
@@ -33,6 +33,12 @@ Called when a mismatched MAC has been detected in the transport layer. If the
 function returns 0, the packet will be accepted nonetheless.
 .IP LIBSSH2_CALLBACK_X11
 Called when an X11 connection has been accepted
+.IP LIBSSH2_CALLBACK_SEND
+Called when libssh2 wants to send some data on the connection.
+Can be set to a custom function to handle I/O your own way.
+.IP LIBSSH2_CALLBACK_RECV
+Called when libssh2 wants to receive some data from the connection.
+Can be set to a custom function to handle I/O your own way.
 .SH RETURN VALUE
 Pointer to previous callback handler. Returns NULL if no prior callback
 handler was set or the callback type was unknown.
diff --git a/include/libssh2.h b/include/libssh2.h
index 2a997ae..f5c791a 100644
--- a/include/libssh2.h
+++ b/include/libssh2.h
@@ -237,12 +237,22 @@ typedef struct _LIBSSH2_USERAUTH_KBDINT_RESPONSE
   void name(LIBSSH2_SESSION *session, void **session_abstract, \
             LIBSSH2_CHANNEL *channel, void **channel_abstract)
 
+/* I/O callbacks */
+#define LIBSSH2_RECV_FUNC(name)  ssize_t name(int socket, \
+                                              void *buffer, size_t length, \
+                                              int flags, void **abstract)
+#define LIBSSH2_SEND_FUNC(name)  ssize_t name(int socket, \
+                                              const void *buffer, size_t length,\
+                                              int flags, void **abstract)
+
 /* libssh2_session_callback_set() constants */
 #define LIBSSH2_CALLBACK_IGNORE             0
 #define LIBSSH2_CALLBACK_DEBUG              1
 #define LIBSSH2_CALLBACK_DISCONNECT         2
 #define LIBSSH2_CALLBACK_MACERROR           3
 #define LIBSSH2_CALLBACK_X11                4
+#define LIBSSH2_CALLBACK_SEND               5
+#define LIBSSH2_CALLBACK_RECV               6
 
 /* libssh2_session_method_pref() constants */
 #define LIBSSH2_METHOD_KEX          0
diff --git a/src/agent.c b/src/agent.c
index 7c6eaa3..5a9e81c 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -177,7 +177,7 @@ agent_transact_unix(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx)
     /* Send the length of the request */
     if (transctx->state == agent_NB_state_request_created) {
         _libssh2_htonu32(buf, transctx->request_len);
-        rc = _libssh2_send(agent->fd, buf, sizeof buf, 0);
+        rc = LIBSSH2_SEND_FD(agent->session, agent->fd, buf, sizeof buf, 0);
         if (rc == -EAGAIN)
             return LIBSSH2_ERROR_EAGAIN;
         else if (rc < 0)
@@ -188,7 +188,7 @@ agent_transact_unix(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx)
 
     /* Send the request body */
     if (transctx->state == agent_NB_state_request_length_sent) {
-        rc = _libssh2_send(agent->fd, transctx->request,
+        rc = LIBSSH2_SEND_FD(agent->session, agent->fd, transctx->request,
                            transctx->request_len, 0);
         if (rc == -EAGAIN)
             return LIBSSH2_ERROR_EAGAIN;
@@ -200,7 +200,7 @@ agent_transact_unix(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx)
 
     /* Receive the length of a response */
     if (transctx->state == agent_NB_state_request_sent) {
-        rc = _libssh2_recv(agent->fd, buf, sizeof buf, 0);
+        rc = LIBSSH2_RECV_FD(agent->session, agent->fd, buf, sizeof buf, 0);
         if (rc < 0) {
             if (rc == -EAGAIN)
                 return LIBSSH2_ERROR_EAGAIN;
@@ -218,7 +218,7 @@ agent_transact_unix(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx)
 
     /* Receive the response body */
     if (transctx->state == agent_NB_state_response_length_received) {
-        rc = _libssh2_recv(agent->fd, transctx->response,
+        rc = LIBSSH2_RECV_FD(agent->session, agent->fd, transctx->response,
                            transctx->response_len, 0);
         if (rc < 0) {
             if (rc == -EAGAIN)
diff --git a/src/libssh2_priv.h b/src/libssh2_priv.h
index 473e9c3..d2f8054 100644
--- a/src/libssh2_priv.h
+++ b/src/libssh2_priv.h
@@ -171,6 +171,12 @@ static inline int writev(int sock, struct iovec *iov, int nvecs)
 
 #define LIBSSH2_CHANNEL_CLOSE(session, channel)                     channel->close_cb((session), &(session)->abstract, (channel), &(channel)->abstract)
 
+#define LIBSSH2_SEND_FD(session, fd, buffer, length, flags)                session->send(fd, buffer, length, flags, &session->abstract)
+#define LIBSSH2_RECV_FD(session, fd, buffer, length, flags)                session->recv(fd, buffer, length, flags, &session->abstract)
+
+#define LIBSSH2_SEND(session, buffer, length, flags)                LIBSSH2_SEND_FD(session, session->socket_fd, buffer, length, flags)
+#define LIBSSH2_RECV(session, buffer, length, flags)                LIBSSH2_SEND_FD(session, session->socket_fd, buffer, length, flags)
+
 typedef struct _LIBSSH2_KEX_METHOD LIBSSH2_KEX_METHOD;
 typedef struct _LIBSSH2_HOSTKEY_METHOD LIBSSH2_HOSTKEY_METHOD;
 typedef struct _LIBSSH2_CRYPT_METHOD LIBSSH2_CRYPT_METHOD;
@@ -539,6 +545,8 @@ struct _LIBSSH2_SESSION
       LIBSSH2_DISCONNECT_FUNC((*ssh_msg_disconnect));
       LIBSSH2_MACERROR_FUNC((*macerror));
       LIBSSH2_X11_OPEN_FUNC((*x11));
+      LIBSSH2_SEND_FUNC((*send));
+      LIBSSH2_RECV_FUNC((*recv));
 
     /* Method preferences -- NULL yields "load order" */
     char *kex_prefs;
@@ -972,9 +980,9 @@ _libssh2_debug(LIBSSH2_SESSION * session, int context, const char *format, ...)
 #define SSH_OPEN_RESOURCE_SHORTAGE           4
 
 ssize_t _libssh2_recv(libssh2_socket_t socket, void *buffer,
-                      size_t length, int flags);
+                      size_t length, int flags, void **abstract);
 ssize_t _libssh2_send(libssh2_socket_t socket, const void *buffer,
-                      size_t length, int flags);
+                      size_t length, int flags, void **abstract);
 
 #define LIBSSH2_READ_TIMEOUT 60 /* generic timeout in seconds used when
                                    waiting for more data to arrive */
diff --git a/src/misc.c b/src/misc.c
index cc07fc6..a9f423a 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -94,7 +94,7 @@ static int wsa2errno(void)
  * Replacement for the standard recv, return -errno on failure.
  */
 ssize_t
-_libssh2_recv(libssh2_socket_t sock, void *buffer, size_t length, int flags)
+_libssh2_recv(libssh2_socket_t sock, void *buffer, size_t length, int flags, void **abstract)
 {
     ssize_t rc = recv(sock, buffer, length, flags);
 #ifdef WIN32
@@ -126,7 +126,7 @@ _libssh2_recv(libssh2_socket_t sock, void *buffer, size_t length, int flags)
  */
 ssize_t
 _libssh2_send(libssh2_socket_t sock, const void *buffer, size_t length,
-              int flags)
+              int flags, void **abstract)
 {
     ssize_t rc = send(sock, buffer, length, flags);
 #ifdef WIN32
diff --git a/src/session.c b/src/session.c
index 46ef016..50d08ee 100644
--- a/src/session.c
+++ b/src/session.c
@@ -115,7 +115,7 @@ banner_receive(LIBSSH2_SESSION * session)
         /* no incoming block yet! */
         session->socket_block_directions &= ~LIBSSH2_SESSION_BLOCK_INBOUND;
 
-        ret = _libssh2_recv(session->socket_fd, &c, 1,
+        ret = LIBSSH2_RECV(session, &c, 1,
                             LIBSSH2_SOCKET_RECV_FLAGS(session));
         if (ret < 0) {
             if(session->api_block_mode || (ret != -EAGAIN))
@@ -227,7 +227,7 @@ banner_send(LIBSSH2_SESSION * session)
     /* no outgoing block yet! */
     session->socket_block_directions &= ~LIBSSH2_SESSION_BLOCK_OUTBOUND;
 
-    ret = _libssh2_send(session->socket_fd,
+    ret = LIBSSH2_SEND(session,
                         banner + session->banner_TxRx_total_send,
                         banner_len - session->banner_TxRx_total_send,
                         LIBSSH2_SOCKET_SEND_FLAGS(session));
@@ -481,6 +481,8 @@ libssh2_session_init_ex(LIBSSH2_ALLOC_FUNC((*my_alloc)),
         session->alloc = local_alloc;
         session->free = local_free;
         session->realloc = local_realloc;
+        session->send = _libssh2_send;
+        session->recv = _libssh2_recv;
         session->abstract = abstract;
         session->api_timeout = 0; /* timeout-free API by default */
         session->api_block_mode = 1; /* blocking API by default */
@@ -532,6 +534,15 @@ libssh2_session_callback_set(LIBSSH2_SESSION * session,
         session->x11 = callback;
         return oldcb;
 
+    case LIBSSH2_CALLBACK_SEND:
+        oldcb = session->send;
+        session->send = callback;
+        return oldcb;
+
+    case LIBSSH2_CALLBACK_RECV:
+        oldcb = session->recv;
+        session->recv = callback;
+        return oldcb;
     }
     _libssh2_debug(session, LIBSSH2_TRACE_TRANS, "Setting Callback %d", cbtype);
 
diff --git a/src/transport.c b/src/transport.c
index 0cb7b63..057dcf5 100644
--- a/src/transport.c
+++ b/src/transport.c
@@ -357,7 +357,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session)
 
             /* now read a big chunk from the network into the temp buffer */
             nread =
-                _libssh2_recv(session->socket_fd, &p->buf[remainbuf],
+                LIBSSH2_RECV(session, &p->buf[remainbuf],
                               PACKETBUFSIZE - remainbuf,
                               LIBSSH2_SOCKET_RECV_FLAGS(session));
             if (nread <= 0) {
@@ -610,7 +610,7 @@ send_existing(LIBSSH2_SESSION *session, const unsigned char *data,
     /* number of bytes left to send */
     length = p->ototal_num - p->osent;
 
-    rc = _libssh2_send(session->socket_fd, &p->outbuf[p->osent], length,
+    rc = LIBSSH2_SEND(session, &p->outbuf[p->osent], length,
                        LIBSSH2_SOCKET_SEND_FLAGS(session));
     if (rc < 0)
         _libssh2_debug(session, LIBSSH2_TRACE_SOCKET,
@@ -823,7 +823,7 @@ int _libssh2_transport_send(LIBSSH2_SESSION *session,
 
     session->local.seqno++;
 
-    ret = _libssh2_send(session->socket_fd, p->outbuf, total_length,
+    ret = LIBSSH2_SEND(session, p->outbuf, total_length,
                         LIBSSH2_SOCKET_SEND_FLAGS(session));
     if (ret < 0)
         _libssh2_debug(session, LIBSSH2_TRACE_SOCKET,

--=-AELYAPPypZUGK9oQ4UnH
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

--=-AELYAPPypZUGK9oQ4UnH--

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 12 15:52:45 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7CDqG36029127;
	Fri, 12 Aug 2011 15:52:40 +0200
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 p7CDqFY1029120
	for <libssh2-devel@cool.haxx.se>; Fri, 12 Aug 2011 15:52:15 +0200
Received: (qmail 22149 invoked from network); 12 Aug 2011 13:52:17 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 12 Aug 2011 13:52: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: Fri, 12 Aug 2011 13:52:17 -0000
X-URL: http://trac.libssh2.org/
Subject: [libssh2] #223: errors in multi threads applications
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/223
Message-ID: <057.08a849581ce35049044fa3ec853ef047@libssh2.stuge.se>
X-Trac-Ticket-ID: 223
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 12 Aug 2011 15:52:45 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 12 Aug 2011 15:52:15 +0200 (CEST)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p7CDqFY1029120
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p7CDqG36029127

#223: errors in multi threads applications
------------------------------------+---------------------------------------
  Reporter:  mmichele1974@â€¦         |       Owner:       
      Type:  defect                 |      Status:  new  
  Priority:  normal                 |   Milestone:  1.2.9
 Component:  SFTP                   |     Version:  1.2.7
  Keywords:  sftp curl multithread  |      Blocks:       
Blocked By:                         |  
------------------------------------+---------------------------------------
 Hi,
 I'm using libCURL with libssh2 to make multiple put/get to/from sftp
 sites.
 In order to make my application thread-safe I added the two callbacks:
     CRYPTO_set_id_callback(pthreads_thread_id_callback);
     CRYPTO_set_locking_callback(pthreads_locking_callback);
 in order to lock common data user to crypt/decrypt.
 Unfortunately I take the following segfault:


 (gdb) where
 #0  0x0000000000000000 in ?? ()
 #1  0x0000003980c1bd33 in _libssh2_cipher_crypt (ctx=<value optimized
 out>, algo=<value optimized out>, encrypt=<value optimized out>,
 block=0x7fe45c01f450 "")
     at openssl.c:197
 #2  0x0000003980c18cc9 in _libssh2_transport_write
 (session=0x7fe45c00af10, data=0x7fe45c017f80 "^", data_len=16422) at
 transport.c:819
 #3  0x0000003980c05c6c in _libssh2_channel_write (channel=0x7fe45c0103f0,
 stream_id=0, buf=0x7fe45c013f50 "", buflen=16413) at channel.c:2014
 #4  0x0000003980c1356a in sftp_write (hnd=0x7fe45c00fdd0,
 buffer=0x7fe45c005989 "", count=<value optimized out>) at sftp.c:1432
 #5  libssh2_sftp_write (hnd=0x7fe45c00fdd0, buffer=0x7fe45c005989 "",
 count=<value optimized out>) at sftp.c:1486
 #6  0x000000398183b4e3 in Curl_sftp_send () from /usr/lib64/libcurl.so.4
 #7  0x0000003981817a65 in Curl_write () from /usr/lib64/libcurl.so.4
 #8  0x000000398182b1c7 in Curl_readwrite () from /usr/lib64/libcurl.so.4
 #9  0x000000398182bca8 in Curl_perform () from /usr/lib64/libcurl.so.4
 #10 0x00007fe4c30eded3 in acs::curl::Curl::performTransfer
 (this=0x7fe4a4011cc0, isGet=false, fileToTransfer="", targetFilename=
     "/data/testDSDdata/outBasketDC-Implicit//.bigTar.tar",
 readData=0x7fe4a4011cc0) at Curl.C:522
 ...


 How can I solve this issue?
 Thanks.

-- 
Ticket URL: <http://trac.libssh2.org/ticket/223>
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  Fri Aug 12 17:43:37 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7CFhNKL004892;
	Fri, 12 Aug 2011 17:43:35 +0200
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 p7CFhM6i004856
	for <libssh2-devel@cool.haxx.se>; Fri, 12 Aug 2011 17:43:22 +0200
Received: (qmail 15802 invoked from network); 12 Aug 2011 15:43:02 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 12 Aug 2011 15:43:02 -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: Fri, 12 Aug 2011 15:43:02 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #223: errors in multi threads applications
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/223#comment:1
Message-ID: <072.9eb28b6d48a93d0ec0970a87af066547@libssh2.stuge.se>
References: <057.08a849581ce35049044fa3ec853ef047@libssh2.stuge.se>
X-Trac-Ticket-ID: 223
In-Reply-To: <057.08a849581ce35049044fa3ec853ef047@libssh2.stuge.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 12 Aug 2011 17:43:37 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 12 Aug 2011 17:43:22 +0200 (CEST)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p7CFhM6i004856
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p7CFhNKL004892

#223: errors in multi threads applications
------------------------------------+---------------------------------------
  Reporter:  mmichele1974@â€¦         |        Owner:                       
      Type:  defect                 |       Status:  new                  
  Priority:  normal                 |    Milestone:  1.2.9                
 Component:  SFTP                   |      Version:  1.2.7                
Resolution:                         |     Keywords:  sftp curl multithread
    Blocks:                         |   Blocked By:                       
------------------------------------+---------------------------------------

Comment (by hno):

 Does it work if you limit the application to a single thread?

-- 
Ticket URL: <http://trac.libssh2.org/ticket/223#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  Fri Aug 12 23:45:43 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7CLjJOQ003353;
	Fri, 12 Aug 2011 23:45:39 +0200
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 p7CLjHdH003299
	for <libssh2-devel@cool.haxx.se>; Fri, 12 Aug 2011 23:45:17 +0200
Received: (qmail 26151 invoked from network); 12 Aug 2011 21:45:21 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 12 Aug 2011 21:45: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: Fri, 12 Aug 2011 21:45:21 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #223: errors in multi threads applications
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/223#comment:2
Message-ID: <072.94d6926209f765b1025aeffffc4e420d@libssh2.stuge.se>
References: <057.08a849581ce35049044fa3ec853ef047@libssh2.stuge.se>
X-Trac-Ticket-ID: 223
In-Reply-To: <057.08a849581ce35049044fa3ec853ef047@libssh2.stuge.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 12 Aug 2011 23:45:43 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 12 Aug 2011 23:45:18 +0200 (CEST)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p7CLjHdH003299
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p7CLjJOQ003353

#223: errors in multi threads applications
------------------------------------+---------------------------------------
  Reporter:  mmichele1974@â€¦         |        Owner:                       
      Type:  defect                 |       Status:  new                  
  Priority:  normal                 |    Milestone:  1.2.9                
 Component:  SFTP                   |      Version:  1.2.7                
Resolution:                         |     Keywords:  sftp curl multithread
    Blocks:                         |   Blocked By:                       
------------------------------------+---------------------------------------

Comment (by bagder):

 Further, it will help if you rebuild your libssh2 completely without -O so
 that you get all symbols properly.

 Did the mutex callbacks get called at all in the crashing case?

 Can you try with libssh2 1.2.8 also and see if the bug still remains? It
 would be a bit pointless to hunt for a problem if it is already fixed!

-- 
Ticket URL: <http://trac.libssh2.org/ticket/223#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  Mon Aug 15 20:22:21 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7FILqjd014417;
	Mon, 15 Aug 2011 20:22:17 +0200
Received: from samir.ibcsolutions.de (samir.ibcsolutions.de [78.47.90.66])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7FILoiY014410
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Mon, 15 Aug 2011 20:21:51 +0200
Received: from f055220006.adsl.alicedsl.de ([78.55.220.6] helo=[192.168.1.53])
	by samir.ibcsolutions.de with esmtpa (Exim 4.69)
	(envelope-from <aep@exys.org>)
	id 1Qt3j8-0003bY-7H; Mon, 15 Aug 2011 22:25:38 +0200
Message-ID: <4E4963BF.1070206@exys.org>
Date: Mon, 15 Aug 2011 20:21:51 +0200
From: Arvid Picciani <aep@exys.org>
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20110624 Thunderbird/5.0
MIME-Version: 1.0
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: send/recv callbacks (was Re: writing to channel limited to 2 Mb?)
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
	<alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
	<CAD+sJONY8CXFJFO57wMrKpY8vnvDp7-+yB4Mp9ip4_k3tJz0PQ@mail.gmail.com>
	<alpine.DEB.2.00.1108111114350.2795@tvnag.unkk.fr>
	<CAD+sJOMpxWftPtdrr1nUfTthgnXOt7HYVSLoBOm2Qe8k=fhj8w@mail.gmail.com>
	<alpine.DEB.2.00.1108111138240.2795@tvnag.unkk.fr>
	<1313095259.26614.21.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108112254180.26845@tvnag.unkk.fr>
	<1313098480.26614.26.camel@henriknordstrom.net>
In-Reply-To: <1313098480.26614.26.camel@henriknordstrom.net>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Mon, 15 Aug 2011 20:22:21 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Mon, 15 Aug 2011 20:21:51 +0200 (CEST)
Cc: =?ISO-8859-1?Q?Henrik_Nordstr=F6m?= <henrik@henriknordstrom.net>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se




>>> Reworked patch attached. Can also be found in my github repository where
>>> various other small changes also resides while I am reading the code.


Nice work, could you submit this to qxt as well?
I think it makes sense to update the internal copy, and even drop it 
completely once its upstream.
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Mon Aug 15 22:48:25 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7FKm8nc002034;
	Mon, 15 Aug 2011 22:48:23 +0200
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 p7FKm7pY002023; 
	Mon, 15 Aug 2011 22:48:07 +0200
Date: Mon, 15 Aug 2011 22:48:07 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: send/recv callbacks (was Re: writing to channel limited to 2 Mb?)
In-Reply-To: <4E4963BF.1070206@exys.org>
Message-ID: <alpine.DEB.2.00.1108152246180.9634@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
	<alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
	<CAD+sJONY8CXFJFO57wMrKpY8vnvDp7-+yB4Mp9ip4_k3tJz0PQ@mail.gmail.com>
	<alpine.DEB.2.00.1108111114350.2795@tvnag.unkk.fr>
	<CAD+sJOMpxWftPtdrr1nUfTthgnXOt7HYVSLoBOm2Qe8k=fhj8w@mail.gmail.com>
	<alpine.DEB.2.00.1108111138240.2795@tvnag.unkk.fr>
	<1313095259.26614.21.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108112254180.26845@tvnag.unkk.fr>
	<1313098480.26614.26.camel@henriknordstrom.net>
	<4E4963BF.1070206@exys.org>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Mon, 15 Aug 2011 22:48:25 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Mon, 15 Aug 2011 22:48:07 +0200 (CEST)
Cc: =?ISO-8859-15?Q?Henrik_Nordstr=F6m?= <henrik@henriknordstrom.net>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Mon, 15 Aug 2011, Arvid Picciani wrote:

>> Reworked patch attached.
>
> Nice work

Yes, I agree. I'd like to release 1.2.9 first though as a pure bugfix release 
and then merge Henrik's work into mainline and work towards a 1.3.0.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Mon Aug 15 23:47:38 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7FLlM4Y001296;
	Mon, 15 Aug 2011 23:47:36 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7FLlKGa001288
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Mon, 15 Aug 2011 23:47:20 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7FLlK94009509
	for <libssh2-devel@cool.haxx.se>; Mon, 15 Aug 2011 21:47:22 GMT
Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged))
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7FLlJwn012061
	for <libssh2-devel@cool.haxx.se>; Mon, 15 Aug 2011 23:47:19 +0200
Subject: Re: send/recv callbacks (was Re: writing to channel limited to 2 Mb?)
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Mon, 15 Aug 2011 23:47:19 +0200
In-Reply-To: <4E4963BF.1070206@exys.org>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<alpine.DEB.2.00.1108102245001.28768@tvnag.unkk.fr>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
	<alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
	<CAD+sJONY8CXFJFO57wMrKpY8vnvDp7-+yB4Mp9ip4_k3tJz0PQ@mail.gmail.com>
	<alpine.DEB.2.00.1108111114350.2795@tvnag.unkk.fr>
	<CAD+sJOMpxWftPtdrr1nUfTthgnXOt7HYVSLoBOm2Qe8k=fhj8w@mail.gmail.com>
	<alpine.DEB.2.00.1108111138240.2795@tvnag.unkk.fr>
	<1313095259.26614.21.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108112254180.26845@tvnag.unkk.fr>
	<1313098480.26614.26.camel@henriknordstrom.net>
	<4E4963BF.1070206@exys.org>
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Message-ID: <1313444839.6020.44.camel@henriknordstrom.net>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Mon, 15 Aug 2011 23:47:38 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Mon, 15 Aug 2011 23:47:20 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Mon, 15 Aug 2011 21:47:23 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p7FLlM4Y001296

mÃ¥n 2011-08-15 klockan 20:21 +0200 skrev Arvid Picciani:

> Nice work, could you submit this to qxt as well?
> I think it makes sense to update the internal copy, and even drop it 
> completely once its upstream.

API and functionality is the exactly same, only implementation differ,
and qxt will trivially notice the change once they import it from
upstream.

But yes, would be friendly to notify them.

Regards
Henrik

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

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 16 02:31:21 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7G0V0L9015878;
	Tue, 16 Aug 2011 02:31:19 +0200
Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com
	[209.85.212.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7G0UwO3015860
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 02:30:59 +0200
Received: by vws18 with SMTP id 18so5868064vws.41
	for <libssh2-devel@cool.haxx.se>; Mon, 15 Aug 2011 17:30:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=+Vxb+GF6gR+gZw9Gv+rLQTUj2YWsA+FTVadADuf8AUQ=;
	b=xZKgDw4aYnnUOLSwxtd8gDkWbUVMgSk140fVbziU/9ySBMf9J0FdmiR+g8uMUH9fFM
	YGffhpsqYVgruJeV8BWrTI6IUp75G43Wi5fOtsmdqMl29aoMIFjMbXyVELBTdSrNKKfb
	WdSfAj23MTiW0JCGo6Z7OqDAjoxug08wUQC+A=
MIME-Version: 1.0
Received: by 10.52.68.208 with SMTP id y16mr4273894vdt.184.1313454659042; Mon,
	15 Aug 2011 17:30:59 -0700 (PDT)
Received: by 10.52.158.68 with HTTP; Mon, 15 Aug 2011 17:30:59 -0700 (PDT)
Date: Mon, 15 Aug 2011 17:30:59 -0700
X-Google-Sender-Auth: 6u9O15qWA5nkcSpiG0G7YOWj3es
Message-ID: <CAB5XKbzTKQdJPM-tpE_1HuxA1mbAz_4f+Z+NMPCFbKdAY0LAJw@mail.gmail.com>
Subject: How to get file descriptor of channel?
From: Pavel Strashkin <pavel.strashkin@gmail.com>
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 16 Aug 2011 02:31:21 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 16 Aug 2011 02:30:59 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

Hello folks,

I've started using this very good library and first of i want to say
thanks. The second is i want to know the file descriptor of channel
(or whatever) which is used in select/poll so i could re-use it in my
own polling mechanism (don't ask why, we live in a world of many
libraries and many of them have own readable/writable watchers so i
just want to use one at the time, not all). Is there any way how can i
do it? I checked the public API and didn't find anything interesting.
The original problem comes from using of libnet-ssh2-perl which uses
250ms timeout for polling. 250ms is too much for me, moreover, i don't
want to wait for 250ms on every "read-call" just to check if there is
a data or not. I want to attach a file descriptor to some abstract
watcher, wait for "readable" event and read till the end or
EAGAIN/EWOULDBLOCK (whatever will happen first, it's just an example).

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

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 16 06:35:59 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7G4ZUX6018684;
	Tue, 16 Aug 2011 06:35:56 +0200
Received: from mail-bw0-f72.google.com (mail-bw0-f72.google.com
	[209.85.214.72])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7G4ZSQR018669
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 06:35:28 +0200
Received: by bkat8 with SMTP id t8so1296246bka.11
	for <libssh2-devel@cool.haxx.se>; Mon, 15 Aug 2011 21:35:24 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.204.202.194 with SMTP id ff2mr608151bkb.14.1313469324472; Mon,
	15 Aug 2011 21:35:24 -0700 (PDT)
In-Reply-To: <1313444839.6020.44.camel@henriknordstrom.net>
Message-ID: <485b3970d1ac8232b704aa97e809@google.com>
Date: Tue, 16 Aug 2011 04:35:24 +0000
Subject: Re: Re: send/recv callbacks (was Re: writing to channel limited to 2
	Mb?)
From: qus123@gmail.com
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 16 Aug 2011 06:35:59 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 16 Aug 2011 06:35:29 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1960963307=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1960963307==
Content-Type: multipart/alternative; boundary=485b3970d1ac8232a604aa97e806

--485b3970d1ac8232a604aa97e806
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes


> API and functionality is the exactly same, only implementation differ,

> and qxt will trivially notice the change once they import it from

> upstream.



> But yes, would be friendly to notify them.


And also notify them about EAGAIN returned by write, as I see now it will  
require some tricky changes to their code...

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

&gt; <br />&gt; API and functionality is the exactly same, only implementat=
ion differ,<br />&gt; <br />&gt; and qxt will trivially notice the change o=
nce they import it from<br />&gt; <br />&gt; upstream.<br />&gt; <br />&gt;=
 <br />&gt; <br />&gt; But yes, would be friendly to notify them.<br />&gt;=
 <br />&gt; <br />And also notify them about EAGAIN returned by write, as I=
 see now it will require some tricky changes to their code...
--485b3970d1ac8232a604aa97e806--

--===============1960963307==
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

--===============1960963307==--

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 16 07:36:28 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7G5aCAW021596;
	Tue, 16 Aug 2011 07:36:27 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7G5aBok021593
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 07:36:11 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7G5aBkE014204; Tue, 16 Aug 2011 05:36:12 GMT
Received: from henrik ([127.0.0.1]) (authenticated bits=0)
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7G5a85r017405
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Tue, 16 Aug 2011 07:36:09 +0200
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>,
        Pavel Strashkin <pavel.strashkin@gmail.com>
Subject: Re: How to get file descriptor of channel?
X-Mailer: Modest 3.2
References: <CAB5XKbzTKQdJPM-tpE_1HuxA1mbAz_4f+Z+NMPCFbKdAY0LAJw@mail.gmail.com>
In-Reply-To: <CAB5XKbzTKQdJPM-tpE_1HuxA1mbAz_4f+Z+NMPCFbKdAY0LAJw@mail.gmail.com>
Content-ID: <1313472967.1517.3.camel@Nokia-N900>
Date: Tue, 16 Aug 2011 07:36:08 +0200
Message-Id: <1313472968.1517.4.camel@Nokia-N900>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 16 Aug 2011 07:36:28 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Tue, 16 Aug 2011 07:36:11 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Tue, 16 Aug 2011 05:36:12 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>,
        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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

It's the same filedescriptor you gave in libssh2_session_startup. SSH multiplexes all channels over the same encrypted connection.

See also libssh2_session_blocking_directions() and libssh2_session_set_blocking().



note: libssh2 prefers you use your preferred event loop (select, poll etc). There is a simple event handler provided in libssh2_poll, but it's deprecated and should preferably not be used.

 
----- Ursprungsmeddelande -----
> Hello folks,
> 
> I've started using this very good library and first of i want to say
> thanks. The second is i want to know the file descriptor of channel
> (or whatever) which is used in select/poll so i could re-use it in my
> own polling mechanism (don't ask why, we live in a world of many
> libraries and many of them have own readable/writable watchers so i
> just want to use one at the time, not all). Is there any way how can i
> do it? I checked the public API and didn't find anything interesting.
> The original problem comes from using of libnet-ssh2-perl which uses
> 250ms timeout for polling. 250ms is too much for me, moreover, i don't
> want to wait for 250ms on every "read-call" just to check if there is
> a data or not. I want to attach a file descriptor to some abstract
> watcher, wait for "readable" event and read till the end or
> EAGAIN/EWOULDBLOCK (whatever will happen first, it's just an example).
> 
> Thank you!
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

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

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 16 09:26:00 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7G7Ph9r026645;
	Tue, 16 Aug 2011 09:25:58 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7G7Pfq4026639
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 09:25:41 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7G7PgLZ011637
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 07:25:43 GMT
Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged))
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7G7PeHb021031
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 09:25:40 +0200
Subject: [patch] fix X11 forwarding example reuse after free
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Tue, 16 Aug 2011 09:25:40 +0200
In-Reply-To: <alpine.DEB.2.00.1108152246180.9634@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<1313013842.20733.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108110824040.14697@tvnag.unkk.fr>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
	<alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
	<CAD+sJONY8CXFJFO57wMrKpY8vnvDp7-+yB4Mp9ip4_k3tJz0PQ@mail.gmail.com>
	<alpine.DEB.2.00.1108111114350.2795@tvnag.unkk.fr>
	<CAD+sJOMpxWftPtdrr1nUfTthgnXOt7HYVSLoBOm2Qe8k=fhj8w@mail.gmail.com>
	<alpine.DEB.2.00.1108111138240.2795@tvnag.unkk.fr>
	<1313095259.26614.21.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108112254180.26845@tvnag.unkk.fr>
	<1313098480.26614.26.camel@henriknordstrom.net>
	<4E4963BF.1070206@exys.org>
	<alpine.DEB.2.00.1108152246180.9634@tvnag.unkk.fr>
Content-Type: multipart/mixed; boundary="=-kZZDPHYLP4Oe4HJkWk6Y"
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Message-ID: <1313479540.6020.69.camel@henriknordstrom.net>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 16 Aug 2011 09:26:00 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Tue, 16 Aug 2011 09:25:41 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Tue, 16 Aug 2011 07:25:43 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se


--=-kZZDPHYLP4Oe4HJkWk6Y
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit

mÃ¥n 2011-08-15 klockan 22:48 +0200 skrev Daniel Stenberg:
> On Mon, 15 Aug 2011, Arvid Picciani wrote:
> 
> >> Reworked patch attached.
> >
> > Nice work
> 
> Yes, I agree. I'd like to release 1.2.9 first though as a pure bugfix release 
> and then merge Henrik's work into mainline and work towards a 1.3.0.

Regarding bugfixes you may want to merge 


Avoid reuse after free when closing X11 channels 
https://github.com/hno/libssh2/commit/fa02d23111821a3e2949c6c7f646e064f3b71e1f


And perhaps this keepalive fix as well, but is is not yet complete

Make libssh_keepalive_send a blocking call to avoid corrupting the
transport if the socket becomes saturated while sending the
keep-alive.
https://github.com/hno/libssh2/commit/21ffe0c2ba64dc98a67c635d0c903a93064b015e

the latter still do not handle non-blocking mode well due to buffers
being stack allocated, and there is similar non-blocking issues at a
couple of other places:

Add FIXME markers where _libssh2_transport_send is used badly
https://github.com/hno/libssh2/commit/b64b1813158c16e0506ec96fbc89d134d82d330e

Regards
Henrik

--=-kZZDPHYLP4Oe4HJkWk6Y
Content-Description: Avoid reuse after free when closing X11 channels
Content-Disposition: inline; filename="libssh2_x11_example_free_after_reuse.patch"
Content-Type: text/x-patch; name="libssh2_x11_example_free_after_reuse.patch";
	charset="UTF-8"
Content-Transfer-Encoding: 7bit

commit fa02d23111821a3e2949c6c7f646e064f3b71e1f
Author: Henrik Nordstrom <henrik@henriknordstrom.net>
Date:   Sat Aug 6 13:43:11 2011 +0200

    Avoid reuse after free when closing X11 channels

diff --git a/example/x11.c b/example/x11.c
index 650d0b4..05e316f 100644
--- a/example/x11.c
+++ b/example/x11.c
@@ -408,14 +408,16 @@ main (int argc, char *argv[])
             current_node = NULL;
 
         while (current_node != NULL) {
+            struct chan_X11_list *next_node;
             rc = x11_send_receive(current_node->chan, current_node->sock);
+            next_node = current_node->next;
             if (rc == -1){
                 shutdown(current_node->sock,SHUT_RDWR);
                 close(current_node->sock);
                 remove_node(current_node);
-
             }
-            current_node = current_node->next;
+
+            current_node = next_node;
         }
 
 

--=-kZZDPHYLP4Oe4HJkWk6Y
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

--=-kZZDPHYLP4Oe4HJkWk6Y--

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 16 09:29:28 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7G7TP0S027754;
	Tue, 16 Aug 2011 09:29:27 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7G7TOkK027745
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 09:29:24 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7G7TPwK017671
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 07:29:26 GMT
Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged))
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7G7TNLX021390
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 09:29:23 +0200
Subject: Re: Re: send/recv callbacks (was Re: writing to channel limited to
	2 Mb?)
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Tue, 16 Aug 2011 09:29:23 +0200
In-Reply-To: <485b3970d1ac8232b704aa97e809@google.com>
References: <485b3970d1ac8232b704aa97e809@google.com>
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Message-ID: <1313479763.6020.73.camel@henriknordstrom.net>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 16 Aug 2011 09:29:28 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Tue, 16 Aug 2011 09:29:24 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Tue, 16 Aug 2011 07:29:26 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

tis 2011-08-16 klockan 04:35 +0000 skrev qus123@gmail.com:

> And also notify them about EAGAIN returned by write, as I see now it
> will require some tricky changes to their code...

Does it? From what I could see in the code you quoted earlier they merge
EAGAIN and ret==0 as return 0. But I have no idea of what kind of event
loop handling qxt is using. The upper levels will need to handle that as
EAGAIN somehow.

Regards
Henrik

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

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 16 10:10:42 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7G8AQkk019815;
	Tue, 16 Aug 2011 10:10:40 +0200
Received: from mail-pz0-f43.google.com (mail-pz0-f43.google.com
	[209.85.210.43])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7G8AOF6019749
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 10:10:25 +0200
Received: by pzk1 with SMTP id 1so6465501pzk.30
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 01:10:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=HWps8igSxIxXknFp37JoZoQQrDCOMkSDFP+ZiUdmo0A=;
	b=YVsR7CVhjXsiFolosWGYcF6NGbjpCxwmPVP85mmACM1Xxl2K6PFpaqdP2wvvpDcLoP
	6Vq3WELKB+Ee6zuJNvxDt8skHJJDQ5lDaO4T2z7L0NQ4d7Zi+sHMBJ0aVRJJYw41XQ9V
	DzS266QhC4kST2LG97niUc9GoGns5JcCaU7HQ=
MIME-Version: 1.0
Received: by 10.142.169.4 with SMTP id r4mr2566720wfe.423.1313482217383; Tue,
	16 Aug 2011 01:10:17 -0700 (PDT)
Received: by 10.68.47.227 with HTTP; Tue, 16 Aug 2011 01:10:17 -0700 (PDT)
In-Reply-To: <1313479763.6020.73.camel@henriknordstrom.net>
References: <485b3970d1ac8232b704aa97e809@google.com>
	<1313479763.6020.73.camel@henriknordstrom.net>
Date: Tue, 16 Aug 2011 10:10:17 +0200
Message-ID: <CAD+sJOM-9R52Thn7+cdmaYwKNgc3fwCK9RvceYaHgZ8YMdZXsQ@mail.gmail.com>
Subject: Re: Re: send/recv callbacks (was Re: writing to channel limited to 2
	Mb?)
From: =?ISO-8859-2?Q?Przemys=B3aw_Szczygielski?= <qus123@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 16 Aug 2011 10:10:42 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 16 Aug 2011 10:10:26 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1501151079=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1501151079==
Content-Type: multipart/alternative; boundary=000e0cd331dcfc668404aa9ae8be

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

tis 2011-08-16 klockan 04:35 +0000 skrev qus123@gmail.com:

>
> > And also notify them about EAGAIN returned by write, as I see now it
> > will require some tricky changes to their code...
>
> Does it? From what I could see in the code you quoted earlier they merge
> EAGAIN and ret==0 as return 0. But I have no idea of what kind of event
> loop handling qxt is using. The upper levels will need to handle that as
> EAGAIN somehow.
>
> Regards
> Henrik
>
>
It gets a bit tricky with i.e. ssh tunnels. Let's take -L (TCP_channel <->
SSH_channel). In big simplification:

TCP_channel's readyRead signal is connected to
SSH_channel.write(TCP_channel.read())

SSH_channel's readyRead signal is connected to
TCP_channel.write(SSH_channel.read())

This works well until SSH_channel writes only part of the read data (meaning
that next write will cause EAGAIN). I have to store unwritten data
somewhere, wait for EAGAIN to clear and write it to SSH channel. I am not
sure how EAGAIN is cleared but it seems that some traffic on "main" SSH
channel triggers QxtSshChannelPrivate::d_readyRead:

connect(this,SIGNAL(readyRead()),this,SLOT(d_readyRead()));

d_readyRead is a function that processes all live ssh channels (so from
there I ask to write my remaining unwritten buffer and so on).

If there's another SSH channel that has some activity, everything works
without a problem, as EAGAIN gets cleared, d_readyRead processes all
channels and leftover data gets written.

Now the problem arises if I have only one channel on my SSH session: there's
no traffic that will trigger QxtSshChannelPrivate::d_readyRead, so I can't
send the remaining part of my unwritten data...

I am trying different solutions, but each one is uglier than the previous...
But I digress... this is not a qxtlib mailing list.

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

tis 2011-08-16 klockan 04:35 +0000 skrev <a href=3D"mailto:qus123@gmail.com=
">qus123@gmail.com</a>:<br>
<div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margi=
n: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-le=
ft: 1ex;"><div class=3D"im"><br>
&gt; And also notify them about EAGAIN returned by write, as I see now it<b=
r>
&gt; will require some tricky changes to their code...<br>
<br>
</div>Does it? From what I could see in the code you quoted earlier they me=
rge<br>
EAGAIN and ret=3D=3D0 as return 0. But I have no idea of what kind of event=
<br>
loop handling qxt is using. The upper levels will need to handle that as<br=
>
EAGAIN somehow.<br>
<div><div></div><div class=3D"h5"><br>
Regards<br>
Henrik<br>
<br></div></div></blockquote><div><br>It gets a bit tricky with i.e. ssh tu=
nnels. Let&#39;s take -L (TCP_channel &lt;-&gt; SSH_channel). In big simpli=
fication:<br><br>TCP_channel&#39;s readyRead signal is connected to SSH_cha=
nnel.write(TCP_channel.read())<br>
<br>SSH_channel&#39;s readyRead signal is connected to TCP_channel.write(SS=
H_channel.read())<br><br>This works well until SSH_channel writes only part=
 of the read data (meaning that next write will cause EAGAIN). I have to st=
ore unwritten data somewhere, wait for EAGAIN to clear and write it to SSH =
channel. I am not sure how EAGAIN is cleared but it seems that some traffic=
 on &quot;main&quot; SSH channel triggers QxtSshChannelPrivate::d_readyRead=
:<br>
<br><span style=3D"color: rgb(192, 192, 192);">    </span>connect<span styl=
e=3D"color: rgb(0, 0, 0);">(</span><span style=3D"color: rgb(128, 128, 0);"=
>this</span><span style=3D"color: rgb(0, 0, 0);">,</span><span style=3D"col=
or: rgb(128, 128, 0);">SIGNAL</span><span style=3D"color: rgb(0, 0, 0);">(<=
/span>readyRead<span style=3D"color: rgb(0, 0, 0);">()),</span><span style=
=3D"color: rgb(128, 128, 0);">this</span><span style=3D"color: rgb(0, 0, 0)=
;">,</span><span style=3D"color: rgb(128, 128, 0);">SLOT</span><span style=
=3D"color: rgb(0, 0, 0);">(</span>d_readyRead<span style=3D"color: rgb(0, 0=
, 0);">()));</span><br>
<br>d_readyRead is a function that processes all live ssh channels (so from=
 there I ask to write my remaining unwritten buffer and so on).<br><br>If t=
here&#39;s another SSH channel that has some activity, everything works wit=
hout a problem, as EAGAIN gets cleared, d_readyRead processes all channels=
=20
and leftover data gets written.<br><br>Now the problem arises if I have onl=
y one channel on my SSH session:=A0there&#39;s no traffic that will trigger=
=A0QxtSshChannelPrivate::d_readyRead, so I can&#39;t send the remaining par=
t of my unwritten data...<br>
<br>I am trying different solutions, but each one is uglier than the previo=
us... But I digress... this is not a qxtlib mailing list.<br></div></div>

--000e0cd331dcfc668404aa9ae8be--

--===============1501151079==
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

--===============1501151079==--

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 16 10:36:24 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7G8a8KC002140;
	Tue, 16 Aug 2011 10:36:22 +0200
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 p7G8a6vR002129
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 10:36:06 +0200
Date: Tue, 16 Aug 2011 10:36:06 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: [patch] fix X11 forwarding example reuse after free
In-Reply-To: <1313479540.6020.69.camel@henriknordstrom.net>
Message-ID: <alpine.DEB.2.00.1108161031520.25437@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
	<alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
	<CAD+sJONY8CXFJFO57wMrKpY8vnvDp7-+yB4Mp9ip4_k3tJz0PQ@mail.gmail.com>
	<alpine.DEB.2.00.1108111114350.2795@tvnag.unkk.fr>
	<CAD+sJOMpxWftPtdrr1nUfTthgnXOt7HYVSLoBOm2Qe8k=fhj8w@mail.gmail.com>
	<alpine.DEB.2.00.1108111138240.2795@tvnag.unkk.fr>
	<1313095259.26614.21.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108112254180.26845@tvnag.unkk.fr>
	<1313098480.26614.26.camel@henriknordstrom.net>
	<4E4963BF.1070206@exys.org>
	<alpine.DEB.2.00.1108152246180.9634@tvnag.unkk.fr>
	<1313479540.6020.69.camel@henriknordstrom.net>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED;
	BOUNDARY="1129329158-879038150-1313483766=:25437"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 16 Aug 2011 10:36:24 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 16 Aug 2011 10:36:06 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-879038150-1313483766=:25437
Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8BIT

On Tue, 16 Aug 2011, Henrik NordstrÃ¶m wrote:

> Avoid reuse after free when closing X11 channels

Merged!

> And perhaps this keepalive fix as well, but is is not yet complete

I'm a bit curious about that fix. The comment here:

+    /* Skip sending keep-alive if already blocking trying to send something 
*/
+    if ((dir & LIBSSH2_SESSION_BLOCK_OUTBOUND)) {
+        rc = libssh2_keepalive_send (session, &seconds_to_next);

Isn't the comment saying the exact opposite of what the code does? 
LIBSSH2_SESSION_BLOCK_OUTBOUND is set as direction if that was the one that 
was "blocked" and couldn't be fulfilled. Alas, when sending of data couldn't 
be completed this code will try to send the keepalive packet.

Or am I wrong?

> Add FIXME markers where _libssh2_transport_send is used badly
> https://github.com/hno/libssh2/commit/b64b1813158c16e0506ec96fbc89d134d82d330e

This patch seems to rely on the previous keepalive change so I didn't merge it 
yet.

I did however also merge your document fixes as you will see!

Thanks a lot!

-- 

  / daniel.haxx.se
--1129329158-879038150-1313483766=:25437
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

--1129329158-879038150-1313483766=:25437--

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 16 10:58:24 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7G8wHCB015203;
	Tue, 16 Aug 2011 10:58:23 +0200
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 p7G8vB2J014831
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 10:57:11 +0200
Date: Tue, 16 Aug 2011 10:57:11 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: ANNOUNCE: libssh2 1.2.9
Message-ID: <alpine.DEB.2.00.1108161055150.13244@tvnag.unkk.fr>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED;
	BOUNDARY="1129329158-1142444813-1313485031=:13244"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 16 Aug 2011 10:58:24 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 16 Aug 2011 10:57:11 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-1142444813-1313485031=:13244
Content-Type: TEXT/PLAIN; format=flowed; charset=ISO-8859-15
Content-Transfer-Encoding: 8BIT

Hi friends,

I've just tagged and uploaded libssh2 1.2.9 to the site. Get it from 
www.libssh2.org as usual.

libssh2 1.2.9

This release includes the following changes:

  o Added libssh2_session_set_timeout() and libssh2_session_get_timeout()
    to make blocking calls get a timeout

This release includes the following bugfixes:

  o configure and pkg-config: fix $VERSION
  o s/\.NF/.nf/ to fix wrong macro name caught by man --warnings
  o keepalive: add first basic man pages
  o sftp_write: flush the packetlist on error
  o sftp_write: clean offsets on error
  o msvcproj: added libs and debug stuff
  o SCP: fix incorrect error code
  o session_startup: init state properly
  o sftp_write_sliding: send the complete file
  o userauth_keyboard_interactive: skip code on zero length auth
  o _libssh2_wait_socket: fix timeouts for poll() uses
  o agent_list_identities: fix out of scope access
  o _libssh2_recv(): handle ENOENT error as EAGAIN
  o userauth_keyboard_interactive: fix buffer overflow
  o removed man pages for non-existing functions!
  o gettimeofday: fix name space pollution
  o _libssh2_channel_write: handle window_size == 0 better

This release would not have looked like this without help, code, reports and
advice from friends like these:

  Alfred Gebert, Dan Fandrich, Douglas Masterson, Guenter Knauf, Matt Lilley,
  Mikhail Gusarov, Peter Stuge, zl liu, Paul Howarth, Mark Smith, Bill Segall,
  Henrik Nordström

         Thanks! (and sorry if I forgot to mention someone)

-- 

  / daniel.haxx.se
--1129329158-1142444813-1313485031=:13244
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

--1129329158-1142444813-1313485031=:13244--

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 16 15:24:00 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7GDNU0Z026340;
	Tue, 16 Aug 2011 15:23:55 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7GDNTmE026301
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 15:23:29 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7GDNTUD032061
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 13:23:31 GMT
Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged))
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7GDNS0u000446
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 15:23:28 +0200
Subject: Re: [patch] fix X11 forwarding example reuse after free
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Tue, 16 Aug 2011 15:23:28 +0200
In-Reply-To: <alpine.DEB.2.00.1108161031520.25437@tvnag.unkk.fr>
References: <CAD+sJONvOqDf8PCH0OzPcQEumCm81FS6S2g7cqa4hT7ATxzppw@mail.gmail.com>
	<1313047827.26614.3.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108111021090.14697@tvnag.unkk.fr>
	<CAD+sJOM5dsD_O0yy=mn70oKuXyNVwaN+Z8xcvhWFXdhg_xufxA@mail.gmail.com>
	<alpine.DEB.2.00.1108111039300.14697@tvnag.unkk.fr>
	<CAD+sJOPvifw51KgH7skm0evv=dL3KWb+Zk16XgoovHe1eD_O=Q@mail.gmail.com>
	<alpine.DEB.2.00.1108111106010.2795@tvnag.unkk.fr>
	<CAD+sJONY8CXFJFO57wMrKpY8vnvDp7-+yB4Mp9ip4_k3tJz0PQ@mail.gmail.com>
	<alpine.DEB.2.00.1108111114350.2795@tvnag.unkk.fr>
	<CAD+sJOMpxWftPtdrr1nUfTthgnXOt7HYVSLoBOm2Qe8k=fhj8w@mail.gmail.com>
	<alpine.DEB.2.00.1108111138240.2795@tvnag.unkk.fr>
	<1313095259.26614.21.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108112254180.26845@tvnag.unkk.fr>
	<1313098480.26614.26.camel@henriknordstrom.net>
	<4E4963BF.1070206@exys.org>
	<alpine.DEB.2.00.1108152246180.9634@tvnag.unkk.fr>
	<1313479540.6020.69.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108161031520.25437@tvnag.unkk.fr>
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Message-ID: <1313501008.6020.87.camel@henriknordstrom.net>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 16 Aug 2011 15:24:00 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Tue, 16 Aug 2011 15:23:29 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Tue, 16 Aug 2011 13:23:31 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

tis 2011-08-16 klockan 10:36 +0200 skrev Daniel Stenberg:

> +    /* Skip sending keep-alive if already blocking trying to send something 
> */
> +    if ((dir & LIBSSH2_SESSION_BLOCK_OUTBOUND)) {
> +        rc = libssh2_keepalive_send (session, &seconds_to_next);
> 
> Isn't the comment saying the exact opposite of what the code does? 

Right.. sorry about that, and thanks for the peer review. Fixed.

Ideally Id' like to replace that condition with a check if there is ANY
data in the transmit window, and to bump the timer each time something
is transmitted. There should also be some randomization of the interval.
Plus checking that there is some form of return traffic if response is
requested.. but needs some more study before coming up with a solid
proposal.


> > Add FIXME markers where _libssh2_transport_send is used badly
> > https://github.com/hno/libssh2/commit/b64b1813158c16e0506ec96fbc89d134d82d330e
> 
> This patch seems to rely on the previous keepalive change so I didn't merge it 
> yet.

Correct. It was the keep-alive patch that made me aware of the problem.

> I did however also merge your document fixes as you will see!

Thanks!

Regards
Henrik

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

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 16 15:32:25 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7GDWK2g031334;
	Tue, 16 Aug 2011 15:32:23 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7GDWImj031328
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 15:32:18 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7GDWIOr026449
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 13:32:21 GMT
Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged))
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7GDWH0Q000740
	for <libssh2-devel@cool.haxx.se>; Tue, 16 Aug 2011 15:32:17 +0200
Subject: Re: Re: send/recv callbacks (was Re: writing to channel limited to
	2 Mb?)
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Tue, 16 Aug 2011 15:32:17 +0200
In-Reply-To: <CAD+sJOM-9R52Thn7+cdmaYwKNgc3fwCK9RvceYaHgZ8YMdZXsQ@mail.gmail.com>
References: <485b3970d1ac8232b704aa97e809@google.com>
	<1313479763.6020.73.camel@henriknordstrom.net>
	<CAD+sJOM-9R52Thn7+cdmaYwKNgc3fwCK9RvceYaHgZ8YMdZXsQ@mail.gmail.com>
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Message-ID: <1313501537.6020.91.camel@henriknordstrom.net>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 16 Aug 2011 15:32:24 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Tue, 16 Aug 2011 15:32:18 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Tue, 16 Aug 2011 13:32:21 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p7GDWK2g031334

tis 2011-08-16 klockan 10:10 +0200 skrev PrzemysÅ‚aw Szczygielski:

> It gets a bit tricky with i.e. ssh tunnels. Let's take -L (TCP_channel
> <-> SSH_channel). In big simplification:
> 
> TCP_channel's readyRead signal is connected to
> SSH_channel.write(TCP_channel.read())
> 
> SSH_channel's readyRead signal is connected to
> TCP_channel.write(SSH_channel.read())

Ah.. SSH do not have such 1-1 mapping of read/write. You need to check
both directions when there is any readyness and use
libssh2_session_blocking_direction to tell if libssh2 is waiting for
read or write readiness of the underlying socket.

> This works well until SSH_channel writes only part of the read data
> (meaning that next write will cause EAGAIN). I have to store unwritten
> data somewhere, wait for EAGAIN to clear and write it to SSH channel.
> I am not sure how EAGAIN is cleared but it seems that some traffic on
> "main" SSH channel triggers QxtSshChannelPrivate::d_readyRead:

The EAGAIN condiditons is evaluated each time you try to write to the
channel. When you get EAGAIN you wait for the kind of socket event
indicated by libssh2_session_blocking_direction() and then try the exact
same write again.

when the write is successful (positive response) you advance your write
position by the amount returned and then try to write the remainder.

Regards
Henrik


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

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 17 21:17:01 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7HJGYog007067;
	Wed, 17 Aug 2011 21:16:55 +0200
Received: from SRVMEDGARL01.acf.americredit.com (mx-aoc.americredit.com
	[65.192.236.141])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7HJGVdB007048
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 17 Aug 2011 21:16:33 +0200
Received: from SRVEMAILARL01.acf.americredit.com (10.192.6.180) by
	SRVMEDGARL01.acf.americredit.com (172.17.1.40) with Microsoft SMTP
	Server (TLS) id 8.2.254.0; Wed, 17 Aug 2011 14:16:31 -0500
Received: from SRVEMAILARL01.acf.americredit.com ([10.192.6.180]) by
	SRVEMAILARL01.acf.americredit.com ([10.192.6.180]) with mapi;
	Wed, 17 Aug 2011 14:16:30 -0500
From: <Lamar.Saxon@americredit.com>
To: <libssh2-devel@cool.haxx.se>
Date: Wed, 17 Aug 2011 14:16:28 -0500
Subject: LIBSSH2 & AIX 
Thread-Topic: LIBSSH2 & AIX 
Thread-Index: AcxdESKFXFhrbGvmSp2XM/HnoUzoLQ==
Message-ID: <384393576162D94E9567196A09F13FA31C36D3828B@SRVEMAILARL01.acf.americredit.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 17 Aug 2011 21:17:01 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 17 Aug 2011 21:16:33 +0200 (CEST)
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id
	p7HJGVdB007048
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

I know this is a long shot given the OS in question; but I was hoping someone might be able to help me with LIBSSH2 and AIX.  I can configure and make 1.2.7 on AIX 6.1 with no issues.  Attached is the output of my configure and a make results in successful completion:

configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating tests/Makefile
config.status: creating example/Makefile
config.status: creating docs/Makefile
config.status: creating libssh2.pc
config.status: creating src/libssh2_config.h
config.status: creating example/libssh2_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure: summary of build options:

  version:          1.2.7
  Host type:        powerpc-ibm-aix6.1.0.0
  Install prefix:   /opt/pware
  Compiler:         gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtl
  Compiler flags:   -g -O2
  Library types:    Shared=yes, Static=no
  Crypto library:   openssl: yes (AES-CTR: no) libgcrypt: no
  Debug build:      no
  Path to sshd:      (only for self-tests)
  libz compression: yes

<snip>
make[2]: Leaving directory `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7/example'
make[1]: Leaving directory `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7/example'
Making all in tests
make[1]: Entering directory `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7/tests'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7/tests'
Making all in docs
make[1]: Entering directory `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7/docs'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7/docs'
make[1]: Entering directory `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7'
root@aoctoolbox:/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7:>

Same config on 1.2.8 fails and I don't have any ideas on what might be the problem.

configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating tests/Makefile
config.status: creating example/Makefile
config.status: creating docs/Makefile
config.status: creating libssh2.pc
config.status: creating src/libssh2_config.h
config.status: creating example/libssh2_config.h
config.status: executing depfiles commands
config.status: executing libtool commands
configure: summary of build options:

  version:          -
  Host type:        powerpc-ibm-aix6.1.0.0
  Install prefix:   /opt/pware
  Compiler:         gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtl
  Compiler flags:   -g -O2
  Library types:    Shared=yes, Static=no
  Crypto library:   openssl: yes (AES-CTR: no) libgcrypt: no
  Debug build:      no
  Path to sshd:      (only for self-tests)
  libz compression: yes

<snip>

/bin/sh ../libtool --tag=CC --mode=link gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtl  -g -O2  -L/opt/pware/lib -o sftpdir  sftpdir.o ../src/libssh2.la
libtool: link: gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib -Wl,-brtl -g -O2 -o .libs/sftpdir sftpdir.o  -L/opt/pware/lib -L../src/.libs -lssh2 -Wl,-blibpath:/opt/pware/lib:/opt/pware/lib:/usr/lib:/lib
if gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtl -DHAVE_CONFIG_H   -I../include -I../example -I/opt/pware/include  -g -O2 -MT sftpdir_nonblock.o -MD -MP -MF ".deps/sftpdir_nonblock.Tpo" -c -o sftpdir_nonblock.o sftpdir_nonblock.c; \
then mv -f ".deps/sftpdir_nonblock.Tpo" ".deps/sftpdir_nonblock.Po"; else rm -f ".deps/sftpdir_nonblock.Tpo"; exit 1; fi
gcc: -blibpath:/opt/pware/lib:/usr/lib:/lib: linker input file unused because linking not done
gcc: -brtl: linker input file unused because linking not done
/bin/sh ../libtool --tag=CC --mode=link gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtl  -g -O2  -L/opt/pware/lib -o sftpdir_nonblock  sftpdir_nonblock.o ../src/libssh2.la
libtool: link: gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib -Wl,-brtl -g -O2 -o .libs/sftpdir_nonblock sftpdir_nonblock.o  -L/opt/pware/lib -L../src/.libs -lssh2 -Wl,-blibpath:/opt/pware/lib:/opt/pware/lib:/usr/lib:/lib
if gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtl -DHAVE_CONFIG_H   -I../include -I../example -I/opt/pware/include  -g -O2 -MT ssh2_exec.o -MD -MP -MF ".deps/ssh2_exec.Tpo" -c -o ssh2_exec.o ssh2_exec.c; \
then mv -f ".deps/ssh2_exec.Tpo" ".deps/ssh2_exec.Po"; else rm -f ".deps/ssh2_exec.Tpo"; exit 1; fi
gcc: -blibpath:/opt/pware/lib:/usr/lib:/lib: linker input file unused because linking not done
gcc: -brtl: linker input file unused because linking not done
/bin/sh ../libtool --tag=CC --mode=link gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtl  -g -O2  -L/opt/pware/lib -o ssh2_exec  ssh2_exec.o ../src/libssh2.la
libtool: link: gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib -Wl,-brtl -g -O2 -o .libs/ssh2_exec ssh2_exec.o  -L/opt/pware/lib -L../src/.libs -lssh2 -Wl,-blibpath:/opt/pware/lib:/opt/pware/lib:/usr/lib:/lib
ld: 0711-317 ERROR: Undefined symbol: .libssh2_channel_get_exit_signal
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status
make[2]: *** [ssh2_exec] Error 1
make[2]: Leaving directory `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.8/example'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.8/example'
make: *** [all-recursive] Error 1

Anybody have any suggestions or possible solutions ?  It would be greatly appreciated !

Lamar

Privileged and Confidential.  This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information.  If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail.  You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.

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

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 17 21:34:33 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7HJYPAh013042;
	Wed, 17 Aug 2011 21:34:32 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7HJYOo4013037
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 17 Aug 2011 21:34:24 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7HJYRDc018002
	for <libssh2-devel@cool.haxx.se>; Wed, 17 Aug 2011 19:34:29 GMT
Received: from henrik ([127.0.0.1]) (authenticated bits=0)
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7HJYQqJ025573
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 17 Aug 2011 21:34:26 +0200
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: LIBSSH2 & AIX
X-Mailer: Modest 3.2
References: <384393576162D94E9567196A09F13FA31C36D3828B@SRVEMAILARL01.acf.americredit.com>
In-Reply-To: <384393576162D94E9567196A09F13FA31C36D3828B@SRVEMAILARL01.acf.americredit.com>
Content-ID: <1313609663.2652.2.camel@Nokia-N900>
Date: Wed, 17 Aug 2011 21:34:24 +0200
Message-Id: <1313609664.2652.3.camel@Nokia-N900>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 17 Aug 2011 21:34:33 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Wed, 17 Aug 2011 21:34:24 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Wed, 17 Aug 2011 19:34:29 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>,
        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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p7HJYPAh013042

That's odd indeed. libssh2_channel_get_exit_signal is a public API function defined in channel.c and part of the libssh2 library (-lssh2).

Do you get the same error if you

  cd example
  make ssh_echo

Regards
Henrik 

----- Ursprungsmeddelande -----
> I know this is a long shot given the OS in question; but I was hoping
> someone might be able to help me with LIBSSH2 and AIX.Â   I can configure
> and make 1.2.7 on AIX 6.1 with no issues.Â   Attached is the output of my
> configure and a make results in successful completion:
> 
> configure: creating ./config.status
> config.status: creating Makefile
> config.status: creating src/Makefile
> config.status: creating tests/Makefile
> config.status: creating example/Makefile
> config.status: creating docs/Makefile
> config.status: creating libssh2.pc
> config.status: creating src/libssh2_config.h
> config.status: creating example/libssh2_config.h
> config.status: executing depfiles commands
> config.status: executing libtool commands
> configure: summary of build options:
> 
>Â  Â   version:Â  Â  Â  Â  Â  Â  Â  Â  Â   1.2.7
>Â  Â   Host type:Â  Â  Â  Â  Â  Â  Â   powerpc-ibm-aix6.1.0.0
>Â  Â   Install prefix:Â  Â   /opt/pware
>Â  Â   Compiler:Â  Â  Â  Â  Â  Â  Â  Â   gcc -O2
> -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtlÂ   Compiler flags:Â  Â   -g
> -O2Â   Library types:Â  Â  Â   Shared=yes, Static=no
>Â  Â   Crypto library:Â  Â   openssl: yes (AES-CTR: no) libgcrypt: no
>Â  Â   Debug build:Â  Â  Â  Â  Â   no
>Â  Â   Path to sshd:Â  Â  Â  Â  Â   (only for self-tests)
>Â  Â   libz compression: yes
> 
> <snip>
> make[2]: Leaving directory
> `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7/example' make[1]: Leaving
> directory `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7/example' Making
> all in tests make[1]: Entering directory
> `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7/tests' make[1]: Nothing to
> be done for `all'. make[1]: Leaving directory
> `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7/tests' Making all in docs
> make[1]: Entering directory
> `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7/docs' make[1]: Nothing to be
> done for `all'. make[1]: Leaving directory
> `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7/docs' make[1]: Entering
> directory `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7' make[1]: Nothing
> to be done for `all-am'. make[1]: Leaving directory
> `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7'
> root@aoctoolbox:/usr/sys/inst.images/LIBSSH2/libssh2-1.2.7:>
> 
> Same config on 1.2.8 fails and I don't have any ideas on what might be
> the problem.
> 
> configure: creating ./config.status
> config.status: creating Makefile
> config.status: creating src/Makefile
> config.status: creating tests/Makefile
> config.status: creating example/Makefile
> config.status: creating docs/Makefile
> config.status: creating libssh2.pc
> config.status: creating src/libssh2_config.h
> config.status: creating example/libssh2_config.h
> config.status: executing depfiles commands
> config.status: executing libtool commands
> configure: summary of build options:
> 
>Â  Â   version:Â  Â  Â  Â  Â  Â  Â  Â  Â   -
>Â  Â   Host type:Â  Â  Â  Â  Â  Â  Â   powerpc-ibm-aix6.1.0.0
>Â  Â   Install prefix:Â  Â   /opt/pware
>Â  Â   Compiler:Â  Â  Â  Â  Â  Â  Â  Â   gcc -O2
> -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtlÂ   Compiler flags:Â  Â   -g
> -O2Â   Library types:Â  Â  Â   Shared=yes, Static=no
>Â  Â   Crypto library:Â  Â   openssl: yes (AES-CTR: no) libgcrypt: no
>Â  Â   Debug build:Â  Â  Â  Â  Â   no
>Â  Â   Path to sshd:Â  Â  Â  Â  Â   (only for self-tests)
>Â  Â   libz compression: yes
> 
> <snip>
> 
> /bin/sh ../libtool --tag=CC --mode=link gcc -O2
> -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtlÂ   -g -O2 
> -L/opt/pware/lib -o sftpdirÂ   sftpdir.o ../src/libssh2.la libtool: link:
> gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib -Wl,-brtl -g -O2 -o
> .libs/sftpdir sftpdir.oÂ   -L/opt/pware/lib -L../src/.libs -lssh2
> -Wl,-blibpath:/opt/pware/lib:/opt/pware/lib:/usr/lib:/lib if gcc -O2
> -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtl -DHAVE_CONFIG_HÂ   
> -I../include -I../example -I/opt/pware/includeÂ   -g -O2 -MT
> sftpdir_nonblock.o -MD -MP -MF ".deps/sftpdir_nonblock.Tpo" -c -o
> sftpdir_nonblock.o sftpdir_nonblock.c; \ then mv -f
> ".deps/sftpdir_nonblock.Tpo" ".deps/sftpdir_nonblock.Po"; else rm -f
> ".deps/sftpdir_nonblock.Tpo"; exit 1; fi gcc:
> -blibpath:/opt/pware/lib:/usr/lib:/lib: linker input file unused because
> linking not done gcc: -brtl: linker input file unused because linking
> not done /bin/sh ../libtool --tag=CC --mode=link gcc -O2
> -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtlÂ   -g -O2 
> -L/opt/pware/lib -o sftpdir_nonblockÂ   sftpdir_nonblock.o
> ../src/libssh2.la libtool: link: gcc -O2
> -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib -Wl,-brtl -g -O2 -o
> .libs/sftpdir_nonblock sftpdir_nonblock.oÂ   -L/opt/pware/lib
> -L../src/.libs -lssh2
> -Wl,-blibpath:/opt/pware/lib:/opt/pware/lib:/usr/lib:/lib if gcc -O2
> -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtl -DHAVE_CONFIG_HÂ   
> -I../include -I../example -I/opt/pware/includeÂ   -g -O2 -MT ssh2_exec.o
> -MD -MP -MF ".deps/ssh2_exec.Tpo" -c -o ssh2_exec.o ssh2_exec.c; \ then
> mv -f ".deps/ssh2_exec.Tpo" ".deps/ssh2_exec.Po"; else rm -f
> ".deps/ssh2_exec.Tpo"; exit 1; fi gcc:
> -blibpath:/opt/pware/lib:/usr/lib:/lib: linker input file unused because
> linking not done gcc: -brtl: linker input file unused because linking
> not done /bin/sh ../libtool --tag=CC --mode=link gcc -O2
> -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtlÂ   -g -O2 
> -L/opt/pware/lib -o ssh2_execÂ   ssh2_exec.o ../src/libssh2.la libtool:
> link: gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib -Wl,-brtl -g
> -O2 -o .libs/ssh2_exec ssh2_exec.oÂ   -L/opt/pware/lib -L../src/.libs
> -lssh2 -Wl,-blibpath:/opt/pware/lib:/opt/pware/lib:/usr/lib:/lib ld:
> 0711-317 ERROR: Undefined symbol: .libssh2_channel_get_exit_signal ld:
> 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
> information. collect2: ld returned 8 exit status make[2]: ***
> [ssh2_exec] Error 1 make[2]: Leaving directory
> `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.8/example' make[1]: *** [all]
> Error 2 make[1]: Leaving directory
> `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.8/example' make: ***
> [all-recursive] Error 1
> 
> Anybody have any suggestions or possible solutions ?Â   It would be
> greatly appreciated !
> 
> Lamar
> 
> Privileged and Confidential.Â   This e-mail, and any attachments there to,
> is intended only for use by the addressee(s) named herein and may
> contain privileged or confidential information.Â   If you have received
> this e-mail in error, please notify me immediately by a return e-mail
> and delete this e-mail.Â   You are hereby notified that any dissemination,
> distribution or copying of this e-mail and/or any attachments thereto,
> is strictly prohibited.
> 
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

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

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 17 23:00:06 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7HKxoWH017524;
	Wed, 17 Aug 2011 23:00:04 +0200
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 p7HKxmtS017515
	for <libssh2-devel@cool.haxx.se>; Wed, 17 Aug 2011 22:59:48 +0200
Date: Wed, 17 Aug 2011 22:59:48 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: LIBSSH2 & AIX 
In-Reply-To: <384393576162D94E9567196A09F13FA31C36D3828B@SRVEMAILARL01.acf.americredit.com>
Message-ID: <alpine.DEB.2.00.1108172254040.8167@tvnag.unkk.fr>
References: <384393576162D94E9567196A09F13FA31C36D3828B@SRVEMAILARL01.acf.americredit.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 17 Aug 2011 23:00:06 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 17 Aug 2011 22:59:48 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Wed, 17 Aug 2011, Lamar.Saxon@americredit.com wrote:

> I know this is a long shot given the OS in question; but I was hoping 
> someone might be able to help me with LIBSSH2 and AIX.  I can configure and 
> make 1.2.7 on AIX 6.1 with no issues.  Attached is the output of my 
> configure and a make results in successful completion:

I'd just like to add that we do want to be compatible with and work on AIX as 
well. We just might have less users on that platform so sometimes problems 
don't get noticed as fast as on the more widely used targets.

> Same config on 1.2.8 fails and I don't have any ideas on what might be the 
> problem.

Just note that we just released 1.2.9. It might just as well show the same 
problem though, I don't know...

> -lssh2 -Wl,-blibpath:/opt/pware/lib:/opt/pware/lib:/usr/lib:/lib if gcc -O2 
> -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtl -DHAVE_CONFIG_H 
> -I../include -I../example -I/opt/pware/include -g -O2 -MT ssh2_exec.o -MD 
> -MP -MF ".deps/ssh2_exec.Tpo" -c -o ssh2_exec.o ssh2_exec.c; \ then mv -f 
> ".deps/ssh2_exec.Tpo" ".deps/ssh2_exec.Po"; else rm -f 
> ".deps/ssh2_exec.Tpo"; exit 1; fi gcc: 
> -blibpath:/opt/pware/lib:/usr/lib:/lib: linker input file unused because 
> linking not done gcc: -brtl: linker input file unused because linking not

As this build failure is for the ssh2_exec program, which is but an example, 
the libssh2 library has already been built. You should be able to ignore this 
problem, even if we of course would like to get it fixed so that you won't 
have to bother about it...

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 18 18:39:19 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7IGcx29027108;
	Thu, 18 Aug 2011 18:39:16 +0200
Received: from SRVMEDGARL01.acf.americredit.com (mx-aoc.americredit.com
	[65.192.236.141])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7IGcuq3027064
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 18 Aug 2011 18:38:57 +0200
Received: from SRVMEXHTARL01.acf.americredit.com (10.192.7.80) by
	SRVMEDGARL01.acf.americredit.com (172.17.1.40) with Microsoft SMTP
	Server (TLS) id 8.2.254.0; Thu, 18 Aug 2011 11:38:54 -0500
Received: from SRVEMAILARL01.acf.americredit.com ([10.192.6.180]) by
	SRVMEXHTARL01.acf.americredit.com ([10.192.7.80]) with mapi;
	Thu, 18 Aug 2011 11:38:54 -0500
From: <Lamar.Saxon@americredit.com>
To: <libssh2-devel@cool.haxx.se>
Date: Thu, 18 Aug 2011 11:38:52 -0500
Subject: LIBSSH2 & AIX  
Thread-Topic: LIBSSH2 & AIX  
Thread-Index: AcxdxRB9pdjZ57GAQWePHH+zSeyEVw==
Message-ID: <384393576162D94E9567196A09F13FA31C3C64821E@SRVEMAILARL01.acf.americredit.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 18 Aug 2011 18:39:19 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 18 Aug 2011 18:38:58 +0200 (CEST)
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id
	p7IGcuq3027064
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

Henrik,
        I receive the same error:

root@aoctoolbox:/usr/sys/inst.images/LIBSSH2/libssh2-1.2.8:> cd example

root@aoctoolbox:/usr/sys/inst.images/LIBSSH2/libssh2-1.2.8/example:> make ssh2_echo
        /bin/sh ../libtool --tag=CC --mode=link gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtl  -g -O2
L/opt/pware/lib -o ssh2_echo  ssh2_echo.o ../src/libssh2.la
libtool: link: gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib -Wl,-brtl -g -O2 -o .libs/ssh2_echo ssh2_echo.o
L/opt/pware/lib -L../src/.libs -lssh2 -Wl,-blibpath:/opt/pware/lib:/opt/pware/lib:/usr/lib:/lib
ld: 0711-317 ERROR: Undefined symbol: .libssh2_channel_get_exit_signal
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status
make: The error code from the last command is 1.


Stop.

Lamar

--- In response to: ---
Date: Wed, 17 Aug 2011 21:34:24 +0200
From: Henrik Nordstr?m <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: LIBSSH2 & AIX
Message-ID: <1313609664.2652.3.camel@Nokia-N900>
Content-Type: text/plain; charset=utf-8

That's odd indeed. libssh2_channel_get_exit_signal is a public API function defined in channel.c and part of the libssh2 library (-lssh2).

Do you get the same error if you

  cd example
  make ssh_echo

Regards
Henrik



Privileged and Confidential.  This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information.  If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail.  You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.

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

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 18 18:40:51 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7IGenrk029142;
	Thu, 18 Aug 2011 18:40:51 +0200
Received: from SRVMEDGARL01.acf.americredit.com (mx-aoc.americredit.com
	[65.192.236.141])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7IGelcI028968
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 18 Aug 2011 18:40:48 +0200
Received: from SRVMEXHTARL01.acf.americredit.com (10.192.7.80) by
	SRVMEDGARL01.acf.americredit.com (172.17.1.40) with Microsoft SMTP
	Server (TLS) id 8.2.254.0; Thu, 18 Aug 2011 11:40:46 -0500
Received: from SRVEMAILARL01.acf.americredit.com ([10.192.6.180]) by
	SRVMEXHTARL01.acf.americredit.com ([10.192.7.80]) with mapi;
	Thu, 18 Aug 2011 11:40:46 -0500
From: <Lamar.Saxon@americredit.com>
To: <libssh2-devel@cool.haxx.se>
Date: Thu, 18 Aug 2011 11:40:44 -0500
Subject: LIBSSH2 & AIX
Thread-Topic: LIBSSH2 & AIX
Thread-Index: AcxdxVn9X3EXW4xwSgKX/+8V81AAnQ==
Message-ID: <384393576162D94E9567196A09F13FA31C3C64821F@SRVEMAILARL01.acf.americredit.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 18 Aug 2011 18:40:51 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 18 Aug 2011 18:40:49 +0200 (CEST)
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id
	p7IGelcI028968
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

Thanks for the response and support.  Not too often you hear that when dealing with other packages.  Being both a AIX and RHEL admin it is really appreciated !

I will download 1.2.9 and test today.

Lamar


--- In response to: ---

Date: Wed, 17 Aug 2011 22:59:48 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: LIBSSH2 & AIX
Message-ID: <alpine.DEB.2.00.1108172254040.8167@tvnag.unkk.fr>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Wed, 17 Aug 2011, Lamar.Saxon@americredit.com wrote:

> I know this is a long shot given the OS in question; but I was hoping
> someone might be able to help me with LIBSSH2 and AIX.  I can
> configure and make 1.2.7 on AIX 6.1 with no issues.  Attached is the
> output of my configure and a make results in successful completion:

I'd just like to add that we do want to be compatible with and work on AIX as well. We just might have less users on that platform so sometimes problems don't get noticed as fast as on the more widely used targets.

> Same config on 1.2.8 fails and I don't have any ideas on what might be
> the problem.

Just note that we just released 1.2.9. It might just as well show the same problem though, I don't know...

> -lssh2 -Wl,-blibpath:/opt/pware/lib:/opt/pware/lib:/usr/lib:/lib if
> gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtl
> -DHAVE_CONFIG_H -I../include -I../example -I/opt/pware/include -g -O2
> -MT ssh2_exec.o -MD -MP -MF ".deps/ssh2_exec.Tpo" -c -o ssh2_exec.o
> ssh2_exec.c; \ then mv -f ".deps/ssh2_exec.Tpo" ".deps/ssh2_exec.Po";
> else rm -f ".deps/ssh2_exec.Tpo"; exit 1; fi gcc:
> -blibpath:/opt/pware/lib:/usr/lib:/lib: linker input file unused
> because linking not done gcc: -brtl: linker input file unused because
> linking not

As this build failure is for the ssh2_exec program, which is but an example, the libssh2 library has already been built. You should be able to ignore this problem, even if we of course would like to get it fixed so that you won't have to bother about it...

--

  / daniel.haxx.se


------------------------------

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


End of libssh2-devel Digest, Vol 27, Issue 14
*********************************************


Privileged and Confidential.  This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information.  If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail.  You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.

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

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 18 20:47:28 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7IIl9VA007638;
	Thu, 18 Aug 2011 20:47:25 +0200
Received: from SRVMEDGARL01.acf.americredit.com (mx-aoc.americredit.com
	[65.192.236.141])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7IIl6X2007541
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 18 Aug 2011 20:47:07 +0200
Received: from SRVMEXHTARL01.acf.americredit.com (10.192.7.80) by
	SRVMEDGARL01.acf.americredit.com (172.17.1.40) with Microsoft SMTP
	Server (TLS) id 8.2.254.0; Thu, 18 Aug 2011 13:47:04 -0500
Received: from SRVEMAILARL01.acf.americredit.com ([10.192.6.180]) by
	SRVMEXHTARL01.acf.americredit.com ([10.192.7.80]) with mapi;
	Thu, 18 Aug 2011 13:47:03 -0500
From: <Lamar.Saxon@americredit.com>
To: <libssh2-devel@cool.haxx.se>
Date: Thu, 18 Aug 2011 13:47:02 -0500
Subject: RE: LIBSSH2 & AIX
Thread-Topic: LIBSSH2 & AIX
Thread-Index: AcxdxVn9X3EXW4xwSgKX/+8V81AAnQAEc5fw
Message-ID: <384393576162D94E9567196A09F13FA31C3C64826E@SRVEMAILARL01.acf.americredit.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 18 Aug 2011 20:47:28 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 18 Aug 2011 20:47:07 +0200 (CEST)
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id
	p7IIl6X2007541
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

1.2.9 exhibits the same problem:

/bin/sh ../libtool --tag=CC --mode=link gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtl  -g -O2  -L/opt/pwa
re/lib -o sftpdir_nonblock  sftpdir_nonblock.o ../src/libssh2.la
libtool: link: gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib -Wl,-brtl -g -O2 -o .libs/sftpdir_nonblock sftpdir
_nonblock.o  -L/opt/pware/lib -L../src/.libs -lssh2 -Wl,-blibpath:/opt/pware/lib:/opt/pware/lib:/usr/lib:/lib
if gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtl -DHAVE_CONFIG_H   -I../include -I../example -I/opt/pware
/include  -g -O2 -MT ssh2_exec.o -MD -MP -MF ".deps/ssh2_exec.Tpo" -c -o ssh2_exec.o ssh2_exec.c; \
then mv -f ".deps/ssh2_exec.Tpo" ".deps/ssh2_exec.Po"; else rm -f ".deps/ssh2_exec.Tpo"; exit 1; fi
gcc: -blibpath:/opt/pware/lib:/usr/lib:/lib: linker input file unused because linking not done
gcc: -brtl: linker input file unused because linking not done
/bin/sh ../libtool --tag=CC --mode=link gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtl  -g -O2  -L/opt/pwa
re/lib -o ssh2_exec  ssh2_exec.o ../src/libssh2.la
libtool: link: gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib -Wl,-brtl -g -O2 -o .libs/ssh2_exec ssh2_exec.o  -
L/opt/pware/lib -L../src/.libs -lssh2 -Wl,-blibpath:/opt/pware/lib:/opt/pware/lib:/usr/lib:/lib
ld: 0711-317 ERROR: Undefined symbol: .libssh2_channel_get_exit_signal
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: ld returned 8 exit status
make[2]: *** [ssh2_exec] Error 1
make[2]: Leaving directory `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.9/example'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/sys/inst.images/LIBSSH2/libssh2-1.2.9/example'
make: *** [all-recursive] Error 1

Thanks,
Lamar

-----Original Message-----
From: Saxon, Lamar
Sent: Thursday, August 18, 2011 11:41 AM
To: libssh2-devel@cool.haxx.se
Subject: LIBSSH2 & AIX

Thanks for the response and support.  Not too often you hear that when dealing with other packages.  Being both a AIX and RHEL admin it is really appreciated !

I will download 1.2.9 and test today.

Lamar


--- In response to: ---

Date: Wed, 17 Aug 2011 22:59:48 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: LIBSSH2 & AIX
Message-ID: <alpine.DEB.2.00.1108172254040.8167@tvnag.unkk.fr>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Wed, 17 Aug 2011, Lamar.Saxon@americredit.com wrote:

> I know this is a long shot given the OS in question; but I was hoping
> someone might be able to help me with LIBSSH2 and AIX.  I can
> configure and make 1.2.7 on AIX 6.1 with no issues.  Attached is the
> output of my configure and a make results in successful completion:

I'd just like to add that we do want to be compatible with and work on AIX as well. We just might have less users on that platform so sometimes problems don't get noticed as fast as on the more widely used targets.

> Same config on 1.2.8 fails and I don't have any ideas on what might be
> the problem.

Just note that we just released 1.2.9. It might just as well show the same problem though, I don't know...

> -lssh2 -Wl,-blibpath:/opt/pware/lib:/opt/pware/lib:/usr/lib:/lib if
> gcc -O2 -Wl,-blibpath:/opt/pware/lib:/usr/lib:/lib,-brtl
> -DHAVE_CONFIG_H -I../include -I../example -I/opt/pware/include -g -O2
> -MT ssh2_exec.o -MD -MP -MF ".deps/ssh2_exec.Tpo" -c -o ssh2_exec.o
> ssh2_exec.c; \ then mv -f ".deps/ssh2_exec.Tpo" ".deps/ssh2_exec.Po";
> else rm -f ".deps/ssh2_exec.Tpo"; exit 1; fi gcc:
> -blibpath:/opt/pware/lib:/usr/lib:/lib: linker input file unused
> because linking not done gcc: -brtl: linker input file unused because
> linking not

As this build failure is for the ssh2_exec program, which is but an example, the libssh2 library has already been built. You should be able to ignore this problem, even if we of course would like to get it fixed so that you won't have to bother about it...

--

  / daniel.haxx.se


------------------------------

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


End of libssh2-devel Digest, Vol 27, Issue 14
*********************************************


Privileged and Confidential.  This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information.  If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail.  You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.

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

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 18 22:05:11 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7IK4mtH021353;
	Thu, 18 Aug 2011 22:05:07 +0200
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 p7IK4kqu021300
	for <libssh2-devel@cool.haxx.se>; Thu, 18 Aug 2011 22:04:46 +0200
Date: Thu, 18 Aug 2011 22:04:46 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: RE: LIBSSH2 & AIX
In-Reply-To: <384393576162D94E9567196A09F13FA31C3C64826E@SRVEMAILARL01.acf.americredit.com>
Message-ID: <alpine.DEB.2.00.1108182201340.1644@tvnag.unkk.fr>
References: <384393576162D94E9567196A09F13FA31C3C64826E@SRVEMAILARL01.acf.americredit.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 18 Aug 2011 22:05:11 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 18 Aug 2011 22:04:46 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Thu, 18 Aug 2011, Lamar.Saxon@americredit.com wrote:

> 1.2.9 exhibits the same problem:

Right, as I suspected.

> ld: 0711-317 ERROR: Undefined symbol: .libssh2_channel_get_exit_signal

I'm puzzled by the error. Why does it lack that single symbol?

Can you run nm on the libssh2.a file (possibly present in src/.libs after 
you've built it) and see? Run something like:

  $ nm libssh2.a  | grep libssh2_channel_get_exit_signal

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 19 05:28:29 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7J3S451018878;
	Fri, 19 Aug 2011 05:28:24 +0200
Received: from SRVMEDGARL01.acf.americredit.com (mx-aoc.americredit.com
	[65.192.236.141])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7J3S2g7018797
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 19 Aug 2011 05:28:03 +0200
Received: from SRVEMAILARL01.acf.americredit.com (10.192.6.180) by
	SRVMEDGARL01.acf.americredit.com (172.17.1.40) with Microsoft SMTP
	Server (TLS) id 8.2.254.0; Thu, 18 Aug 2011 22:27:56 -0500
Received: from SRVEMAILARL01.acf.americredit.com ([10.192.6.180]) by
	SRVEMAILARL01.acf.americredit.com ([10.192.6.180]) with mapi;
	Thu, 18 Aug 2011 22:27:55 -0500
From: <Lamar.Saxon@americredit.com>
To: <libssh2-devel@cool.haxx.se>
Date: Thu, 18 Aug 2011 22:27:54 -0500
Subject: RE: LIBSSH2 & AIX
Thread-Topic: LIBSSH2 & AIX
Thread-Index: AcxdxVn9X3EXW4xwSgKX/+8V81AAnQAEc5fwABIMhuA=
Message-ID: <384393576162D94E9567196A09F13FA31C3C648315@SRVEMAILARL01.acf.americredit.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 19 Aug 2011 05:28:29 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 19 Aug 2011 05:28:03 +0200 (CEST)
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id
	p7J3S2g7018797
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

Daniel,
        Directory listing and the output of nm...
Thanks !

root@aoctoolbox:/usr/sys/inst.images/LIBSSH2/libssh2-1.2.9/src/.libs:> ls -l
total 9336
-rw-r-----    1 root     system        94507 Aug 18 13:45 agent.o
-rw-r-----    1 root     system       159182 Aug 18 13:45 channel.o
-rw-r-----    1 root     system        87641 Aug 18 13:45 comp.o
-rw-r-----    1 root     system        82742 Aug 18 13:45 crypt.o
-rw-r-----    1 root     system        77936 Aug 18 13:45 global.o
-rw-r-----    1 root     system        88626 Aug 18 13:45 hostkey.o
-rw-r-----    1 root     system        77972 Aug 18 13:45 keepalive.o
-rw-r-----    1 root     system       142315 Aug 18 13:45 kex.o
-rw-r-----    1 root     system       103860 Aug 18 13:45 knownhost.o
-rw-r-----    1 root     system        75780 Aug 18 13:45 libgcrypt.o
-rw-r-----    1 root     system      1214824 Aug 18 13:46 libssh2.a
-rw-r-----    1 root     system         2987 Aug 18 13:46 libssh2.exp
lrwxrwxrwx    1 root     system           13 Aug 18 13:46 libssh2.la -> ../libssh2.la
-rw-r-----    1 root     system          942 Aug 18 13:46 libssh2.lai
-rwxr-x---    1 root     system      1199449 Aug 18 13:46 libssh2.so.1
-rw-r-----    1 root     system        84079 Aug 18 13:45 mac.o
-rw-r-----    1 root     system        88996 Aug 18 13:45 misc.o
-rw-r-----    1 root     system       106872 Aug 18 13:45 openssl.o
-rw-r-----    1 root     system       109761 Aug 18 13:45 packet.o
-rw-r-----    1 root     system        75761 Aug 18 13:45 pem.o
-rw-r-----    1 root     system       104878 Aug 18 13:45 publickey.o
-rw-r-----    1 root     system       101352 Aug 18 13:45 scp.o
-rw-r-----    1 root     system       119320 Aug 18 13:45 session.o
-rw-r-----    1 root     system       224401 Aug 18 13:45 sftp.o
-rw-r-----    1 root     system        88119 Aug 18 13:45 transport.o
-rw-r-----    1 root     system       134807 Aug 18 13:45 userauth.o
-rw-r-----    1 root     system        76374 Aug 18 13:45 version.o

root@aoctoolbox:/usr/sys/inst.images/LIBSSH2/libssh2-1.2.9/src/.libs:> nm libssh2.a | grep libssh2_channel_get_exit_signal

.libssh2_channel_get_exit_signal T   268459244         448
libssh2_channel_get_exit_signal D   536875460
libssh2_channel_get_exit_signal d   536875460          12
libssh2_channel_get_exit_signal:F-1 -        9088




From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 18 Aug 2011 22:04:46 +0200 (CEST)


On Thu, 18 Aug 2011, Lamar.Saxon_at_americredit.com wrote:


> 1.2.9 exhibits the same problem:


Right, as I suspected.


> ld: 0711-317 ERROR: Undefined symbol: .libssh2_channel_get_exit_signal


I'm puzzled by the error. Why does it lack that single symbol?


Can you run nm on the libssh2.a file (possibly present in src/.libs after
you've built it) and see? Run something like:


  $ nm libssh2.a | grep libssh2_channel_get_exit_signal


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

Privileged and Confidential.  This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information.  If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail.  You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.

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

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 19 08:51:15 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7J6opXN021730;
	Fri, 19 Aug 2011 08:51:11 +0200
Received: from ponderosa.fch.wimsey.bc.ca (zz201111.cipherkey.net
	[209.53.201.111])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7J6onPc021704
	for <libssh2-devel@cool.haxx.se>; Fri, 19 Aug 2011 08:50:49 +0200
Received: by coneharvesters.com
	via sendmail with stdio id <m1QuIuf-000l6IC@ponderosa.fch.wimsey.bc.ca>
	for libssh2-devel@cool.haxx.se; Thu, 18 Aug 2011 23:50:41 -0700 (PDT)
Date: Thu, 18 Aug 2011 23:50:40 -0700
From: Dan Fandrich <dan@coneharvesters.com>
To: libssh2-devel@cool.haxx.se
Subject: Re: LIBSSH2 & AIX
Message-ID: <20110819065039.GA21496@coneharvesters.com>
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <384393576162D94E9567196A09F13FA31C3C648315@SRVEMAILARL01.acf.americredit.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <384393576162D94E9567196A09F13FA31C3C648315@SRVEMAILARL01.acf.americredit.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 19 Aug 2011 08:51:15 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 19 Aug 2011 08:50:50 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Thu, Aug 18, 2011 at 10:27:54PM -0500, Lamar.Saxon@americredit.com wrote:
> root@aoctoolbox:/usr/sys/inst.images/LIBSSH2/libssh2-1.2.9/src/.libs:> nm libssh2.a | grep libssh2_channel_get_exit_signal
> 
> .libssh2_channel_get_exit_signal T   268459244         448
> libssh2_channel_get_exit_signal D   536875460
> libssh2_channel_get_exit_signal d   536875460          12
> libssh2_channel_get_exit_signal:F-1 -        9088

Could it be that the linker is picking up the wrong version of libssh2.a?
Like an older version installed in some other location?

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

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 19 18:01:57 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7JG1bhL021763;
	Fri, 19 Aug 2011 18:01:53 +0200
Received: from SRVMEDGARL01.acf.americredit.com (mx-aoc.americredit.com
	[65.192.236.141])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7JG1YXq021620
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 19 Aug 2011 18:01:35 +0200
Received: from SRVMEXHTARL01.acf.americredit.com (10.192.7.80) by
	SRVMEDGARL01.acf.americredit.com (172.17.1.40) with Microsoft SMTP
	Server (TLS) id 8.2.254.0; Fri, 19 Aug 2011 11:01:31 -0500
Received: from SRVEMAILARL01.acf.americredit.com ([10.192.6.180]) by
	SRVMEXHTARL01.acf.americredit.com ([10.192.7.80]) with mapi;
	Fri, 19 Aug 2011 11:01:31 -0500
From: <Lamar.Saxon@americredit.com>
To: <libssh2-devel@cool.haxx.se>
Date: Fri, 19 Aug 2011 11:01:29 -0500
Subject: Re: LIBSSH2 & AIX
Thread-Topic: LIBSSH2 & AIX
Thread-Index: AcxeiRFMqSYG+2tnQnifOccyND7Lyg==
Message-ID: <384393576162D94E9567196A09F13FA31C3C6483AF@SRVEMAILARL01.acf.americredit.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 19 Aug 2011 18:01:57 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 19 Aug 2011 18:01:35 +0200 (CEST)
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id
	p7JG1YXq021620
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

You are a genius and sorry I did not think of it earlier.  It was finding the old 1.2.7 version and thus failing.  I removed the old version and the compile completed successfully !

Thanks again for all the help !
Lamar

Date: Thu, 18 Aug 2011 23:50:40 -0700
From: Dan Fandrich <dan@coneharvesters.com>
To: libssh2-devel@cool.haxx.se
Subject: Re: LIBSSH2 & AIX
Message-ID: <20110819065039.GA21496@coneharvesters.com>
Content-Type: text/plain; charset=us-ascii

On Thu, Aug 18, 2011 at 10:27:54PM -0500, Lamar.Saxon@americredit.com wrote:
> root@aoctoolbox:/usr/sys/inst.images/LIBSSH2/libssh2-1.2.9/src/.libs:>
> nm libssh2.a | grep libssh2_channel_get_exit_signal
>
> .libssh2_channel_get_exit_signal T   268459244         448
> libssh2_channel_get_exit_signal D   536875460
> libssh2_channel_get_exit_signal d   536875460          12
> libssh2_channel_get_exit_signal:F-1 -        9088

Could it be that the linker is picking up the wrong version of libssh2.a?
Like an older version installed in some other location?

>>> Dan


------------------------------

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


End of libssh2-devel Digest, Vol 27, Issue 15
*********************************************


Privileged and Confidential.  This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information.  If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail.  You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.

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

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 23 12:09:04 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7NA8drK023119;
	Tue, 23 Aug 2011 12:09:00 +0200
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 p7NA8aP3023109
	for <libssh2-devel@cool.haxx.se>; Tue, 23 Aug 2011 12:08:36 +0200
Received: (qmail 3458 invoked from network); 23 Aug 2011 10:08:36 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 23 Aug 2011 10:08:36 -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, 23 Aug 2011 10:08:36 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #223: errors in multi threads applications
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/223#comment:3
Message-ID: <072.3aff85a655b1dc6dd5013d73ec54b7d8@libssh2.stuge.se>
References: <057.08a849581ce35049044fa3ec853ef047@libssh2.stuge.se>
X-Trac-Ticket-ID: 223
In-Reply-To: <057.08a849581ce35049044fa3ec853ef047@libssh2.stuge.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 23 Aug 2011 12:09:04 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 23 Aug 2011 12:08:37 +0200 (CEST)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p7NA8aP3023109
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p7NA8drK023119

#223: errors in multi threads applications
------------------------------------+---------------------------------------
  Reporter:  mmichele1974@â€¦         |        Owner:                       
      Type:  defect                 |       Status:  new                  
  Priority:  normal                 |    Milestone:  1.2.9                
 Component:  SFTP                   |      Version:  1.2.7                
Resolution:                         |     Keywords:  sftp curl multithread
    Blocks:                         |   Blocked By:                       
------------------------------------+---------------------------------------

Comment (by mmichele1974@â€¦):

 Replying to [comment:2 bagder]:

 Hi,
 Thank you for the quick answers.
 I noticed the bug only in the multi thread environment, but I will make
 some
 stress tests in mono thread case and try to
 reproduce it.

 I registered the callbacks correctly because they are called during the
 test (printf called!).
 I copied the callbacks implementations from the libssh2 example file.


 > Further, it will help if you rebuild your libssh2 completely without -O
 so that you get all symbols properly.
 >
 > Did the mutex callbacks get called at all in the crashing case?
 >
 > Can you try with libssh2 1.2.8 also and see if the bug still remains? It
 would be a bit pointless to hunt for a problem if it is already fixed!

-- 
Ticket URL: <http://trac.libssh2.org/ticket/223#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  Tue Aug 23 17:35:09 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7NFYkor027201;
	Tue, 23 Aug 2011 17:35:05 +0200
Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com
	[209.85.161.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7NFYjeY027179
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 23 Aug 2011 17:34:46 +0200
Received: by fxe4 with SMTP id 4so403594fxe.41
	for <libssh2-devel@cool.haxx.se>; Tue, 23 Aug 2011 08:34:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:from:date:message-id:subject:to:content-type;
	bh=RMWldaPChz2fwQEzXepzalpelowZvGsecPJQlrBA34w=;
	b=GNxTkrD9qMuiK3EKfWl09RNkOYbwSq8yDcTLbTXqAHRgXdrO8xKWt7Ode8XGk4+KV0
	AJQuVlJJRfxcs7jpn/64N1p6vhiIm0Abt+n3qFgqgvdyCrwLnSisDdKA1SxgwCe8h/dl
	8wzgRnRtJaLkBqxMS1rWT8CsGnskV8oG3dKvE=
Received: by 10.223.89.65 with SMTP id d1mr4662946fam.6.1314113684150; Tue, 23
	Aug 2011 08:34:44 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.223.126.13 with HTTP; Tue, 23 Aug 2011 08:34:24 -0700 (PDT)
From: Ralph <rgootee@gmail.com>
Date: Tue, 23 Aug 2011 11:34:24 -0400
Message-ID: <CAPZcGE2HVmto8Yo6n9N1hpZLvJDyT5=s5QMpk_Q_3ZUNT+iC_g@mail.gmail.com>
Subject: Reverse port forward using libssh2
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 23 Aug 2011 17:35:09 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 23 Aug 2011 17:34:46 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

Hi folks,

I'm trying to do a reverse port forward on iOS using libssh2. Here's
the bulk of my code:

(do you guys like pastebin? I feel blad flooding the email)

http://pastebin.com/N1yshfqs

The connection is done previously, and completes correctly (as far the
return code suggests).

The listener fails:

   listener = libssh2_channel_forward_listen_ex(session,
                                                 lhost,
                                                 _lport,
                                                 &_rport,
                                                 queue_maxsize);

where lhost is 127.0.0.1, _lport is 8080, rport is some high port and
queue_maxsize=1.

The error was: "Unable to complete request for forward-listen".
Googling this doesn't give much insight, though it seems to come
internally from a  SSH_MSG_REQUEST_FAILURE.

I've tested the ssh server with the same port, and it works on the
command line with "ssh -R ..." so I'm almost positive I'm missing
something in my code...

Any help would be greatly appreciated!  I plan on adding this to the
examples when finished.  I can share a larger example if needed too!

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

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 23 17:53:35 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7NFrRNt006644;
	Tue, 23 Aug 2011 17:53:34 +0200
Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com
	[209.85.213.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7NFrPvH006597
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 23 Aug 2011 17:53:26 +0200
Received: by yxn22 with SMTP id 22so221391yxn.41
	for <libssh2-devel@cool.haxx.se>; Tue, 23 Aug 2011 08:53:24 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.100.108.20 with SMTP id g20mr3803045anc.143.1314114804370;
	Tue, 23 Aug 2011 08:53:24 -0700 (PDT)
Received: by 10.100.37.1 with HTTP; Tue, 23 Aug 2011 08:53:24 -0700 (PDT)
Date: Tue, 23 Aug 2011 12:53:24 -0300
Message-ID: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
Subject: libssh2_sftp_seek64 doesn't work
From: Ezequiel Ruiz <eruiz@barcelona04.com>
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 23 Aug 2011 17:53:35 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 23 Aug 2011 17:53:26 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1199686354=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1199686354==
Content-Type: multipart/alternative; boundary=0016e64402801bcd7704ab2e322d

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

Hello everybody,

I'm trying the libssh2_sftp_seek64() function in my code, and for some
reason it doesn't seam to work.
My code is something like this:

file = libssh2_sftp_open(sftpinstance, name.c_str(),filemode,0);

char *data[128];
libssh2_sftp_read(file,data,128);

It reads the buffer without problem, but if I call the seek64() function, it
just ignores it. I mean, if I call:

libssh2_sftp_seek64(file,0);

and then:

libssh2_sftp_read(file,data,128);

The read operation continues the previous read operation (from byte 128), as
if I'd never called the seek function.

This issue happens in 1.2.8 and 1.2.9. The 1.2.7 seams to work fine with
seek calls.
I'm working under Windows 7, with Visual c++ 2010 (32 bit). The remote host
is a Debian Linux.
Any seek call I've tried (with different file sizes) has failed (it was
ignored by the API).

Is this a bug?, or I'm doing something wrong?

Regards,

Ezequiel

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

Hello everybody, <br><br>I&#39;m trying the libssh2_sftp_seek64() function =
in my code, and for some reason it doesn&#39;t seam to work.<br>My code is =
something like this:<br><br>file =3D libssh2_sftp_open(sftpinstance, name.c=
_str(),filemode,0);<br>
<br>char *data[128];<br>libssh2_sftp_read(file,data,128);<br><br>It reads t=
he buffer without problem, but if I call the seek64() function, it just ign=
ores it. I mean, if I call:<br><br>libssh2_sftp_seek64(file,0);<br><br>
and then:<br><br>libssh2_sftp_read(file,data,128);<br><br>The read operatio=
n continues the previous read operation (from byte 128), as if I&#39;d neve=
r called the seek function.<br><br>This issue happens in 1.2.8 and 1.2.9. T=
he 1.2.7 seams to work fine with seek calls.<br>
I&#39;m working under Windows 7, with Visual c++ 2010 (32 bit). The remote =
host is a Debian Linux.<br>Any seek call I&#39;ve tried (with different fil=
e sizes) has failed (it was ignored by the API).<br><br>Is this a bug?, or =
I&#39;m doing something wrong?<br>
<br>Regards,<br><br>Ezequiel<br><br>

--0016e64402801bcd7704ab2e322d--

--===============1199686354==
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

--===============1199686354==--

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 23 19:55:51 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7NHtXN4008339;
	Tue, 23 Aug 2011 19:55:50 +0200
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 p7NHtWPw008332
	for <libssh2-devel@cool.haxx.se>; Tue, 23 Aug 2011 19:55:32 +0200
Date: Tue, 23 Aug 2011 19:55:32 +0200 (CEST)
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_seek64 doesn't work
In-Reply-To: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108231954480.18208@tvnag.unkk.fr>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 23 Aug 2011 19:55:51 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 23 Aug 2011 19:55:32 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Tue, 23 Aug 2011, Ezequiel Ruiz wrote:

> I'm trying the libssh2_sftp_seek64() function in my code, and for some
> reason it doesn't seam to work.
> My code is something like this:

To make it easier to debug, can you provide a full source code, perhaps based 
on one of the existing examples, that shows the problem when run?

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 24 04:53:10 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7O2qibg012069;
	Wed, 24 Aug 2011 04:53:06 +0200
Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com
	[209.85.220.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7O2qfFB011989
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 04:52:42 +0200
Received: by vxh11 with SMTP id 11so892264vxh.41
	for <libssh2-devel@cool.haxx.se>; Tue, 23 Aug 2011 19:52:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=kKugK5kex7tG2IyaMhidMU/i9S93QlXkKP4JKQN2TdA=;
	b=Eqpvj7O25lSsp3aLZ+hoNZZy0uxNuQF/24W6a5+o+TdAG86h2Gd7Q4KAs5k5a6huqv
	lEdNj+yIbXTNu9or0s+0hsKKqe3OJ+aHXofrqHfJK2FhHdZT7a8lSSgWoHAFybAKD0o1
	aYyjN/4vkPh5rUnORiYD716e0vVZ/k2cWha2Y=
MIME-Version: 1.0
Received: by 10.52.23.113 with SMTP id l17mr4102vdf.57.1314154355502; Tue, 23
	Aug 2011 19:52:35 -0700 (PDT)
Received: by 10.220.16.194 with HTTP; Tue, 23 Aug 2011 19:52:35 -0700 (PDT)
Date: Wed, 24 Aug 2011 10:52:35 +0800
Message-ID: <CABhJMFJP8x4HRwcHn+mdYMPbGF51=jBxK9t_7j0-TNJAHnUQLg@mail.gmail.com>
Subject: libssh2_sftp_tell64() doesn't return the right pointer
From: m odd <xieepp@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 24 Aug 2011 04:53:10 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 24 Aug 2011 04:52:43 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1523600750=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1523600750==
Content-Type: multipart/alternative; boundary=20cf307812b68a2da504ab37670e

--20cf307812b68a2da504ab37670e
Content-Type: text/plain; charset=ISO-8859-1

hello everyone!

I think there is a bug about libssh2_sftp_tell64() ,it's return value is
always smaller than the right place.

I think sftp_read() has forget to adjust the offset:

    if(filep->data_left) {
        /* data left from previous call */
        size_t copy = MIN(buffer_size, filep->data_left);

        memcpy(buffer, &filep->data[ filep->data_len - filep->data_left],
               copy);

        total_read += copy;
        filep->data_left -= copy;

        /* adjust the offset */
        filep->offset += copy;

        if(filep->data_left)
            return total_read;

        LIBSSH2_FREE(session, filep->data);
        filep->data = NULL;
    }

    /* return when data_left == buffer_size */
    if (total_read == buffer_size)
        return total_read;

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

hello everyone!<div><div><br></div></div><div>I think there is a bug about =
libssh2_sftp_tell64() ,it&#39;s return value is always smaller than the rig=
ht place.</div><div><br></div><div>I think sftp_read() has forget to adjust=
 the offset:</div>
<div><br></div><div><div>=A0=A0 =A0if(filep-&gt;data_left) {</div><div>=A0=
=A0 =A0 =A0 =A0/* data left from previous call */</div><div>=A0=A0 =A0 =A0 =
=A0size_t copy =3D MIN(buffer_size, filep-&gt;data_left);</div><div><br></d=
iv><div>=A0=A0 =A0 =A0 =A0memcpy(buffer, &amp;filep-&gt;data[ filep-&gt;dat=
a_len - filep-&gt;data_left],</div>
<div>=A0=A0 =A0 =A0 =A0 =A0 =A0 =A0 copy);</div><div><br></div><div>=A0=A0 =
=A0 =A0 =A0total_read +=3D copy;</div><div>=A0=A0 =A0 =A0 =A0filep-&gt;data=
_left -=3D copy;</div><div><br></div><div>=A0=A0 =A0 =A0 =A0/* adjust the o=
ffset */</div><div>=A0=A0 =A0 =A0 =A0filep-&gt;offset +=3D copy;</div>
<div><br></div><div>=A0=A0 =A0 =A0 =A0if(filep-&gt;data_left)</div><div>=A0=
=A0 =A0 =A0 =A0 =A0 =A0return total_read;</div><div><br></div><div>=A0=A0 =
=A0 =A0 =A0LIBSSH2_FREE(session, filep-&gt;data);</div><div>=A0=A0 =A0 =A0 =
=A0filep-&gt;data =3D NULL;</div><div>=A0=A0 =A0}</div>
</div><div><br></div><div>=A0=A0 =A0/* return when data_left =3D=3D buffer_=
size */</div><div><div>=A0=A0 =A0if (total_read =3D=3D buffer_size)</div><d=
iv>=A0=A0 =A0 =A0 =A0return total_read;</div></div>

--20cf307812b68a2da504ab37670e--

--===============1523600750==
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

--===============1523600750==--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 24 05:25:01 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7O3Orln002834;
	Wed, 24 Aug 2011 05:25:00 +0200
Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com
	[209.85.212.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7O3OpuE002734
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 05:24:52 +0200
Received: by vws18 with SMTP id 18so901580vws.41
	for <libssh2-devel@cool.haxx.se>; Tue, 23 Aug 2011 20:24:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=+5tVmXlIogcA5PtNMFxcsqKW6/uwcPSFA5WTDbJ+7Jc=;
	b=m3ORPmLar2vnSRIl/X4zPjq04YAmwmilUvLj3uvu8OS3U0QRJvQrFV2TI1me70Vuwp
	tAUJb7zjKPJZJD5LlXv7kstjc19RQtpXwWR2mxvRfuCbLYSF7ISJ9Ah7PVkxsrSXF0ut
	/0ioTDnLRvUcjw6vJ4aFC2M25JmFxjaaH+kHw=
MIME-Version: 1.0
Received: by 10.220.149.10 with SMTP id r10mr1338614vcv.95.1314156286489; Tue,
	23 Aug 2011 20:24:46 -0700 (PDT)
Received: by 10.220.16.194 with HTTP; Tue, 23 Aug 2011 20:24:46 -0700 (PDT)
In-Reply-To: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
Date: Wed, 24 Aug 2011 11:24:46 +0800
Message-ID: <CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
Subject: Re: libssh2_sftp_seek64 doesn't work
From: m odd <xieepp@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 24 Aug 2011 05:25:01 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 24 Aug 2011 05:24:52 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============0311874352=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0311874352==
Content-Type: multipart/alternative; boundary=f46d043d6467a2b44b04ab37da95

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

    /* We allow a number of bytes being requested at any given time without
       having been acked - until we reach EOF. */
    if(!filep->eof) {
        /* if the buffer_size passed in now is smaller than what has already
           been sent, we risk getting count become a very large number */
        if((buffer_size*4) > already)
            count = (buffer_size*4) - already;
    }

In the sftp_read(), the actually request count is bigger than
buffer_size,so, the previous call will get more data than you want.
I think libssh2_sftp_seek64() must discard the unnecessary request packet
and the data already stored.

LIBSSH2_API void
libssh2_sftp_seek64(LIBSSH2_SFTP_HANDLE *handle, libssh2_uint64_t offset)
{
    if(handle) {
        handle->u.file.offset = handle->u.file.offset_sent = offset;
        sftp_packetlist_flush(handle);
        if (handle->u.file.data_left) {

 LIBSSH2_FREE(handle->sftp->channel->session, handle->u.file.data);
            handle->u.file.data_left = handle->u.file.data_len = 0;
            handle->u.file.data = NULL;
        }
    }
}

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

<div><div><div>=A0=A0 =A0/* We allow a number of bytes being requested at a=
ny given time without</div><div>=A0=A0 =A0 =A0 having been acked - until we=
 reach EOF. */</div><div>=A0=A0 =A0if(!filep-&gt;eof) {</div><div>=A0=A0 =
=A0 =A0 =A0/* if the buffer_size passed in now is smaller than what has alr=
eady</div>

<div>=A0=A0 =A0 =A0 =A0 =A0 been sent, we risk getting count become a very =
large number */</div><div>=A0=A0 =A0 =A0 =A0if((buffer_size*4) &gt; already=
)</div><div>=A0=A0 =A0 =A0 =A0 =A0 =A0count =3D (buffer_size*4) - already;<=
/div><div>=A0=A0 =A0}</div></div><div><br>

</div><div>In the sftp_read(), the actually request count is bigger than bu=
ffer_size,so, the previous call will get more data than you want.</div><div=
>I think=A0libssh2_sftp_seek64() must discard the unnecessary request packe=
t and the data already stored.</div>
<div><br></div><div>LIBSSH2_API void</div><div>libssh2_sftp_seek64(LIBSSH2_=
SFTP_HANDLE *handle, libssh2_uint64_t offset)</div><div>{</div><div>=A0=A0 =
=A0if(handle) {</div><div>=A0=A0 =A0 =A0 =A0handle-&gt;u.file.offset =3D ha=
ndle-&gt;u.file.offset_sent =3D offset;</div>

</div><div>=A0=A0 =A0 =A0 =A0sftp_packetlist_flush(handle);=A0</div><div><d=
iv>=A0=A0 =A0 =A0 =A0if (handle-&gt;u.file.data_left) {</div><div>=A0=A0 =
=A0 =A0 =A0 =A0 =A0LIBSSH2_FREE(handle-&gt;sftp-&gt;channel-&gt;session,=A0=
handle-&gt;u.file.data);</div><div>
=A0=A0 =A0 =A0 =A0 =A0 =A0handle-&gt;u.file.data_left =3D=A0handle-&gt;u.fi=
le.data_len =3D 0;</div>
<div>=A0=A0 =A0 =A0 =A0 =A0 =A0handle-&gt;u.file.data =3D NULL;</div><div>=
=A0=A0 =A0 =A0 =A0}</div></div>=A0=A0 =A0}<div>}</div>

--f46d043d6467a2b44b04ab37da95--

--===============0311874352==
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

--===============0311874352==--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 24 11:08:19 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7O980hU018229;
	Wed, 24 Aug 2011 11:08:15 +0200
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 p7O97wmv018208
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 11:07:58 +0200
Date: Wed, 24 Aug 2011 11:07:58 +0200 (CEST)
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_tell64() doesn't return the right pointer
In-Reply-To: <CABhJMFJP8x4HRwcHn+mdYMPbGF51=jBxK9t_7j0-TNJAHnUQLg@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108241106510.32591@tvnag.unkk.fr>
References: <CABhJMFJP8x4HRwcHn+mdYMPbGF51=jBxK9t_7j0-TNJAHnUQLg@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 24 Aug 2011 11:08:19 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 24 Aug 2011 11:07:58 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Wed, 24 Aug 2011, m odd wrote:

> I think there is a bug about libssh2_sftp_tell64() ,it's return value is 
> always smaller than the right place.
>
> I think sftp_read() has forget to adjust the offset:

Is that your modified version? If you have a suggested fix, can you please 
provide that as a diff output (wither with git or just using diff -u)?

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 24 14:44:56 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7OCiVnp025664;
	Wed, 24 Aug 2011 14:44:50 +0200
Received: from mail-pz0-f43.google.com (mail-pz0-f43.google.com
	[209.85.210.43])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7OCiSac025520
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 14:44:30 +0200
Received: by pzk1 with SMTP id 1so1141837pzk.30
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 05:44:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=l5znFtCwd8PRa/316heV2JoVot8WUIZ5P6bHRzyHhq4=;
	b=UXsnW+vu4hj1cebbYF9GkwIhqPufqx6Yoyctoy8tVq7ATCrpfrgnFacAgzwV4XP7em
	SIPiXyAnhxCEKxCeEA9PSLBdL0DI6y5EKaU6Z6zaz8BQvFUp+fGtcViv2sKB8CKkk4tH
	pQN+c5ZWjbRJauGP2CNoOzN2MxplRVylhpMBo=
MIME-Version: 1.0
Received: by 10.142.144.6 with SMTP id r6mr2533727wfd.109.1314189865109; Wed,
	24 Aug 2011 05:44:25 -0700 (PDT)
Received: by 10.68.47.65 with HTTP; Wed, 24 Aug 2011 05:44:25 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108241106510.32591@tvnag.unkk.fr>
References: <CABhJMFJP8x4HRwcHn+mdYMPbGF51=jBxK9t_7j0-TNJAHnUQLg@mail.gmail.com>
	<alpine.DEB.2.00.1108241106510.32591@tvnag.unkk.fr>
Date: Wed, 24 Aug 2011 20:44:25 +0800
Message-ID: <CABhJMFLVrD8wHWwz7=102wtdyE2R48XTbGUOt=cxEpJAe0Odsg@mail.gmail.com>
Subject: Re: libssh2_sftp_tell64() doesn't return the right pointer
From: m odd <xieepp@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 24 Aug 2011 14:44:56 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 24 Aug 2011 14:44:30 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1958164204=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1958164204==
Content-Type: multipart/alternative; boundary=000e0cd1474c13ca7d04ab3fac4f

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

@@ -1096,18 +1096,22 @@ static ssize_t sftp_read(LIBSSH2_SFTP_HANDLE *
handle, char *buffer,
         memcpy(buffer, &filep->data[ filep->data_len - filep->data_left],
                copy);

         total_read += copy;
         filep->data_left -= copy;
+        filep->offset += copy;

         if(filep->data_left)
             return total_read;

         LIBSSH2_FREE(session, filep->data);
         filep->data = NULL;
     }

+    if (total_read == buffer_size)
+        return total_read;
+
     /* We allow a number of bytes being requested at any given time without
        having been acked - until we reach EOF. */
     if(!filep->eof) {
         /* if the buffer_size passed in now is smaller than what has
already
            been sent, we risk getting count become a very large number */

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

<div>@@ -1096,18 +1096,22 @@ static ssize_t sftp_read(LIBSSH2_SFTP_HANDLE *=
 handle, char *buffer,</div><div>=A0=A0 =A0 =A0 =A0 memcpy(buffer, &amp;fil=
ep-&gt;data[ filep-&gt;data_len - filep-&gt;data_left],</div><div>=A0=A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0copy);</div>
<div>=A0</div><div>=A0=A0 =A0 =A0 =A0 total_read +=3D copy;</div><div>=A0=
=A0 =A0 =A0 =A0 filep-&gt;data_left -=3D copy;</div><div>+ =A0 =A0 =A0 =A0f=
ilep-&gt;offset +=3D copy;</div><div>=A0</div><div>=A0=A0 =A0 =A0 =A0 if(fi=
lep-&gt;data_left)</div><div>=A0=A0 =A0 =A0 =A0 =A0 =A0 return total_read;<=
/div>
<div>=A0</div><div>=A0=A0 =A0 =A0 =A0 LIBSSH2_FREE(session, filep-&gt;data)=
;</div><div>=A0=A0 =A0 =A0 =A0 filep-&gt;data =3D NULL;</div><div>=A0=A0 =
=A0 }</div><div>=A0</div><div>+ =A0 =A0if (total_read =3D=3D buffer_size)</=
div><div>+ =A0 =A0 =A0 =A0return total_read;</div>
<div>+</div><div>=A0=A0 =A0 /* We allow a number of bytes being requested a=
t any given time without</div><div>=A0=A0 =A0 =A0 =A0having been acked - un=
til we reach EOF. */</div><div>=A0=A0 =A0 if(!filep-&gt;eof) {</div><div>=
=A0=A0 =A0 =A0 =A0 /* if the buffer_size passed in now is smaller than what=
 has already</div>
<div>=A0=A0 =A0 =A0 =A0 =A0 =A0been sent, we risk getting count become a ve=
ry large number */</div><div><br></div>

--000e0cd1474c13ca7d04ab3fac4f--

--===============1958164204==
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

--===============1958164204==--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 24 15:57:13 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7ODuvkH007743;
	Wed, 24 Aug 2011 15:57:11 +0200
Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com
	[209.85.213.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7ODutwd007719
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 15:56:56 +0200
Received: by yxn22 with SMTP id 22so984342yxn.41
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 06:56:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=wTXm5mZqEz1lYsuea97Ee/22pcF7qbwOkxTraAq600U=;
	b=Nn7cJNhHy4GTH7oOIQrb2oZUKsRbarNYpj0awOvXgcDnu9WVPpSDWtx6LwR+cl9C83
	rqUicPhMBsNQ/CP3PSpMqnrdfeo1J8geNAnZlzS00eNFF0glYd+bCfMdoc9jOOAFPiHj
	d19g3djqGMapzbqrdMD1XjyAnPB1V+/Xf/B/E=
MIME-Version: 1.0
Received: by 10.143.82.5 with SMTP id j5mr2580635wfl.280.1314194211339; Wed,
	24 Aug 2011 06:56:51 -0700 (PDT)
Received: by 10.68.47.65 with HTTP; Wed, 24 Aug 2011 06:56:51 -0700 (PDT)
In-Reply-To: <CABhJMFLVrD8wHWwz7=102wtdyE2R48XTbGUOt=cxEpJAe0Odsg@mail.gmail.com>
References: <CABhJMFJP8x4HRwcHn+mdYMPbGF51=jBxK9t_7j0-TNJAHnUQLg@mail.gmail.com>
	<alpine.DEB.2.00.1108241106510.32591@tvnag.unkk.fr>
	<CABhJMFLVrD8wHWwz7=102wtdyE2R48XTbGUOt=cxEpJAe0Odsg@mail.gmail.com>
Date: Wed, 24 Aug 2011 21:56:51 +0800
Message-ID: <CABhJMF+uxN-WTUf7TXzhOhV1vMN1_8Q9zAXqH9aomE4pDDY0Uw@mail.gmail.com>
Subject: Re: libssh2_sftp_tell64() doesn't return the right pointer
From: m odd <xieepp@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 24 Aug 2011 15:57:13 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 24 Aug 2011 15:56:56 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============0572228392=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0572228392==
Content-Type: multipart/alternative; boundary=000e0cd24cd821feca04ab40afdd

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

When i use git to commit a patch. I get an error:
Pushing to git://git.libssh2.org/libssh2.git
fatal: The remote end hung up unexpectedly

How can i use git to commit code?
I use git gui on windows 7. thanks!

--000e0cd24cd821feca04ab40afdd
Content-Type: text/html; charset=ISO-8859-1

When i use git to commit a patch. I get an error:<br><div>Pushing to git://<a href="http://git.libssh2.org/libssh2.git">git.libssh2.org/libssh2.git</a></div><div>fatal: The remote end hung up unexpectedly</div><div><br></div>
<div>How can i use git to commit code?</div><div>I use git gui on windows 7. thanks!</div>

--000e0cd24cd821feca04ab40afdd--

--===============0572228392==
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

--===============0572228392==--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 24 16:10:48 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7OEAggp018389;
	Wed, 24 Aug 2011 16:10:47 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7OEAeAV018378
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 16:10:40 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7OEAfdh019588
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 14:10:43 GMT
Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged))
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7OEAe2G001709
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 16:10:40 +0200
Subject: Re: libssh2_sftp_tell64() doesn't return the right pointer
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Wed, 24 Aug 2011 16:10:40 +0200
In-Reply-To: <CABhJMF+uxN-WTUf7TXzhOhV1vMN1_8Q9zAXqH9aomE4pDDY0Uw@mail.gmail.com>
References: <CABhJMFJP8x4HRwcHn+mdYMPbGF51=jBxK9t_7j0-TNJAHnUQLg@mail.gmail.com>
	<alpine.DEB.2.00.1108241106510.32591@tvnag.unkk.fr>
	<CABhJMFLVrD8wHWwz7=102wtdyE2R48XTbGUOt=cxEpJAe0Odsg@mail.gmail.com>
	<CABhJMF+uxN-WTUf7TXzhOhV1vMN1_8Q9zAXqH9aomE4pDDY0Uw@mail.gmail.com>
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Message-ID: <1314195040.19560.2.camel@henriknordstrom.net>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 24 Aug 2011 16:10:47 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Wed, 24 Aug 2011 16:10:40 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Wed, 24 Aug 2011 14:10:44 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

ons 2011-08-24 klockan 21:56 +0800 skrev m odd:
> When i use git to commit a patch. I get an error:
> Pushing to git://git.libssh2.org/libssh2.git
> fatal: The remote end hung up unexpectedly
> 
> 
> How can i use git to commit code?

Push to github or another public repository an request a pull/merge from
there.

Regards
Henrik



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

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 24 16:13:34 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7OEDVOh019641;
	Wed, 24 Aug 2011 16:13:34 +0200
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 p7OEDU7g019636
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 16:13:30 +0200
Date: Wed, 24 Aug 2011 16:13:30 +0200 (CEST)
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_tell64() doesn't return the right pointer
In-Reply-To: <CABhJMF+uxN-WTUf7TXzhOhV1vMN1_8Q9zAXqH9aomE4pDDY0Uw@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108241612510.32591@tvnag.unkk.fr>
References: <CABhJMFJP8x4HRwcHn+mdYMPbGF51=jBxK9t_7j0-TNJAHnUQLg@mail.gmail.com>
	<alpine.DEB.2.00.1108241106510.32591@tvnag.unkk.fr>
	<CABhJMFLVrD8wHWwz7=102wtdyE2R48XTbGUOt=cxEpJAe0Odsg@mail.gmail.com>
	<CABhJMF+uxN-WTUf7TXzhOhV1vMN1_8Q9zAXqH9aomE4pDDY0Uw@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 24 Aug 2011 16:13:34 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 24 Aug 2011 16:13:31 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Wed, 24 Aug 2011, m odd wrote:

> How can i use git to commit code?

Posting your patches here is good enough, and once we agree they're fine we'll 
push them to the main git repository.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 24 16:15:37 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7OEFYV0020777;
	Wed, 24 Aug 2011 16:15:36 +0200
Received: from puck.spacetec.no (puck.spacetec.no [192.51.5.29])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with SMTP id p7OEFYcw020766
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 16:15:34 +0200
Received: (qmail 27535 invoked from network); 24 Aug 2011 14:15:37 -0000
Received: from mail-bw0-f54.google.com (tor@209.85.214.54)
	by puck.spacetec.no with ESMTPA; 24 Aug 2011 14:15:37 -0000
Received: by bkat8 with SMTP id t8so1259177bka.41
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 07:15:36 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.204.128.130 with SMTP id k2mr2406655bks.322.1314195336245;
	Wed, 24 Aug 2011 07:15:36 -0700 (PDT)
Received: by 10.204.145.67 with HTTP; Wed, 24 Aug 2011 07:15:36 -0700 (PDT)
In-Reply-To: <1314195040.19560.2.camel@henriknordstrom.net>
References: <CABhJMFJP8x4HRwcHn+mdYMPbGF51=jBxK9t_7j0-TNJAHnUQLg@mail.gmail.com>
	<alpine.DEB.2.00.1108241106510.32591@tvnag.unkk.fr>
	<CABhJMFLVrD8wHWwz7=102wtdyE2R48XTbGUOt=cxEpJAe0Odsg@mail.gmail.com>
	<CABhJMF+uxN-WTUf7TXzhOhV1vMN1_8Q9zAXqH9aomE4pDDY0Uw@mail.gmail.com>
	<1314195040.19560.2.camel@henriknordstrom.net>
Date: Wed, 24 Aug 2011 16:15:36 +0200
Message-ID: <CAL1JhhxZrEVGhy68oyzYwqv9=3o6iCFNFUoiwjp+ohVV7nt+rw@mail.gmail.com>
Subject: Re: libssh2_sftp_tell64() doesn't return the right pointer
From: Tor Arntsen <tor@spacetec.no>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 24 Aug 2011 16:15:37 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 24 Aug 2011 16:15:34 +0200 (CEST)
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id
	p7OEFYcw020766
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="iso-8859-1"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p7OEFYV0020777

2011/8/24 Henrik Nordström <henrik@henriknordstrom.net>:
> ons 2011-08-24 klockan 21:56 +0800 skrev m odd:
>> When i use git to commit a patch. I get an error:
>> Pushing to git://git.libssh2.org/libssh2.git
>> fatal: The remote end hung up unexpectedly
>>
>>
>> How can i use git to commit code?
>
> Push to github or another public repository an request a pull/merge from
> there.

Or even better: From your local clone, just create a patch with git
format-patch and post it to the list. Pull requests are only seen by a
few people, patches posted to the list can be reviewed by everyone.

-Tor

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

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 24 16:20:01 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7OEJwM1022307;
	Wed, 24 Aug 2011 16:20:01 +0200
Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com
	[209.85.218.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7OEJtkP022273
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 16:19:56 +0200
Received: by yib19 with SMTP id 19so1010679yib.41
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 07:19:53 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.101.193.25 with SMTP id v25mr4694647anp.99.1314195593635; Wed,
	24 Aug 2011 07:19:53 -0700 (PDT)
Received: by 10.100.120.1 with HTTP; Wed, 24 Aug 2011 07:19:53 -0700 (PDT)
In-Reply-To: <CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
	<CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
Date: Wed, 24 Aug 2011 11:19:53 -0300
Message-ID: <CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
Subject: Re: libssh2_sftp_seek64 doesn't work
From: Ezequiel Ruiz <eruiz@barcelona04.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 24 Aug 2011 16:20:01 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 24 Aug 2011 16:19:56 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============0619189993=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0619189993==
Content-Type: multipart/alternative; boundary=001636c925758625f004ab41013e

--001636c925758625f004ab41013e
Content-Type: text/plain; charset=ISO-8859-1

2011/8/24 m odd <xieepp@gmail.com>

>     /* We allow a number of bytes being requested at any given time without
>        having been acked - until we reach EOF. */
>     if(!filep->eof) {
>         /* if the buffer_size passed in now is smaller than what has
> already
>            been sent, we risk getting count become a very large number */
>         if((buffer_size*4) > already)
>             count = (buffer_size*4) - already;
>     }
>
> In the sftp_read(), the actually request count is bigger than
> buffer_size,so, the previous call will get more data than you want.
> I think libssh2_sftp_seek64() must discard the unnecessary request packet
> and the data already stored.
>
> LIBSSH2_API void
> libssh2_sftp_seek64(LIBSSH2_SFTP_HANDLE *handle, libssh2_uint64_t offset)
> {
>     if(handle) {
>         handle->u.file.offset = handle->u.file.offset_sent = offset;
>         sftp_packetlist_flush(handle);
>         if (handle->u.file.data_left) {
>
>  LIBSSH2_FREE(handle->sftp->channel->session, handle->u.file.data);
>             handle->u.file.data_left = handle->u.file.data_len = 0;
>             handle->u.file.data = NULL;
>         }
>     }
> }
>
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>
>
Sorry... is that a patch? can you show me the changes you made please? (with
a diff should be enough)

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

<br><br><div class=3D"gmail_quote">2011/8/24 m odd <span dir=3D"ltr">&lt;<a=
 href=3D"mailto:xieepp@gmail.com">xieepp@gmail.com</a>&gt;</span><br><block=
quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc=
 solid;padding-left:1ex;">
<div><div><div>=A0=A0 =A0/* We allow a number of bytes being requested at a=
ny given time without</div><div>=A0=A0 =A0 =A0 having been acked - until we=
 reach EOF. */</div><div>=A0=A0 =A0if(!filep-&gt;eof) {</div><div>=A0=A0 =
=A0 =A0 =A0/* if the buffer_size passed in now is smaller than what has alr=
eady</div>


<div>=A0=A0 =A0 =A0 =A0 =A0 been sent, we risk getting count become a very =
large number */</div><div>=A0=A0 =A0 =A0 =A0if((buffer_size*4) &gt; already=
)</div><div>=A0=A0 =A0 =A0 =A0 =A0 =A0count =3D (buffer_size*4) - already;<=
/div><div>=A0=A0 =A0}</div></div><div><br>


</div><div>In the sftp_read(), the actually request count is bigger than bu=
ffer_size,so, the previous call will get more data than you want.</div><div=
>I think=A0libssh2_sftp_seek64() must discard the unnecessary request packe=
t and the data already stored.</div>

<div><br></div><div>LIBSSH2_API void</div><div>libssh2_sftp_seek64(LIBSSH2_=
SFTP_HANDLE *handle, libssh2_uint64_t offset)</div><div>{</div><div>=A0=A0 =
=A0if(handle) {</div><div>=A0=A0 =A0 =A0 =A0handle-&gt;u.file.offset =3D ha=
ndle-&gt;u.file.offset_sent =3D offset;</div>


</div><div>=A0=A0 =A0 =A0 =A0sftp_packetlist_flush(handle);=A0</div><div><d=
iv>=A0=A0 =A0 =A0 =A0if (handle-&gt;u.file.data_left) {</div><div>=A0=A0 =
=A0 =A0 =A0 =A0 =A0LIBSSH2_FREE(handle-&gt;sftp-&gt;channel-&gt;session,=A0=
handle-&gt;u.file.data);</div><div>

=A0=A0 =A0 =A0 =A0 =A0 =A0handle-&gt;u.file.data_left =3D=A0handle-&gt;u.fi=
le.data_len =3D 0;</div>
<div>=A0=A0 =A0 =A0 =A0 =A0 =A0handle-&gt;u.file.data =3D NULL;</div><div>=
=A0=A0 =A0 =A0 =A0}</div></div>=A0=A0 =A0}<div>}</div>
<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>
<br></blockquote></div><br>Sorry... is that a patch? can you show me the ch=
anges you made please? (with a diff should be enough)<br>

--001636c925758625f004ab41013e--

--===============0619189993==
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

--===============0619189993==--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 24 16:34:09 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7OEY2aO000585;
	Wed, 24 Aug 2011 16:34:09 +0200
Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com
	[209.85.161.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7OEY0c6000494
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 16:34:01 +0200
Received: by gxk28 with SMTP id 28so1027569gxk.41
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 07:33:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=axIjGe3rqAZ2uJ9kFU+shqQZEpn+0IvoFspGcOvGmUQ=;
	b=INVCBnrrU6B2lVehazeRWZ+QJc2WJEqwBT77yF4QcJy57qVFmO5edE7d1HeTBcEKmo
	fBxFlHRgbIz0zQD0B38CXGSv+KaGcYY41lKWr5YDVOUBPqQf+uQtFtiIzohwfc9gWmWo
	cZlE4UBKE/9U+lFJSiHEaErLtwYt94MLtE5Ww=
MIME-Version: 1.0
Received: by 10.142.217.3 with SMTP id p3mr2608967wfg.166.1314196438182; Wed,
	24 Aug 2011 07:33:58 -0700 (PDT)
Received: by 10.68.47.65 with HTTP; Wed, 24 Aug 2011 07:33:58 -0700 (PDT)
In-Reply-To: <CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
	<CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
	<CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
Date: Wed, 24 Aug 2011 22:33:58 +0800
Message-ID: <CABhJMFJ+wfvaoKg1PtT83Ds-YrW+jPiMRv4o3P76Dhe7wmpc0w@mail.gmail.com>
Subject: Re: libssh2_sftp_seek64 doesn't work
From: m odd <xieepp@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 24 Aug 2011 16:34:09 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 24 Aug 2011 16:34:01 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============0990641370=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0990641370==
Content-Type: multipart/alternative; boundary=000e0cd22f68dce9fa04ab4133e6

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

 LIBSSH2_API void
 libssh2_sftp_seek64(LIBSSH2_SFTP_HANDLE *handle, libssh2_uint64_t offset)
 {
-    if(handle)
-        handle->u.file.offset = handle->u.file.offset_sent = offset;
+  if(handle) {
+    handle->u.file.offset = handle->u.file.offset_sent = offset;
+    /* discard the request */
+    sftp_packetlist_flush(handle);
+
+    /* free the left received data */
+    if (handle->u.file.data_left) {
+      LIBSSH2_FREE(handle->sftp->channel->session, handle->u.file.data);
+      handle->u.file.data_left = handle->u.file.data_len = 0;
+      handle->u.file.data = NULL;
+    }
+  }
 }

Just my point about the problem.

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

<div>=A0LIBSSH2_API void</div><div><div>=A0libssh2_sftp_seek64(LIBSSH2_SFTP=
_HANDLE *handle, libssh2_uint64_t offset)</div><div>=A0{</div><div>- =A0 =
=A0if(handle)</div><div>- =A0 =A0 =A0 =A0handle-&gt;u.file.offset =3D handl=
e-&gt;u.file.offset_sent =3D offset;</div>
<div>+ =A0if(handle) {</div><div>+ =A0 =A0handle-&gt;u.file.offset =3D hand=
le-&gt;u.file.offset_sent =3D offset;</div><div>+ =A0 =A0/* discard the req=
uest */</div><div>+ =A0 =A0sftp_packetlist_flush(handle);=A0</div><div>+</d=
iv><div>+ =A0 =A0/* free the left received data */</div>
<div>+ =A0 =A0if (handle-&gt;u.file.data_left) {</div><div>+ =A0 =A0 =A0LIB=
SSH2_FREE(handle-&gt;sftp-&gt;channel-&gt;session, handle-&gt;u.file.data);=
</div><div>+ =A0 =A0 =A0handle-&gt;u.file.data_left =3D handle-&gt;u.file.d=
ata_len =3D 0;</div>
<div>+ =A0 =A0 =A0handle-&gt;u.file.data =3D NULL;</div><div>+ =A0 =A0}</di=
v><div>+ =A0}</div><div>=A0}</div></div><div><br></div><div>Just my point a=
bout the problem.</div>

--000e0cd22f68dce9fa04ab4133e6--

--===============0990641370==
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

--===============0990641370==--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 24 17:48:17 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7OFlpYM012191;
	Wed, 24 Aug 2011 17:48:11 +0200
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7OFlnTJ012178
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 17:47:50 +0200
Received: by qwc9 with SMTP id 9so988647qwc.41
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 08:47:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=7EY4FoZZkUNC11EliuMlPGNswNOM+IFCY5XM3fUnj14=;
	b=AS3C6Y5aWCEuolXyhtS3EfbFg2sReDdyQftJtKAetHOJRiKyZbBp5RRXBaYBl+1nL8
	JeFD3P/yep0LrONwF/4VqHmT9/No501bko9g3tRJGae0xL0iPvCn5B6lNFktIH0IAov0
	jmgnJAdw1/GZxqmX7C8Chrj8QkWitkphmajb8=
MIME-Version: 1.0
Received: by 10.52.70.227 with SMTP id p3mr5573292vdu.124.1314200866138; Wed,
	24 Aug 2011 08:47:46 -0700 (PDT)
Received: by 10.220.16.194 with HTTP; Wed, 24 Aug 2011 08:47:46 -0700 (PDT)
Date: Wed, 24 Aug 2011 23:47:46 +0800
Message-ID: <CABhJMFJWgHWw7rvg-_5d-v6GRxtAvWWwNCvqFBgnmcub8Z3eeA@mail.gmail.com>
Subject: 0001-sftp_read-adjust-file-offset.patch
From: m odd <xieepp@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: multipart/mixed; boundary=20cf307cfe92ca2a1c04ab423b8d
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 24 Aug 2011 17:48:17 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 24 Aug 2011 17:47:51 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--20cf307cfe92ca2a1c04ab423b8d
Content-Type: multipart/alternative; boundary=20cf307cfe92ca2a1904ab423b8b

--20cf307cfe92ca2a1904ab423b8b
Content-Type: text/plain; charset=ISO-8859-1

 src/sftp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/sftp.c b/src/sftp.c
index 9d325f1..5885810 100644
--- a/src/sftp.c
+++ b/src/sftp.c
@@ -1098,6 +1098,7 @@ static ssize_t sftp_read(LIBSSH2_SFTP_HANDLE * handle,
char *buffer,

         total_read += copy;
         filep->data_left -= copy;
+        filep->offset += copy;

         if(filep->data_left)
             return total_read;
-- 
1.7.6.msysgit.0

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

<div>=A0src/sftp.c | =A0 =A01 +</div><div>=A01 files changed, 1 insertions(=
+), 0 deletions(-)</div><div><br></div><div>diff --git a/src/sftp.c b/src/s=
ftp.c</div><div>index 9d325f1..5885810 100644</div><div>--- a/src/sftp.c</d=
iv><div>
+++ b/src/sftp.c</div><div>@@ -1098,6 +1098,7 @@ static ssize_t sftp_read(L=
IBSSH2_SFTP_HANDLE * handle, char *buffer,</div><div>=A0</div><div>=A0=A0 =
=A0 =A0 =A0 total_read +=3D copy;</div><div>=A0=A0 =A0 =A0 =A0 filep-&gt;da=
ta_left -=3D copy;</div>
<div>+ =A0 =A0 =A0 =A0filep-&gt;offset +=3D copy;</div><div>=A0</div><div>=
=A0=A0 =A0 =A0 =A0 if(filep-&gt;data_left)</div><div>=A0=A0 =A0 =A0 =A0 =A0=
 =A0 return total_read;</div><div>--=A0</div><div>1.7.6.msysgit.0</div>

--20cf307cfe92ca2a1904ab423b8b--
--20cf307cfe92ca2a1c04ab423b8d
Content-Type: application/octet-stream; 
	name="0001-sftp_read-adjust-file-offset.patch"
Content-Disposition: attachment; 
	filename="0001-sftp_read-adjust-file-offset.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_grqh3bnh0

RnJvbSA4MjNiNDY0MjAzZjBkZDZiZjMwODI4NDJmNzZkODAwMjdhMDljYzFkIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBsaXV6bCA8eGllZXBwQGdtYWlsLmNvbT4KRGF0ZTogV2VkLCAy
NCBBdWcgMjAxMSAyMzoyNzoyMyArMDgwMApTdWJqZWN0OiBbUEFUQ0hdIHNmdHBfcmVhZCgpIGFk
anVzdCBmaWxlIG9mZnNldAoKClNpZ25lZC1vZmYtYnk6IGxpdXpsIDx4aWVlcHBAZ21haWwuY29t
PgotLS0KIHNyYy9zZnRwLmMgfCAgICAxICsKIDEgZmlsZXMgY2hhbmdlZCwgMSBpbnNlcnRpb25z
KCspLCAwIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL3NyYy9zZnRwLmMgYi9zcmMvc2Z0cC5j
CmluZGV4IDlkMzI1ZjEuLjU4ODU4MTAgMTAwNjQ0Ci0tLSBhL3NyYy9zZnRwLmMKKysrIGIvc3Jj
L3NmdHAuYwpAQCAtMTA5OCw2ICsxMDk4LDcgQEAgc3RhdGljIHNzaXplX3Qgc2Z0cF9yZWFkKExJ
QlNTSDJfU0ZUUF9IQU5ETEUgKiBoYW5kbGUsIGNoYXIgKmJ1ZmZlciwKIAogICAgICAgICB0b3Rh
bF9yZWFkICs9IGNvcHk7CiAgICAgICAgIGZpbGVwLT5kYXRhX2xlZnQgLT0gY29weTsKKyAgICAg
ICAgZmlsZXAtPm9mZnNldCArPSBjb3B5OwogCiAgICAgICAgIGlmKGZpbGVwLT5kYXRhX2xlZnQp
CiAgICAgICAgICAgICByZXR1cm4gdG90YWxfcmVhZDsKLS0gCjEuNy42Lm1zeXNnaXQuMAoK
--20cf307cfe92ca2a1c04ab423b8d
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

--20cf307cfe92ca2a1c04ab423b8d--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 24 18:32:51 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7OGWiap000378;
	Wed, 24 Aug 2011 18:32:50 +0200
Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com
	[209.85.213.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7OGWfh1000355
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 18:32:42 +0200
Received: by yxn22 with SMTP id 22so1148261yxn.41
	for <libssh2-devel@cool.haxx.se>; Wed, 24 Aug 2011 09:32:40 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.101.193.25 with SMTP id v25mr4848294anp.99.1314203560452; Wed,
	24 Aug 2011 09:32:40 -0700 (PDT)
Received: by 10.100.120.1 with HTTP; Wed, 24 Aug 2011 09:32:40 -0700 (PDT)
In-Reply-To: <CABhJMFJ+wfvaoKg1PtT83Ds-YrW+jPiMRv4o3P76Dhe7wmpc0w@mail.gmail.com>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
	<CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
	<CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
	<CABhJMFJ+wfvaoKg1PtT83Ds-YrW+jPiMRv4o3P76Dhe7wmpc0w@mail.gmail.com>
Date: Wed, 24 Aug 2011 13:32:40 -0300
Message-ID: <CAG0PjLwewrDKxg+k190HKZ+amEdrnrspVJ6KB6iw8MSoDj=1mg@mail.gmail.com>
Subject: Re: libssh2_sftp_seek64 doesn't work
From: Ezequiel Ruiz <eruiz@barcelona04.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 24 Aug 2011 18:32:51 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 24 Aug 2011 18:32:43 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============0884956205=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0884956205==
Content-Type: multipart/alternative; boundary=001636c925756221ab04ab42dc77

--001636c925756221ab04ab42dc77
Content-Type: text/plain; charset=ISO-8859-1

2011/8/24 m odd <xieepp@gmail.com>

>  LIBSSH2_API void
>  libssh2_sftp_seek64(LIBSSH2_SFTP_HANDLE *handle, libssh2_uint64_t offset)
>  {
> -    if(handle)
> -        handle->u.file.offset = handle->u.file.offset_sent = offset;
> +  if(handle) {
> +    handle->u.file.offset = handle->u.file.offset_sent = offset;
> +    /* discard the request */
> +    sftp_packetlist_flush(handle);
> +
> +    /* free the left received data */
> +    if (handle->u.file.data_left) {
> +      LIBSSH2_FREE(handle->sftp->channel->session, handle->u.file.data);
> +      handle->u.file.data_left = handle->u.file.data_len = 0;
> +      handle->u.file.data = NULL;
> +    }
> +  }
>  }
>
> Just my point about the problem.
>
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>
>
hey!!, this solves the problem! At least my seek64() calls are working back
again!. You should post this patch so it can be included in the git repo.
Nice work!, and thanks!!

Ezequiel

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

<br><div class=3D"gmail_quote">2011/8/24 m odd <span dir=3D"ltr">&lt;<a hre=
f=3D"mailto:xieepp@gmail.com">xieepp@gmail.com</a>&gt;</span><br><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex;">
<div>=A0LIBSSH2_API void</div><div><div class=3D"im"><div>=A0libssh2_sftp_s=
eek64(LIBSSH2_SFTP_HANDLE *handle, libssh2_uint64_t offset)</div><div>=A0{<=
/div><div>- =A0 =A0if(handle)</div><div>- =A0 =A0 =A0 =A0handle-&gt;u.file.=
offset =3D handle-&gt;u.file.offset_sent =3D offset;</div>

</div><div>+ =A0if(handle) {</div><div class=3D"im"><div>+ =A0 =A0handle-&g=
t;u.file.offset =3D handle-&gt;u.file.offset_sent =3D offset;</div></div><d=
iv>+ =A0 =A0/* discard the request */</div><div>+ =A0 =A0sftp_packetlist_fl=
ush(handle);=A0</div>
<div>+</div><div>+ =A0 =A0/* free the left received data */</div>
<div>+ =A0 =A0if (handle-&gt;u.file.data_left) {</div><div class=3D"im"><di=
v>+ =A0 =A0 =A0LIBSSH2_FREE(handle-&gt;sftp-&gt;channel-&gt;session, handle=
-&gt;u.file.data);</div><div>+ =A0 =A0 =A0handle-&gt;u.file.data_left =3D h=
andle-&gt;u.file.data_len =3D 0;</div>

<div>+ =A0 =A0 =A0handle-&gt;u.file.data =3D NULL;</div></div><div>+ =A0 =
=A0}</div><div>+ =A0}</div><div>=A0}</div></div><div><br></div><div>Just my=
 point about the problem.</div>
<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>
<br></blockquote></div><br>hey!!, this solves the problem! At least my seek=
64() calls are working back again!. You should post this patch so it can be=
 included in the git repo.<br>Nice work!, and thanks!!<br><br>Ezequiel<br>

--001636c925756221ab04ab42dc77--

--===============0884956205==
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

--===============0884956205==--

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 25 10:09:09 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7P88hI7006204;
	Thu, 25 Aug 2011 10:09:05 +0200
Received: from mail-pz0-f43.google.com (mail-pz0-f43.google.com
	[209.85.210.43])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7P88eTx006093
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 25 Aug 2011 10:08:41 +0200
Received: by pzk1 with SMTP id 1so3110117pzk.30
	for <libssh2-devel@cool.haxx.se>; Thu, 25 Aug 2011 01:08:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
	bh=Y0hgW7KSX8+I5H6NEwaVR7QtxOXSLddRbiRsOf0ijN0=;
	b=khL8gXPiFgelffHWBdIj6gpw5+rSZkDmyzvR687LknQGI+dC+pnE0kg44UAA/58dkO
	sc1HS9tobtDv8Zzkma3d5bMEE13H1TO45NCCVWYa+lo4msrcJawaT+bHip0rZBQeTMTN
	RfLAZtW2Wfzz0FanN63ksm8H2QOmorbqNxCP0=
Received: by 10.143.92.4 with SMTP id u4mr350317wfl.394.1314259716902;
	Thu, 25 Aug 2011 01:08:36 -0700 (PDT)
Received: from localhost ([61.175.197.204])
	by mx.google.com with ESMTPS id f20sm277003wfl.9.2011.08.25.01.08.29
	(version=TLSv1/SSLv3 cipher=OTHER);
	Thu, 25 Aug 2011 01:08:35 -0700 (PDT)
From: liuzl <xieepp@gmail.com>
To: libssh2-devel@cool.haxx.se
Subject: [PATCH] sftp_read:adjust the file offset pointer
Date: Thu, 25 Aug 2011 16:08:04 +0800
Message-Id: <1314259684-1896-1-git-send-email-xieepp@gmail.com>
X-Mailer: git-send-email 1.7.4.msysgit.0
In-Reply-To: <1>
References: <1>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 25 Aug 2011 10:09:09 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 25 Aug 2011 10:08:41 +0200 (CEST)
Cc: liuzl <xieepp@gmail.com>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

libssh2_sftp_tell64 now tell the right file offset pointer

Signed-off-by: liuzl <xieepp@gmail.com>
---
 src/sftp.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/sftp.c b/src/sftp.c
index 0acccd0..76ffaaf 100644
--- a/src/sftp.c
+++ b/src/sftp.c
@@ -1098,6 +1098,7 @@ static ssize_t sftp_read(LIBSSH2_SFTP_HANDLE * handle, char *buffer,
 
         total_read += copy;
         filep->data_left -= copy;
+        filep->offset += copy;
 
         if(filep->data_left)
             return total_read;
-- 
1.7.4.msysgit.0

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

From libssh2-devel-bounces@cool.haxx.se  Thu Aug 25 10:33:42 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7P8XZcD019842;
	Thu, 25 Aug 2011 10:33:41 +0200
Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com
	[209.85.220.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7P8XWhE019832
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 25 Aug 2011 10:33:33 +0200
Received: by vxh11 with SMTP id 11so1918312vxh.41
	for <libssh2-devel@cool.haxx.se>; Thu, 25 Aug 2011 01:33:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=akN6wYJQT36zwo96qav4Z20mJRlXmNaW16R2m4Ezj+Y=;
	b=mpW8qas8KNWHut6Y9ztLBuhw741Uw9P6gBfphbXn8JDuy5WSeOZulPitROVK2SIxst
	IIrSlxBw3BK7oATGGiLTUHcBKUbLn+YqqWqszLJhkzTuz95drujlIjv8mi8Ncelkf2+V
	fIoL8pP+P626Ejg2b09aGw9BnW2XZlQ33QYLI=
MIME-Version: 1.0
Received: by 10.52.23.130 with SMTP id m2mr5688346vdf.191.1314261208307; Thu,
	25 Aug 2011 01:33:28 -0700 (PDT)
Received: by 10.220.16.194 with HTTP; Thu, 25 Aug 2011 01:33:28 -0700 (PDT)
In-Reply-To: <CAG0PjLwewrDKxg+k190HKZ+amEdrnrspVJ6KB6iw8MSoDj=1mg@mail.gmail.com>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
	<CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
	<CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
	<CABhJMFJ+wfvaoKg1PtT83Ds-YrW+jPiMRv4o3P76Dhe7wmpc0w@mail.gmail.com>
	<CAG0PjLwewrDKxg+k190HKZ+amEdrnrspVJ6KB6iw8MSoDj=1mg@mail.gmail.com>
Date: Thu, 25 Aug 2011 16:33:28 +0800
Message-ID: <CABhJMFLwZyhRzLzp-WHMiCVyPQGgSJmB2R=d9UjNxqiGeNWcxA@mail.gmail.com>
Subject: Re: libssh2_sftp_seek64 doesn't work
From: m odd <xieepp@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 25 Aug 2011 10:33:42 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 25 Aug 2011 10:33:33 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1587581438=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1587581438==
Content-Type: multipart/alternative; boundary=20cf307814fa76963204ab504888

--20cf307814fa76963204ab504888
Content-Type: text/plain; charset=ISO-8859-1

libssh2_sftp_seek64 should do more work than now, But my code is not very
correct. am i right?

2011/8/25 Ezequiel Ruiz <eruiz@barcelona04.com>

>
> 2011/8/24 m odd <xieepp@gmail.com>
>
>>  LIBSSH2_API void
>>  libssh2_sftp_seek64(LIBSSH2_SFTP_HANDLE *handle, libssh2_uint64_t offset)
>>  {
>> -    if(handle)
>> -        handle->u.file.offset = handle->u.file.offset_sent = offset;
>> +  if(handle) {
>> +    handle->u.file.offset = handle->u.file.offset_sent = offset;
>> +    /* discard the request */
>> +    sftp_packetlist_flush(handle);
>> +
>> +    /* free the left received data */
>> +    if (handle->u.file.data_left) {
>> +      LIBSSH2_FREE(handle->sftp->channel->session, handle->u.file.data);
>> +      handle->u.file.data_left = handle->u.file.data_len = 0;
>> +      handle->u.file.data = NULL;
>> +    }
>> +  }
>>  }
>>
>> Just my point about the problem.
>>
>> _______________________________________________
>> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>>
>>
> hey!!, this solves the problem! At least my seek64() calls are working back
> again!. You should post this patch so it can be included in the git repo.
> Nice work!, and thanks!!
>
> Ezequiel
>
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>
>

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

libssh2_sftp_seek64 should do more work than now, But my code is not very c=
orrect. am i right?<br><br><div class=3D"gmail_quote">2011/8/25 Ezequiel Ru=
iz <span dir=3D"ltr">&lt;<a href=3D"mailto:eruiz@barcelona04.com">eruiz@bar=
celona04.com</a>&gt;</span><br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;"><br><div class=3D"gmail_quote"><div class=
=3D"im">2011/8/24 m odd <span dir=3D"ltr">&lt;<a href=3D"mailto:xieepp@gmai=
l.com" target=3D"_blank">xieepp@gmail.com</a>&gt;</span><br>
</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-l=
eft:1px #ccc solid;padding-left:1ex"><div><div></div><div class=3D"h5">
<div>=A0LIBSSH2_API void</div><div><div><div>=A0libssh2_sftp_seek64(LIBSSH2=
_SFTP_HANDLE *handle, libssh2_uint64_t offset)</div><div>=A0{</div><div>- =
=A0 =A0if(handle)</div><div>- =A0 =A0 =A0 =A0handle-&gt;u.file.offset =3D h=
andle-&gt;u.file.offset_sent =3D offset;</div>


</div><div>+ =A0if(handle) {</div><div><div>+ =A0 =A0handle-&gt;u.file.offs=
et =3D handle-&gt;u.file.offset_sent =3D offset;</div></div><div>+ =A0 =A0/=
* discard the request */</div><div>+ =A0 =A0sftp_packetlist_flush(handle);=
=A0</div>
<div>+</div><div>+ =A0 =A0/* free the left received data */</div>
<div>+ =A0 =A0if (handle-&gt;u.file.data_left) {</div><div><div>+ =A0 =A0 =
=A0LIBSSH2_FREE(handle-&gt;sftp-&gt;channel-&gt;session, handle-&gt;u.file.=
data);</div><div>+ =A0 =A0 =A0handle-&gt;u.file.data_left =3D handle-&gt;u.=
file.data_len =3D 0;</div>


<div>+ =A0 =A0 =A0handle-&gt;u.file.data =3D NULL;</div></div><div>+ =A0 =
=A0}</div><div>+ =A0}</div><div>=A0}</div></div><div><br></div><div>Just my=
 point about the problem.</div>
<br></div></div><div class=3D"im">_________________________________________=
______<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>
<br></div></blockquote></div><br>hey!!, this solves the problem! At least m=
y seek64() calls are working back again!. You should post this patch so it =
can be included in the git repo.<br>Nice work!, and thanks!!<br><font color=
=3D"#888888"><br>
Ezequiel<br>
</font><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>
<br></blockquote></div><br>

--20cf307814fa76963204ab504888--

--===============1587581438==
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

--===============1587581438==--

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 08:48:08 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7Q6lbOw003772;
	Fri, 26 Aug 2011 08:48:02 +0200
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 p7Q6lKwv003714
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 08:47:20 +0200
Date: Fri, 26 Aug 2011 08:47:20 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: a problem when downloading sftp
Message-ID: <alpine.DEB.2.00.1108260839240.23869@tvnag.unkk.fr>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED;
	BOUNDARY="1129329158-1637193489-1314341240=:23869"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 08:48:08 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 26 Aug 2011 08:47:21 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-1637193489-1314341240=:23869
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII

Hi friends,

I got a bug report regarding curl and SFTP download yesterday, and while 
tracking it I wrote this libssh2-using app that closer mimics how curl uses 
libssh2 - see attachment. It is similar to sftp_nonblock.c but not identical.

It turns out this code very frequently fails for me, indicating a problem in 
the sftp_read() function. I'm working on it, but I thought I'd let you in on 
it...

I'm downloading a 700K text file from localhost for my test and it fails in 
more than 50% of the cases. The sympthom of the failure is that not the entire 
file is transferred. A few K of the end is never read by the application.

There seems to be a problem when we pass in a smallish buffer size to get the 
final data chunks (the size should be exact the amount that is left to get if 
things work). If I modify the code to always ask for 16K in every read (which 
is what the sftp_nonblock.c example does) it works just fine!

-- 

  / daniel.haxx.se
--1129329158-1637193489-1314341240=:23869
Content-Type: TEXT/x-csrc; name=sftp-bug.c
Content-Transfer-Encoding: BASE64
Content-ID: <alpine.DEB.2.00.1108260847200.23869@tvnag.unkk.fr>
Content-Description: 
Content-Disposition: attachment; filename=sftp-bug.c

LyoNCiAqICRJZDogc2Z0cF9ub25ibG9jay5jLHYgMS4xOCAyMDA5LzA0LzI4
IDEwOjM1OjMwIGJhZ2RlciBFeHAgJA0KICoNCiAqIFNhbXBsZSBzaG93aW5n
IGhvdyB0byBkbyBTRlRQIG5vbi1ibG9ja2luZyB0cmFuc2ZlcnMuDQogKg0K
ICogVGhlIHNhbXBsZSBjb2RlIGhhcyBkZWZhdWx0IHZhbHVlcyBmb3IgaG9z
dCBuYW1lLCB1c2VyIG5hbWUsIHBhc3N3b3JkDQogKiBhbmQgcGF0aCB0byBj
b3B5LCBidXQgeW91IGNhbiBzcGVjaWZ5IHRoZW0gb24gdGhlIGNvbW1hbmQg
bGluZSBsaWtlOg0KICoNCiAqICJzZnRwX25vbmJsb2NrIDE5Mi4xNjguMC4x
IHVzZXIgcGFzc3dvcmQgL3RtcC9zZWNyZXRzIg0KICovDQoNCiNpbmNsdWRl
ICJsaWJzc2gyX2NvbmZpZy5oIg0KI2luY2x1ZGUgPGxpYnNzaDIuaD4NCiNp
bmNsdWRlIDxsaWJzc2gyX3NmdHAuaD4NCg0KI2lmZGVmIEhBVkVfV0lOU09D
SzJfSA0KIyBpbmNsdWRlIDx3aW5zb2NrMi5oPg0KI2VuZGlmDQojaWZkZWYg
SEFWRV9TWVNfU09DS0VUX0gNCiMgaW5jbHVkZSA8c3lzL3NvY2tldC5oPg0K
I2VuZGlmDQojaWZkZWYgSEFWRV9ORVRJTkVUX0lOX0gNCiMgaW5jbHVkZSA8
bmV0aW5ldC9pbi5oPg0KI2VuZGlmDQojaWZkZWYgSEFWRV9TWVNfU0VMRUNU
X0gNCiMgaW5jbHVkZSA8c3lzL3NlbGVjdC5oPg0KI2VuZGlmDQojIGlmZGVm
IEhBVkVfVU5JU1REX0gNCiNpbmNsdWRlIDx1bmlzdGQuaD4NCiNlbmRpZg0K
I2lmZGVmIEhBVkVfQVJQQV9JTkVUX0gNCiMgaW5jbHVkZSA8YXJwYS9pbmV0
Lmg+DQojZW5kaWYNCiNpZmRlZiBIQVZFX1NZU19USU1FX0gNCiMgaW5jbHVk
ZSA8c3lzL3RpbWUuaD4NCiNlbmRpZg0KDQojaW5jbHVkZSA8c3lzL3R5cGVz
Lmg+DQojaW5jbHVkZSA8ZmNudGwuaD4NCiNpbmNsdWRlIDxlcnJuby5oPg0K
I2luY2x1ZGUgPHN0ZGlvLmg+DQojaW5jbHVkZSA8Y3R5cGUuaD4NCg0KLyog
ZGlmZiBpbiBtcyAqLw0Kc3RhdGljIGxvbmcgdHZkaWZmKHN0cnVjdCB0aW1l
dmFsIG5ld2VyLCBzdHJ1Y3QgdGltZXZhbCBvbGRlcikNCnsNCiAgcmV0dXJu
IChuZXdlci50dl9zZWMtb2xkZXIudHZfc2VjKSoxMDAwKw0KICAgICAgKG5l
d2VyLnR2X3VzZWMtb2xkZXIudHZfdXNlYykvMTAwMDsNCn0NCg0Kc3RhdGlj
IGludCB3YWl0c29ja2V0KGludCBzb2NrZXRfZmQsIExJQlNTSDJfU0VTU0lP
TiAqc2Vzc2lvbikNCnsNCiAgICBzdHJ1Y3QgdGltZXZhbCB0aW1lb3V0Ow0K
ICAgIGludCByYzsNCiAgICBmZF9zZXQgZmQ7DQogICAgZmRfc2V0ICp3cml0
ZWZkID0gTlVMTDsNCiAgICBmZF9zZXQgKnJlYWRmZCA9IE5VTEw7DQogICAg
aW50IGRpcjsNCg0KICAgIHRpbWVvdXQudHZfc2VjID0gMTA7DQogICAgdGlt
ZW91dC50dl91c2VjID0gMDsNCg0KICAgIEZEX1pFUk8oJmZkKTsNCg0KICAg
IEZEX1NFVChzb2NrZXRfZmQsICZmZCk7DQoNCiAgICAvKiBub3cgbWFrZSBz
dXJlIHdlIHdhaXQgaW4gdGhlIGNvcnJlY3QgZGlyZWN0aW9uICovDQogICAg
ZGlyID0gbGlic3NoMl9zZXNzaW9uX2Jsb2NrX2RpcmVjdGlvbnMoc2Vzc2lv
bik7DQoNCiAgICBpZihkaXIgJiBMSUJTU0gyX1NFU1NJT05fQkxPQ0tfSU5C
T1VORCkNCiAgICAgICAgcmVhZGZkID0gJmZkOw0KDQogICAgaWYoZGlyICYg
TElCU1NIMl9TRVNTSU9OX0JMT0NLX09VVEJPVU5EKQ0KICAgICAgICB3cml0
ZWZkID0gJmZkOw0KDQogICAgcmMgPSBzZWxlY3Qoc29ja2V0X2ZkICsgMSwg
cmVhZGZkLCB3cml0ZWZkLCBOVUxMLCAmdGltZW91dCk7DQoNCiAgICByZXR1
cm4gcmM7DQp9DQoNCmludCBtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10p
DQp7DQogICAgdW5zaWduZWQgbG9uZyBob3N0YWRkcjsNCiAgICBpbnQgc29j
aywgaSwgYXV0aF9wdyA9IDE7DQogICAgc3RydWN0IHNvY2thZGRyX2luIHNp
bjsNCiAgICBjb25zdCBjaGFyICpmaW5nZXJwcmludDsNCiAgICBMSUJTU0gy
X1NFU1NJT04gKnNlc3Npb247DQogICAgY29uc3QgY2hhciAqdXNlcm5hbWU9
InVzZXJuYW1lIjsNCiAgICBjb25zdCBjaGFyICpwYXNzd29yZD0icGFzc3dv
cmQiOw0KICAgIGNvbnN0IGNoYXIgKnNmdHBwYXRoPSIvdG1wL1RFU1QiOw0K
ICAgIHN0cnVjdCB0aW1ldmFsIHN0YXJ0Ow0KICAgIHN0cnVjdCB0aW1ldmFs
IGVuZDsNCiAgICBpbnQgcmM7DQogICAgaW50IHRvdGFsID0gMDsNCiAgICBs
b25nIHRpbWVfbXM7DQogICAgaW50IHNwaW4gPSAwOw0KI2lmIGRlZmluZWQo
SEFWRV9JT0NUTFNPQ0tFVCkNCiAgICBsb25nIGZsYWcgPSAxOw0KI2VuZGlm
DQogICAgTElCU1NIMl9TRlRQICpzZnRwX3Nlc3Npb247DQogICAgTElCU1NI
Ml9TRlRQX0hBTkRMRSAqc2Z0cF9oYW5kbGU7DQogICAgTElCU1NIMl9TRlRQ
X0FUVFJJQlVURVMgc2Z0cHN0YXQ7DQogICAgbGlic3NoMl91aW50NjRfdCBj
b3VudGRvd24gPSAwOw0KDQojaWZkZWYgV0lOMzINCiAgICBXU0FEQVRBIHdz
YWRhdGE7DQoNCiAgICBXU0FTdGFydHVwKE1BS0VXT1JEKDIsMCksICZ3c2Fk
YXRhKTsNCiNlbmRpZg0KDQogICAgaWYgKGFyZ2MgPiAxKSB7DQogICAgICAg
IGhvc3RhZGRyID0gaW5ldF9hZGRyKGFyZ3ZbMV0pOw0KICAgIH0gZWxzZSB7
DQogICAgICAgIGhvc3RhZGRyID0gaHRvbmwoMHg3RjAwMDAwMSk7DQogICAg
fQ0KDQogICAgaWYgKGFyZ2MgPiAyKSB7DQogICAgICAgIHVzZXJuYW1lID0g
YXJndlsyXTsNCiAgICB9DQogICAgaWYgKGFyZ2MgPiAzKSB7DQogICAgICAg
IHBhc3N3b3JkID0gYXJndlszXTsNCiAgICB9DQogICAgaWYgKGFyZ2MgPiA0
KSB7DQogICAgICAgIHNmdHBwYXRoID0gYXJndls0XTsNCiAgICB9DQoNCiAg
ICByYyA9IGxpYnNzaDJfaW5pdCAoMCk7DQogICAgaWYgKHJjICE9IDApIHsN
CiAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAibGlic3NoMiBpbml0aWFsaXph
dGlvbiBmYWlsZWQgKCVkKVxuIiwgcmMpOw0KICAgICAgICByZXR1cm4gMTsN
CiAgICB9DQoNCiAgICAvKg0KICAgICAqIFRoZSBhcHBsaWNhdGlvbiBjb2Rl
IGlzIHJlc3BvbnNpYmxlIGZvciBjcmVhdGluZyB0aGUgc29ja2V0DQogICAg
ICogYW5kIGVzdGFibGlzaGluZyB0aGUgY29ubmVjdGlvbg0KICAgICAqLw0K
ICAgIHNvY2sgPSBzb2NrZXQoQUZfSU5FVCwgU09DS19TVFJFQU0sIDApOw0K
DQogICAgc2luLnNpbl9mYW1pbHkgPSBBRl9JTkVUOw0KICAgIHNpbi5zaW5f
cG9ydCA9IGh0b25zKDIyKTsNCiAgICBzaW4uc2luX2FkZHIuc19hZGRyID0g
aG9zdGFkZHI7DQogICAgaWYgKGNvbm5lY3Qoc29jaywgKHN0cnVjdCBzb2Nr
YWRkciopKCZzaW4pLA0KICAgICAgICAgICAgICAgIHNpemVvZihzdHJ1Y3Qg
c29ja2FkZHJfaW4pKSAhPSAwKSB7DQogICAgICAgIGZwcmludGYoc3RkZXJy
LCAiZmFpbGVkIHRvIGNvbm5lY3QhXG4iKTsNCiAgICAgICAgcmV0dXJuIC0x
Ow0KICAgIH0NCg0KICAgIC8qIENyZWF0ZSBhIHNlc3Npb24gaW5zdGFuY2Ug
Ki8NCiAgICBzZXNzaW9uID0gbGlic3NoMl9zZXNzaW9uX2luaXQoKTsNCiAg
ICBpZiAoIXNlc3Npb24pDQogICAgICAgIHJldHVybiAtMTsNCg0KICAgIC8q
IFNpbmNlIHdlIGhhdmUgc2V0IG5vbi1ibG9ja2luZywgdGVsbCBsaWJzc2gy
IHdlIGFyZSBub24tYmxvY2tpbmcgKi8NCiAgICBsaWJzc2gyX3Nlc3Npb25f
c2V0X2Jsb2NraW5nKHNlc3Npb24sIDApOw0KDQogICAgZ2V0dGltZW9mZGF5
KCZzdGFydCwgTlVMTCk7DQoNCiAgICAvKiAuLi4gc3RhcnQgaXQgdXAuIFRo
aXMgd2lsbCB0cmFkZSB3ZWxjb21lIGJhbm5lcnMsIGV4Y2hhbmdlIGtleXMs
DQogICAgICAgICogYW5kIHNldHVwIGNyeXB0bywgY29tcHJlc3Npb24sIGFu
ZCBNQUMgbGF5ZXJzDQogICAgICAgICovDQogICAgd2hpbGUgKChyYyA9IGxp
YnNzaDJfc2Vzc2lvbl9zdGFydHVwKHNlc3Npb24sIHNvY2spKSA9PQ0KICAg
ICAgICAgICBMSUJTU0gyX0VSUk9SX0VBR0FJTik7DQogICAgaWYgKHJjKSB7
DQogICAgICAgIGZwcmludGYoc3RkZXJyLCAiRmFpbHVyZSBlc3RhYmxpc2hp
bmcgU1NIIHNlc3Npb246ICVkXG4iLCByYyk7DQogICAgICAgIHJldHVybiAt
MTsNCiAgICB9DQoNCiAgICAvKiBBdCB0aGlzIHBvaW50IHdlIGhhdm4ndCB5
ZXQgYXV0aGVudGljYXRlZC4gIFRoZSBmaXJzdCB0aGluZyB0byBkbw0KICAg
ICAgICAqIGlzIGNoZWNrIHRoZSBob3N0a2V5J3MgZmluZ2VycHJpbnQgYWdh
aW5zdCBvdXIga25vd24gaG9zdHMgWW91ciBhcHANCiAgICAgICAgKiBtYXkg
aGF2ZSBpdCBoYXJkIGNvZGVkLCBtYXkgZ28gdG8gYSBmaWxlLCBtYXkgcHJl
c2VudCBpdCB0byB0aGUNCiAgICAgICAgKiB1c2VyLCB0aGF0J3MgeW91ciBj
YWxsDQogICAgICAgICovDQogICAgZmluZ2VycHJpbnQgPSBsaWJzc2gyX2hv
c3RrZXlfaGFzaChzZXNzaW9uLCBMSUJTU0gyX0hPU1RLRVlfSEFTSF9TSEEx
KTsNCiAgICBmcHJpbnRmKHN0ZGVyciwgIkZpbmdlcnByaW50OiAiKTsNCiAg
ICBmb3IoaSA9IDA7IGkgPCAyMDsgaSsrKSB7DQogICAgICAgIGZwcmludGYo
c3RkZXJyLCAiJTAyWCAiLCAodW5zaWduZWQgY2hhcilmaW5nZXJwcmludFtp
XSk7DQogICAgfQ0KICAgIGZwcmludGYoc3RkZXJyLCAiXG4iKTsNCg0KICAg
IGlmIChhdXRoX3B3KSB7DQogICAgICAgIC8qIFdlIGNvdWxkIGF1dGhlbnRp
Y2F0ZSB2aWEgcGFzc3dvcmQgKi8NCiAgICAgICAgd2hpbGUgKChyYyA9IGxp
YnNzaDJfdXNlcmF1dGhfcGFzc3dvcmQoc2Vzc2lvbiwgdXNlcm5hbWUsIHBh
c3N3b3JkKSkNCiAgICAgICAgICAgICAgID09IExJQlNTSDJfRVJST1JfRUFH
QUlOKTsNCiAgICAgICAgaWYgKHJjKSB7DQogICAgICAgICAgICBmcHJpbnRm
KHN0ZGVyciwgIkF1dGhlbnRpY2F0aW9uIGJ5IHBhc3N3b3JkIGZhaWxlZC5c
biIpOw0KICAgICAgICAgICAgZ290byBzaHV0ZG93bjsNCiAgICAgICAgfQ0K
ICAgIH0gZWxzZSB7DQogICAgICAgIC8qIE9yIGJ5IHB1YmxpYyBrZXkgKi8N
CiAgICAgICAgd2hpbGUgKChyYyA9DQogICAgICAgICAgICAgICAgbGlic3No
Ml91c2VyYXV0aF9wdWJsaWNrZXlfZnJvbWZpbGUoc2Vzc2lvbiwgdXNlcm5h
bWUsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIi9ob21lL3VzZXJuYW1lLyINCiAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiLnNzaC9p
ZF9yc2EucHViIiwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAiL2hvbWUvdXNlcm5hbWUvIg0KICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICIuc3NoL2lkX3JzYSIsDQogICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgcGFzc3dvcmQpKSA9PQ0KICAgICAg
ICAgICAgICAgTElCU1NIMl9FUlJPUl9FQUdBSU4pOw0KICAgICAgICBpZiAo
cmMpIHsNCiAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiXHRBdXRoZW50
aWNhdGlvbiBieSBwdWJsaWMga2V5IGZhaWxlZFxuIik7DQogICAgICAgICAg
ICBnb3RvIHNodXRkb3duOw0KICAgICAgICB9DQogICAgfQ0KI2lmIDANCiAg
ICBsaWJzc2gyX3RyYWNlKHNlc3Npb24sIExJQlNTSDJfVFJBQ0VfQ09OTik7
DQojZW5kaWYNCiAgICBmcHJpbnRmKHN0ZGVyciwgImxpYnNzaDJfc2Z0cF9p
bml0KCkhXG4iKTsNCiAgICBkbyB7DQogICAgICAgIHNmdHBfc2Vzc2lvbiA9
IGxpYnNzaDJfc2Z0cF9pbml0KHNlc3Npb24pOw0KDQogICAgICAgIGlmKCFz
ZnRwX3Nlc3Npb24pIHsNCiAgICAgICAgICAgIGlmKGxpYnNzaDJfc2Vzc2lv
bl9sYXN0X2Vycm5vKHNlc3Npb24pID09DQogICAgICAgICAgICAgICBMSUJT
U0gyX0VSUk9SX0VBR0FJTikgew0KICAgICAgICAgICAgICAgIGZwcmludGYo
c3RkZXJyLCAibm9uLWJsb2NraW5nIGluaXRcbiIpOw0KICAgICAgICAgICAg
ICAgIHdhaXRzb2NrZXQoc29jaywgc2Vzc2lvbik7IC8qIG5vdyB3ZSB3YWl0
ICovDQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAg
ICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIlVuYWJsZSB0byBpbml0IFNG
VFAgc2Vzc2lvblxuIik7DQogICAgICAgICAgICAgICAgZ290byBzaHV0ZG93
bjsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfQ0KICAgIH0gd2hpbGUgKCFz
ZnRwX3Nlc3Npb24pOw0KDQogICAgZG8gew0KICAgICAgICByYyA9IGxpYnNz
aDJfc2Z0cF9zdGF0X2V4KHNmdHBfc2Vzc2lvbiwgc2Z0cHBhdGgsDQogICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RybGVuKHNmdHBwYXRo
KSwgTElCU1NIMl9TRlRQX1NUQVQsDQogICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgJnNmdHBzdGF0KTsNCiAgICAgICAgaWYoTElCU1NIMl9F
UlJPUl9FQUdBSU4gPT0gcmMpIHsNCiAgICAgICAgICAgIHdhaXRzb2NrZXQo
c29jaywgc2Vzc2lvbik7IC8qIG5vdyB3ZSB3YWl0ICovDQogICAgICAgICAg
ICBjb250aW51ZTsNCiAgICAgICAgfQ0KICAgICAgICBpZihyYykNCiAgICAg
ICAgICAgIHJldHVybiByYzsNCiAgICAgICAgYnJlYWs7DQogICAgfSB3aGls
ZSgxKTsNCg0KICAgIGZwcmludGYoc3RkZXJyLCAiRklMRSBTSVpFICVsZFxu
IiwgKGxvbmcpc2Z0cHN0YXQuZmlsZXNpemUpOw0KICAgIGNvdW50ZG93biA9
IHNmdHBzdGF0LmZpbGVzaXplOw0KDQogICAgZnByaW50ZihzdGRlcnIsICJs
aWJzc2gyX3NmdHBfb3BlbigpIVxuIik7DQogICAgLyogUmVxdWVzdCBhIGZp
bGUgdmlhIFNGVFAgKi8NCiAgICBkbyB7DQogICAgICAgIHNmdHBfaGFuZGxl
ID0gbGlic3NoMl9zZnRwX29wZW4oc2Z0cF9zZXNzaW9uLCBzZnRwcGF0aCwN
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMSUJT
U0gyX0ZYRl9SRUFELCAwKTsNCg0KICAgICAgICBpZiAoIXNmdHBfaGFuZGxl
KSB7DQogICAgICAgICAgICBpZiAobGlic3NoMl9zZXNzaW9uX2xhc3RfZXJy
bm8oc2Vzc2lvbikgIT0gTElCU1NIMl9FUlJPUl9FQUdBSU4pIHsNCiAgICAg
ICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIlVuYWJsZSB0byBvcGVuIGZp
bGUgd2l0aCBTRlRQXG4iKTsNCiAgICAgICAgICAgICAgICBnb3RvIHNodXRk
b3duOw0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAg
ICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJub24tYmxvY2tpbmcgb3Bl
blxuIik7DQogICAgICAgICAgICAgICAgd2FpdHNvY2tldChzb2NrLCBzZXNz
aW9uKTsgLyogbm93IHdlIHdhaXQgKi8NCiAgICAgICAgICAgIH0NCiAgICAg
ICAgfQ0KICAgIH0gd2hpbGUgKCFzZnRwX2hhbmRsZSk7DQoNCiAgICBmcHJp
bnRmKHN0ZGVyciwgImxpYnNzaDJfc2Z0cF9vcGVuKCkgaXMgZG9uZSwgbm93
IHJlY2VpdmUgZGF0YSFcbiIpOw0KICAgIGRvIHsNCiAgICAgICAgY2hhciBt
ZW1bMTAyNCoxNl07DQogICAgICAgIGludCBhc2tmb3IgPSBzaXplb2YobWVt
KSA+IGNvdW50ZG93biA/IGNvdW50ZG93biA6IHNpemVvZihtZW0pOw0KDQog
ICAgICAgIC8qIGxvb3AgdW50aWwgd2UgZmFpbCAqLw0KICAgICAgICB3aGls
ZSAoKHJjID0gbGlic3NoMl9zZnRwX3JlYWQoc2Z0cF9oYW5kbGUsIG1lbSwg
YXNrZm9yKSkgPT0NCiAgICAgICAgICAgICAgIExJQlNTSDJfRVJST1JfRUFH
QUlOKSB7DQogICAgICAgICAgICBzcGluKys7DQogICAgICAgICAgICB3YWl0
c29ja2V0KHNvY2ssIHNlc3Npb24pOyAvKiBub3cgd2Ugd2FpdCAqLw0KICAg
ICAgICB9DQoNCiAgICAgICAgZnByaW50ZihzdGRlcnIsICJhc2tlZCBmb3Ig
JWQgZ290ICVkIGJ5dGVzICglbGQgbGVmdClcbiIsDQogICAgICAgICAgICAg
ICAgYXNrZm9yLCByYywgKGxvbmcpY291bnRkb3duKTsNCiAgICAgICAgaWYg
KHJjID4gMCkgew0KICAgICAgICAgICAgdG90YWwgKz0gcmM7DQogICAgICAg
ICAgICBjb3VudGRvd24gLT0gcmM7DQogICAgICAgIH0NCiAgICAgICAgZWxz
ZSB7DQogICAgICAgICAgICBicmVhazsNCiAgICAgICAgfQ0KICAgIH0gd2hp
bGUgKDEpOw0KDQogICAgaWYoY291bnRkb3duKQ0KICAgICAgICBmcHJpbnRm
KHN0ZGVyciwgIioqKiogU3RpbGwgJWxkIGJ5dGVzIHRvIGdldCFcbiIsDQog
ICAgICAgICAgICAgICAgKGxvbmcpY291bnRkb3duKTsNCg0KICAgIGdldHRp
bWVvZmRheSgmZW5kLCBOVUxMKTsNCiAgICB0aW1lX21zID0gdHZkaWZmKGVu
ZCwgc3RhcnQpOw0KICAgIHByaW50ZigiR290ICVkIGJ5dGVzIGluICVsZCBt
cyA9ICUuMWYgYnl0ZXMvc2VjIHNwaW46ICVkXG4iLCB0b3RhbCwNCiAgICAg
ICAgICAgdGltZV9tcywgdG90YWwvKHRpbWVfbXMvMTAwMC4wKSwgc3BpbiAp
Ow0KDQogICAgbGlic3NoMl9zZnRwX2Nsb3NlKHNmdHBfaGFuZGxlKTsNCiAg
ICBsaWJzc2gyX3NmdHBfc2h1dGRvd24oc2Z0cF9zZXNzaW9uKTsNCg0Kc2h1
dGRvd246DQoNCiAgICBwcmludGYoImxpYnNzaDJfc2Vzc2lvbl9kaXNjb25u
ZWN0XG4iKTsNCiAgICB3aGlsZSAobGlic3NoMl9zZXNzaW9uX2Rpc2Nvbm5l
Y3Qoc2Vzc2lvbiwNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgIk5vcm1hbCBTaHV0ZG93biwgVGhhbmsgeW91IikgPT0NCiAgICAg
ICAgICAgTElCU1NIMl9FUlJPUl9FQUdBSU4pOw0KICAgIGxpYnNzaDJfc2Vz
c2lvbl9mcmVlKHNlc3Npb24pOw0KDQojaWZkZWYgV0lOMzINCiAgICBjbG9z
ZXNvY2tldChzb2NrKTsNCiNlbHNlDQogICAgY2xvc2Uoc29jayk7DQojZW5k
aWYNCiAgICBmcHJpbnRmKHN0ZGVyciwgImFsbCBkb25lXG4iKTsNCg0KICAg
IGxpYnNzaDJfZXhpdCgpOw0KDQogICAgcmV0dXJuIDA7DQp9DQo=

--1129329158-1637193489-1314341240=:23869
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

--1129329158-1637193489-1314341240=:23869--

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 11:16:09 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7Q9Ft6r027582;
	Fri, 26 Aug 2011 11:16:08 +0200
Received: from mail.bassetglobal.com (mail.basset.se [193.13.246.197])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7Q9FsXu027521
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 11:15:54 +0200
Received: from [10.10.21.41] ([10.10.21.41])
	(authenticated user patrik.thunstrom@bassetglobal.com)
	by mail.bassetglobal.com
	(using TLSv1/SSLv3 with cipher AES256-SHA (256 bits))
	for libssh2-devel@cool.haxx.se; Fri, 26 Aug 2011 11:15:52 +0200
Message-ID: <4E576446.2090001@bassetglobal.com>
Date: Fri, 26 Aug 2011 11:15:50 +0200
From: =?ISO-8859-1?Q?Patrik_Thunstr=F6m?= <patrik.thunstrom@bassetglobal.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:6.0) Gecko/20110812 Thunderbird/6.0
MIME-Version: 1.0
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: a problem when downloading sftp
References: <alpine.DEB.2.00.1108260839240.23869@tvnag.unkk.fr>
In-Reply-To: <alpine.DEB.2.00.1108260839240.23869@tvnag.unkk.fr>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 11:16:09 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 26 Aug 2011 11:15:54 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="iso-8859-1"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p7Q9Ft6r027582

Daniel Stenberg skrev 2011-08-26 08:47:
> It turns out this code very frequently fails for me, indicating a 
> problem in the sftp_read() function. I'm working on it, but I thought 
> I'd let you in on it...
>
> I'm downloading a 700K text file from localhost for my test and it 
> fails in more than 50% of the cases. The sympthom of the failure is 
> that not the entire file is transferred. A few K of the end is never 
> read by the application.
Yup, this seems quite similar to the issues that I reported on the curl 
mailing list in the end of may.
At that time I didn't manage to find the time to write any test case 
which triggered it using libssh2 only, and the main issues which made us 
look for a newer version of libssh2 was already solved in 1.2.7 which 
worked just fine for us.

But, to chime in with my experiences from my testing at that time; the 
sweet spot seems to be slightly above 740kB in our environment (win32 
build running on 64 bit windows 7), at which point we have roughly 50% 
chance of success. Just going up a few kB greatly lowers the rate of 
success, and when you're at 760-770kB I've never even once managed to 
get the file to transfer successfully.

In case you need any help in testing out potential fixes I'll gladly 
help you verify on the windows platform.

Best regards
Patrik Thunström / patrik.thunstrom@bassetglobal.com

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

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 11:59:17 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7Q9wpjN019832;
	Fri, 26 Aug 2011 11:59:14 +0200
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 p7Q9wnpv019805
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 11:58:49 +0200
Date: Fri, 26 Aug 2011 11:58:49 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: a problem when downloading sftp
In-Reply-To: <4E576446.2090001@bassetglobal.com>
Message-ID: <alpine.DEB.2.00.1108261157110.23869@tvnag.unkk.fr>
References: <alpine.DEB.2.00.1108260839240.23869@tvnag.unkk.fr>
	<4E576446.2090001@bassetglobal.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED;
	BOUNDARY="1129329158-930367158-1314352729=:23869"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 11:59:17 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 26 Aug 2011 11:58:49 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-930367158-1314352729=:23869
Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8BIT

On Fri, 26 Aug 2011, Patrik Thunström wrote:

> In case you need any help in testing out potential fixes I'll gladly help 
> you verify on the windows platform.

Thanks. I seem to have fixed the issue for my test case with commit 
900c90ccbe9. See:

http://git.libssh2.org/?p=libssh2.git;a=commitdiff;h=900c90ccbe9;js=1

Yes. A single lonely little line... =)

-- 

  / daniel.haxx.se
--1129329158-930367158-1314352729=:23869
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

--1129329158-930367158-1314352729=:23869--

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 12:26:01 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QAPovS008045;
	Fri, 26 Aug 2011 12:26:00 +0200
Received: from puck.spacetec.no (puck.spacetec.no [192.51.5.29])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with SMTP id p7QAPmIN008038
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 12:25:49 +0200
Received: (qmail 16101 invoked from network); 26 Aug 2011 10:25:51 -0000
Received: from mail-bw0-f54.google.com (tor@209.85.214.54)
	by puck.spacetec.no with ESMTPA; 26 Aug 2011 10:25:51 -0000
Received: by bkat8 with SMTP id t8so3217264bka.41
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 03:25:50 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.204.130.138 with SMTP id t10mr500941bks.10.1314354350071; Fri,
	26 Aug 2011 03:25:50 -0700 (PDT)
Received: by 10.204.145.67 with HTTP; Fri, 26 Aug 2011 03:25:50 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108261157110.23869@tvnag.unkk.fr>
References: <alpine.DEB.2.00.1108260839240.23869@tvnag.unkk.fr>
	<4E576446.2090001@bassetglobal.com>
	<alpine.DEB.2.00.1108261157110.23869@tvnag.unkk.fr>
Date: Fri, 26 Aug 2011 12:25:50 +0200
Message-ID: <CAL1Jhhwx6ukG1O_xVkpf3N2HtMOLJCgKEZ+pFjyWJRxsUqsWBQ@mail.gmail.com>
Subject: Re: a problem when downloading sftp
From: Tor Arntsen <tor@spacetec.no>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 12:26:01 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 26 Aug 2011 12:25:49 +0200 (CEST)
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id
	p7QAPmIN008038
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="iso-8859-1"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p7QAPovS008045

On Fri, Aug 26, 2011 at 11:58, Daniel Stenberg <daniel@haxx.se> wrote:
> On Fri, 26 Aug 2011, Patrik Thunström wrote:
>
>> In case you need any help in testing out potential fixes I'll gladly help
>> you verify on the windows platform.
>
> Thanks. I seem to have fixed the issue for my test case with commit
> 900c90ccbe9. See:
>
> http://git.libssh2.org/?p=libssh2.git;a=commitdiff;h=900c90ccbe9;js=1
>
> Yes. A single lonely little line... =)

Didn't I see that line in a patch posted by someone very recently? It
looks familiar. Maybe somebody else ran into the same issue?

-Tor

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

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 13:14:05 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QBDqJt003211;
	Fri, 26 Aug 2011 13:14:02 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QBDoF3003195
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 13:13:50 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7QBDp44021909
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 11:13:53 GMT
Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged))
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7QBDkDS027835
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 13:13:46 +0200
Subject: Re: a problem when downloading sftp
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Fri, 26 Aug 2011 13:13:46 +0200
In-Reply-To: <CAL1Jhhwx6ukG1O_xVkpf3N2HtMOLJCgKEZ+pFjyWJRxsUqsWBQ@mail.gmail.com>
References: <alpine.DEB.2.00.1108260839240.23869@tvnag.unkk.fr>
	<4E576446.2090001@bassetglobal.com>
	<alpine.DEB.2.00.1108261157110.23869@tvnag.unkk.fr>
	<CAL1Jhhwx6ukG1O_xVkpf3N2HtMOLJCgKEZ+pFjyWJRxsUqsWBQ@mail.gmail.com>
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Message-ID: <1314357226.27581.5.camel@henriknordstrom.net>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 13:14:05 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Fri, 26 Aug 2011 13:13:50 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Fri, 26 Aug 2011 11:13:53 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p7QBDqJt003211

fre 2011-08-26 klockan 12:25 +0200 skrev Tor Arntsen:
> On Fri, Aug 26, 2011 at 11:58, Daniel Stenberg <daniel@haxx.se> wrote:
> > On Fri, 26 Aug 2011, Patrik ThunstrÃ¶m wrote:
> >
> >> In case you need any help in testing out potential fixes I'll gladly help
> >> you verify on the windows platform.
> >
> > Thanks. I seem to have fixed the issue for my test case with commit
> > 900c90ccbe9. See:
> >
> > http://git.libssh2.org/?p=libssh2.git;a=commitdiff;h=900c90ccbe9;js=1
> >
> > Yes. A single lonely little line... =)
> 
> Didn't I see that line in a patch posted by someone very recently? It
> looks familiar. Maybe somebody else ran into the same issue?

Yes, it's the exact same change "m odd/liuzl" submitted a couple days
ago.

Regards
Henrik

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

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 13:31:49 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QBVZEV014622;
	Fri, 26 Aug 2011 13:31:48 +0200
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 p7QBVYUM014607
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 13:31:34 +0200
Date: Fri, 26 Aug 2011 13:31:34 +0200 (CEST)
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_seek64 doesn't work
In-Reply-To: <CABhJMFLwZyhRzLzp-WHMiCVyPQGgSJmB2R=d9UjNxqiGeNWcxA@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108261326580.23869@tvnag.unkk.fr>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
	<CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
	<CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
	<CABhJMFJ+wfvaoKg1PtT83Ds-YrW+jPiMRv4o3P76Dhe7wmpc0w@mail.gmail.com>
	<CAG0PjLwewrDKxg+k190HKZ+amEdrnrspVJ6KB6iw8MSoDj=1mg@mail.gmail.com>
	<CABhJMFLwZyhRzLzp-WHMiCVyPQGgSJmB2R=d9UjNxqiGeNWcxA@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 13:31:49 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 26 Aug 2011 13:31:34 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Thu, 25 Aug 2011, m odd wrote:

> libssh2_sftp_seek64 should do more work than now, But my code is not very 
> correct. am i right?

I believe your code does the right thing and I intend to merge it. Thanks a 
lot!

When it flushes the packetlist, there's a risk that there are pending packets 
about to arrive for which the corresponding requests now get removed, but 
that's not a problem but will only cause some surplus packets to linger around 
in the sftp session handle until killed. There's possibly a way to optimize 
for how long they linger and when they can be garbage collected.

I think there's also room for improving how to seek forwards that could avoid 
discarding all data already read, but that's "just" optimizing.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 14:03:24 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QC3GaG001209;
	Fri, 26 Aug 2011 14:03:23 +0200
Received: from mail.bassetglobal.com (mail.basset.se [193.13.246.197])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QC3FlK001064
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 14:03:15 +0200
Received: from [10.10.21.41] ([10.10.21.41])
	(authenticated user patrik.thunstrom@bassetglobal.com)
	by mail.bassetglobal.com
	(using TLSv1/SSLv3 with cipher AES256-SHA (256 bits))
	for libssh2-devel@cool.haxx.se; Fri, 26 Aug 2011 14:03:12 +0200
Message-ID: <4E578B7F.2040102@bassetglobal.com>
Date: Fri, 26 Aug 2011 14:03:11 +0200
From: =?ISO-8859-1?Q?Patrik_Thunstr=F6m?= <patrik.thunstrom@bassetglobal.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:6.0) Gecko/20110812 Thunderbird/6.0
MIME-Version: 1.0
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: a problem when downloading sftp
References: <alpine.DEB.2.00.1108260839240.23869@tvnag.unkk.fr>
	<4E576446.2090001@bassetglobal.com>
	<alpine.DEB.2.00.1108261157110.23869@tvnag.unkk.fr>
In-Reply-To: <alpine.DEB.2.00.1108261157110.23869@tvnag.unkk.fr>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 14:03:24 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 26 Aug 2011 14:03:15 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="iso-8859-1"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p7QC3GaG001209

Daniel Stenberg skrev 2011-08-26 11:58:
> Thanks. I seem to have fixed the issue for my test case with commit 
> 900c90ccbe9. See:
>
> http://git.libssh2.org/?p=libssh2.git;a=commitdiff;h=900c90ccbe9;js=1
>
> Yes. A single lonely little line... =)
As I reported on the curl mailing list, I gave this fix a swing with 
libssh2 1.2.8 (as I had that lying around, ready to be tested) and it 
solved the issues nicely!

Thumbs up!

Best regards
Patrik Thunström / patrik.thunstrom@bassetglobal.com

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

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 14:56:15 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QCu0pA001610;
	Fri, 26 Aug 2011 14:56:14 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QCtxd7001607
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 14:55:59 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7QCu0Jb020152
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 12:56:02 GMT
Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged))
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7QCtw1S029553
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 14:55:58 +0200
Subject: Re: libssh2_sftp_seek64 doesn't work
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Fri, 26 Aug 2011 14:55:58 +0200
In-Reply-To: <CABhJMFLwZyhRzLzp-WHMiCVyPQGgSJmB2R=d9UjNxqiGeNWcxA@mail.gmail.com>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
	<CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
	<CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
	<CABhJMFJ+wfvaoKg1PtT83Ds-YrW+jPiMRv4o3P76Dhe7wmpc0w@mail.gmail.com>
	<CAG0PjLwewrDKxg+k190HKZ+amEdrnrspVJ6KB6iw8MSoDj=1mg@mail.gmail.com>
	<CABhJMFLwZyhRzLzp-WHMiCVyPQGgSJmB2R=d9UjNxqiGeNWcxA@mail.gmail.com>
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Message-ID: <1314363358.27581.10.camel@henriknordstrom.net>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 14:56:15 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Fri, 26 Aug 2011 14:55:59 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Fri, 26 Aug 2011 12:56:03 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

tor 2011-08-25 klockan 16:33 +0800 skrev m odd:
> libssh2_sftp_seek64 should do more work than now, But my code is not
> very correct. am i right?

It looks reasonable, but sftp_packetlist_flush() looks dangerous to me
(actually in general, not specific to your change). What if it's in the
middle of sending a request?

Another possible issue is response packets arriving after the flush. If
I am not mistaken these will accumulate in the brigade and not get
freed.

Regards
Henrik

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

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 15:26:11 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QDPw0A022990;
	Fri, 26 Aug 2011 15:26:08 +0200
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 p7QDPu5R022970
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 15:25:56 +0200
Date: Fri, 26 Aug 2011 15:25:56 +0200 (CEST)
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_seek64 doesn't work
In-Reply-To: <1314363358.27581.10.camel@henriknordstrom.net>
Message-ID: <alpine.DEB.2.00.1108261518060.23869@tvnag.unkk.fr>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
	<CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
	<CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
	<CABhJMFJ+wfvaoKg1PtT83Ds-YrW+jPiMRv4o3P76Dhe7wmpc0w@mail.gmail.com>
	<CAG0PjLwewrDKxg+k190HKZ+amEdrnrspVJ6KB6iw8MSoDj=1mg@mail.gmail.com>
	<CABhJMFLwZyhRzLzp-WHMiCVyPQGgSJmB2R=d9UjNxqiGeNWcxA@mail.gmail.com>
	<1314363358.27581.10.camel@henriknordstrom.net>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="1129329158-31695388-1314365156=:23869"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 15:26:11 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 26 Aug 2011 15:25:56 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1129329158-31695388-1314365156=:23869
Content-Type: TEXT/PLAIN; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8BIT

On Fri, 26 Aug 2011, Henrik Nordström wrote:

> It looks reasonable, but sftp_packetlist_flush() looks dangerous to me 
> (actually in general, not specific to your change). What if it's in the 
> middle of sending a request?

The only way seek64() would call sftp_packetlist_flush() while being in a 
middle of a request would be if the immediate call to sftp_read() returned 
EAGAIN.

In general our API is designed to assume that you will call the same function 
again after an EAGAIN has been called. To change that rule, we'll have to add 
more logic to prevent that another packet gets sent if previously an 
incomplete packet was sent.

> Another possible issue is response packets arriving after the flush. If I am 
> not mistaken these will accumulate in the brigade and not get freed.

Right, that's what I tried to explain. They will arrive and just get kept 
until the sftp handle is freed. If you do a lot of seeks that may become a 
problem and we should probably think of ways to improve that handling.

-- 

  / daniel.haxx.se
--1129329158-31695388-1314365156=:23869
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

--1129329158-31695388-1314365156=:23869--

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 15:46:00 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QDjoVB002315;
	Fri, 26 Aug 2011 15:45:59 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QDjnuh002304
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 15:45:49 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7QDjgG3017428
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 13:45:43 GMT
Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged))
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7QDjfiv030610
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 15:45:41 +0200
Subject: Re: libssh2_sftp_seek64 doesn't work
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Fri, 26 Aug 2011 15:45:41 +0200
In-Reply-To: <alpine.DEB.2.00.1108261518060.23869@tvnag.unkk.fr>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
	<CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
	<CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
	<CABhJMFJ+wfvaoKg1PtT83Ds-YrW+jPiMRv4o3P76Dhe7wmpc0w@mail.gmail.com>
	<CAG0PjLwewrDKxg+k190HKZ+amEdrnrspVJ6KB6iw8MSoDj=1mg@mail.gmail.com>
	<CABhJMFLwZyhRzLzp-WHMiCVyPQGgSJmB2R=d9UjNxqiGeNWcxA@mail.gmail.com>
	<1314363358.27581.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108261518060.23869@tvnag.unkk.fr>
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Message-ID: <1314366341.27581.27.camel@henriknordstrom.net>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 15:46:00 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Fri, 26 Aug 2011 15:45:49 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Fri, 26 Aug 2011 13:45:43 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

fre 2011-08-26 klockan 15:25 +0200 skrev Daniel Stenberg:

> The only way seek64() would call sftp_packetlist_flush() while being in a 
> middle of a request would be if the immediate call to sftp_read() returned 
> EAGAIN.

EAGAIN is masked in sftp_read if there is data received.

Regards
Henrik

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

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 16:17:20 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QEH4FM017747;
	Fri, 26 Aug 2011 16:17:18 +0200
Received: from baza.doc.ic.ac.uk (baza.doc.ic.ac.uk [146.169.1.193])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QEH2bN017651
	(version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 16:17:02 +0200
Received: from mail-qw0-f54.google.com ([209.85.216.54])
	by baza.doc.ic.ac.uk with esmtpsa (TLS-1.0:RSA_ARCFOUR_SHA1:16)
	(Exim 4.69) (envelope-from <awl03@doc.ic.ac.uk>) id 1QwxDH-0002SE-AC
	for libssh2-devel@cool.haxx.se; Fri, 26 Aug 2011 15:16:51 +0100
Received: by qwc9 with SMTP id 9so2506901qwc.41
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 07:16:49 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.229.65.85 with SMTP id h21mr1601224qci.46.1314368209902; Fri,
	26 Aug 2011 07:16:49 -0700 (PDT)
Received: by 10.229.219.7 with HTTP; Fri, 26 Aug 2011 07:16:49 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108261518060.23869@tvnag.unkk.fr>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
	<CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
	<CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
	<CABhJMFJ+wfvaoKg1PtT83Ds-YrW+jPiMRv4o3P76Dhe7wmpc0w@mail.gmail.com>
	<CAG0PjLwewrDKxg+k190HKZ+amEdrnrspVJ6KB6iw8MSoDj=1mg@mail.gmail.com>
	<CABhJMFLwZyhRzLzp-WHMiCVyPQGgSJmB2R=d9UjNxqiGeNWcxA@mail.gmail.com>
	<1314363358.27581.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108261518060.23869@tvnag.unkk.fr>
Date: Fri, 26 Aug 2011 15:16:49 +0100
Message-ID: <CADyPeTPc-7Lyd0TFPL9bzrO9Mk+q=2r2PN0ay5W-0j4P_ad1Dg@mail.gmail.com>
Subject: Re: libssh2_sftp_seek64 doesn't work
From: Alexander Lamaison <awl03@doc.ic.ac.uk>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-ICDoC-Trusted: YES
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 16:17:20 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 26 Aug 2011 16:17:02 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1954195343=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1954195343==
Content-Type: multipart/alternative; boundary=0016e64e920e415cdb04ab6932c2

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

On Friday, August 26, 2011, Daniel Stenberg <daniel@haxx.se> wrote:
> On Fri, 26 Aug 2011, Henrik Nordstr=F6m wrote:
>
>> It looks reasonable, but sftp_packetlist_flush() looks dangerous to me
(actually in general, not specific to your change). What if it's in the
middle of sending a request?
>
> The only way seek64() would call sftp_packetlist_flush() while being in a
middle of a request would be if the immediate call to sftp_read() returned
EAGAIN.
>
> In general our API is designed to assume that you will call the same
function again after an EAGAIN has been called. To change that rule, we'll
have to add more logic to prevent that another packet gets sent if
previously an incomplete packet was sent.

What about aborting an in-progress operation? How would you do this using
the libssh2 API? Up till now I've only been using libssh2 in blocking mode
but, in the near future, I was hoping to use it non-blocking to improve
user-interaction. My aim was to put the user always in control such that if
something takes too long and they get impatient they cab simply abort the
current operation. I imagined that I would do this by setting a flag and
then simply not continue the loop on the next EAGAIN. Would this be a bad
way to do it?

Alex

--
Swish: Easy SFTP for Windows Explorer (http://www.swish-sftp.org)

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

On Friday, August 26, 2011, Daniel Stenberg &lt;<a href=3D"mailto:daniel@ha=
xx.se">daniel@haxx.se</a>&gt; wrote:<br>&gt; On Fri, 26 Aug 2011, Henrik No=
rdstr=F6m wrote:<br>&gt;<br>&gt;&gt; It looks reasonable, but sftp_packetli=
st_flush() looks dangerous to me (actually in general, not specific to your=
 change). What if it&#39;s in the middle of sending a request?<br>
&gt;<br>&gt; The only way seek64() would call sftp_packetlist_flush() while=
 being in a middle of a request would be if the immediate call to sftp_read=
() returned EAGAIN.<br>&gt;<br>&gt; In general our API is designed to assum=
e that you will call the same function again after an EAGAIN has been calle=
d. To change that rule, we&#39;ll have to add more logic to prevent that an=
other packet gets sent if previously an incomplete packet was sent.<br>
<br>What about aborting an in-progress operation? How would you do this usi=
ng the libssh2 API? Up till now I&#39;ve only been using libssh2 in blockin=
g mode but, in the near future, I was hoping to use it non-blocking to impr=
ove user-interaction. My aim was to put the user always in control such tha=
t if something takes too long and they get impatient they cab simply abort =
the current operation. I imagined that I would do this by setting a flag an=
d then simply not continue the loop on the next EAGAIN. Would this be a bad=
 way to do it?<br>
<br>Alex<br><br>--<br>Swish: Easy SFTP for Windows Explorer (<a href=3D"htt=
p://www.swish-sftp.org">http://www.swish-sftp.org</a>)

--0016e64e920e415cdb04ab6932c2--

--===============1954195343==
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

--===============1954195343==--

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 16:43:11 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QEh2kd002817;
	Fri, 26 Aug 2011 16:43:11 +0200
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 p7QEh1jD002741
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 16:43:01 +0200
Date: Fri, 26 Aug 2011 16:43:01 +0200 (CEST)
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_seek64 doesn't work
In-Reply-To: <CADyPeTPc-7Lyd0TFPL9bzrO9Mk+q=2r2PN0ay5W-0j4P_ad1Dg@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108261640400.32130@tvnag.unkk.fr>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
	<CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
	<CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
	<CABhJMFJ+wfvaoKg1PtT83Ds-YrW+jPiMRv4o3P76Dhe7wmpc0w@mail.gmail.com>
	<CAG0PjLwewrDKxg+k190HKZ+amEdrnrspVJ6KB6iw8MSoDj=1mg@mail.gmail.com>
	<CABhJMFLwZyhRzLzp-WHMiCVyPQGgSJmB2R=d9UjNxqiGeNWcxA@mail.gmail.com>
	<1314363358.27581.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108261518060.23869@tvnag.unkk.fr>
	<CADyPeTPc-7Lyd0TFPL9bzrO9Mk+q=2r2PN0ay5W-0j4P_ad1Dg@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 16:43:11 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 26 Aug 2011 16:43:01 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Fri, 26 Aug 2011, Alexander Lamaison wrote:

>> In general our API is designed to assume that you will call the same
>> function again after an EAGAIN has been called.
>
> What about aborting an in-progress operation? How would you do this using 
> the libssh2 API? Up till now I've only been using libssh2 in blocking mode 
> but, in the near future, I was hoping to use it non-blocking to improve 
> user-interaction. My aim was to put the user always in control such that if 
> something takes too long and they get impatient they cab simply abort the 
> current operation. I imagined that I would do this by setting a flag and 
> then simply not continue the loop on the next EAGAIN. Would this be a bad 
> way to do it?

Well, I would like that to work but I think that there are situations right 
now that will not work like that.

We should work on fixing things so that we never send broken packets, even if 
EAGAIN is returned and another function is called afterwards.

But then there's a lot of things we can work on! =)

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 17:37:06 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QFaogq030569;
	Fri, 26 Aug 2011 17:37:05 +0200
Received: from cardinal.doc.ic.ac.uk (cardinal.doc.ic.ac.uk [146.169.1.194])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QFam6l030558
	(version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 17:36:48 +0200
Received: from mail-qw0-f54.google.com ([209.85.216.54])
	by cardinal.doc.ic.ac.uk with esmtpsa (TLS-1.0:RSA_ARCFOUR_SHA1:16)
	(Exim 4.69) (envelope-from <awl03@doc.ic.ac.uk>) id 1QwySd-0006Fh-AN
	for libssh2-devel@cool.haxx.se; Fri, 26 Aug 2011 16:36:47 +0100
Received: by qwc9 with SMTP id 9so2593365qwc.41
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 08:36:43 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.229.19.66 with SMTP id z2mr1631031qca.160.1314373003717; Fri,
	26 Aug 2011 08:36:43 -0700 (PDT)
Received: by 10.229.219.7 with HTTP; Fri, 26 Aug 2011 08:36:43 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108261640400.32130@tvnag.unkk.fr>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
	<CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
	<CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
	<CABhJMFJ+wfvaoKg1PtT83Ds-YrW+jPiMRv4o3P76Dhe7wmpc0w@mail.gmail.com>
	<CAG0PjLwewrDKxg+k190HKZ+amEdrnrspVJ6KB6iw8MSoDj=1mg@mail.gmail.com>
	<CABhJMFLwZyhRzLzp-WHMiCVyPQGgSJmB2R=d9UjNxqiGeNWcxA@mail.gmail.com>
	<1314363358.27581.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108261518060.23869@tvnag.unkk.fr>
	<CADyPeTPc-7Lyd0TFPL9bzrO9Mk+q=2r2PN0ay5W-0j4P_ad1Dg@mail.gmail.com>
	<alpine.DEB.2.00.1108261640400.32130@tvnag.unkk.fr>
Date: Fri, 26 Aug 2011 16:36:43 +0100
Message-ID: <CADyPeTNCUbdZrrwNeEFQ+q-=6v=hUsJRLNt8i9j3Hup6MuJh2g@mail.gmail.com>
Subject: Re: libssh2_sftp_seek64 doesn't work
From: Alexander Lamaison <awl03@doc.ic.ac.uk>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-ICDoC-Trusted: YES
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 17:37:06 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 26 Aug 2011 17:36:48 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============0971846662=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0971846662==
Content-Type: multipart/alternative; boundary=0016e64f44f2fd2e2004ab6a4f4d

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

On Friday, August 26, 2011, Daniel Stenberg <daniel@haxx.se> wrote:
> On Fri, 26 Aug 2011, Alexander Lamaison wrote:
>
>>> In general our API is designed to assume that you will call the same
>>> function again after an EAGAIN has been called.
>>
>> What about aborting an in-progress operation? How would you do this using
the libssh2 API? Up till now I've only been using libssh2 in blocking mode
but, in the near future, I was hoping to use it non-blocking to improve
user-interaction. My aim was to put the user always in control such that if
something takes too long and they get impatient they cab simply abort the
current operation. I imagined that I would do this by setting a flag and
then simply not continue the loop on the next EAGAIN. Would this be a bad
way to do it?
>
> Well, I would like that to work but I think that there are situations
right now that will not work like that.
>
> We should work on fixing things so that we never send broken packets, even
if EAGAIN is returned and another function is called afterwards.

Out of interest, what are people using the non-blocking mode for now if this
doesn't work? Only for progress display?

> But then there's a lot of things we can work on! =)

Don't I know it. I have a long list of changes I want to make and no time to
do them :(

Alex

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

On Friday, August 26, 2011, Daniel Stenberg &lt;<a href=3D"mailto:daniel@ha=
xx.se">daniel@haxx.se</a>&gt; wrote:<br>&gt; On Fri, 26 Aug 2011, Alexander=
 Lamaison wrote:<br>&gt;<br>&gt;&gt;&gt; In general our API is designed to =
assume that you will call the same<br>
&gt;&gt;&gt; function again after an EAGAIN has been called.<br>&gt;&gt;<br=
>&gt;&gt; What about aborting an in-progress operation? How would you do th=
is using the libssh2 API? Up till now I&#39;ve only been using libssh2 in b=
locking mode but, in the near future, I was hoping to use it non-blocking t=
o improve user-interaction. My aim was to put the user always in control su=
ch that if something takes too long and they get impatient they cab simply =
abort the current operation. I imagined that I would do this by setting a f=
lag and then simply not continue the loop on the next EAGAIN. Would this be=
 a bad way to do it?<br>
&gt;<br>&gt; Well, I would like that to work but I think that there are sit=
uations right now that will not work like that.<br>&gt;<br>&gt; We should w=
ork on fixing things so that we never send broken packets, even if EAGAIN i=
s returned and another function is called afterwards.<br>
<br>Out of interest, what are people using the non-blocking mode for now if=
 this doesn&#39;t work? Only for progress display?<br><br>&gt; But then the=
re&#39;s a lot of things we can work on! =3D)<br><br>Don&#39;t I know it. I=
 have a long list of changes I want to make and no time to do them :(<br>
<br>Alex

--0016e64f44f2fd2e2004ab6a4f4d--

--===============0971846662==
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

--===============0971846662==--

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 18:51:55 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QGpYf7014868;
	Fri, 26 Aug 2011 18:51:50 +0200
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 p7QGpX1o014861
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 18:51:33 +0200
Date: Fri, 26 Aug 2011 18:51:33 +0200 (CEST)
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_seek64 doesn't work
In-Reply-To: <CADyPeTNCUbdZrrwNeEFQ+q-=6v=hUsJRLNt8i9j3Hup6MuJh2g@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108261847090.32130@tvnag.unkk.fr>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
	<CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
	<CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
	<CABhJMFJ+wfvaoKg1PtT83Ds-YrW+jPiMRv4o3P76Dhe7wmpc0w@mail.gmail.com>
	<CAG0PjLwewrDKxg+k190HKZ+amEdrnrspVJ6KB6iw8MSoDj=1mg@mail.gmail.com>
	<CABhJMFLwZyhRzLzp-WHMiCVyPQGgSJmB2R=d9UjNxqiGeNWcxA@mail.gmail.com>
	<1314363358.27581.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108261518060.23869@tvnag.unkk.fr>
	<CADyPeTPc-7Lyd0TFPL9bzrO9Mk+q=2r2PN0ay5W-0j4P_ad1Dg@mail.gmail.com>
	<alpine.DEB.2.00.1108261640400.32130@tvnag.unkk.fr>
	<CADyPeTNCUbdZrrwNeEFQ+q-=6v=hUsJRLNt8i9j3Hup6MuJh2g@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 18:51:55 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 26 Aug 2011 18:51:33 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Fri, 26 Aug 2011, Alexander Lamaison wrote:

>> We should work on fixing things so that we never send broken packets, even
>> if EAGAIN is returned and another function is called afterwards.
>
> Out of interest, what are people using the non-blocking mode for now if this 
> doesn't work? Only for progress display?

Well, first it is only a problem in a very small fraction of all cases. Then, 
the problem is probably often not that serious to an application when it 
occurs since it would normally be when it shuts down things.

I've never seen a report about this, not here and not among libcurl users (who 
should be able to trigger this I suspect).

I don't know what people use non-blocking mode for, but I know that libcurl 
uses it to offer SCP and SFTP transfers to applications such as curl.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 19:16:53 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QHGiO5029048;
	Fri, 26 Aug 2011 19:16:52 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QHGhUO029030
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 19:16:43 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7QHGhwo032271
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 17:16:47 GMT
Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged))
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7QHGe4I001811
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 19:16:40 +0200
Subject: Re: libssh2_sftp_seek64 doesn't work
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Fri, 26 Aug 2011 19:16:39 +0200
In-Reply-To: <alpine.DEB.2.00.1108261640400.32130@tvnag.unkk.fr>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
	<CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
	<CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
	<CABhJMFJ+wfvaoKg1PtT83Ds-YrW+jPiMRv4o3P76Dhe7wmpc0w@mail.gmail.com>
	<CAG0PjLwewrDKxg+k190HKZ+amEdrnrspVJ6KB6iw8MSoDj=1mg@mail.gmail.com>
	<CABhJMFLwZyhRzLzp-WHMiCVyPQGgSJmB2R=d9UjNxqiGeNWcxA@mail.gmail.com>
	<1314363358.27581.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108261518060.23869@tvnag.unkk.fr>
	<CADyPeTPc-7Lyd0TFPL9bzrO9Mk+q=2r2PN0ay5W-0j4P_ad1Dg@mail.gmail.com>
	<alpine.DEB.2.00.1108261640400.32130@tvnag.unkk.fr>
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Message-ID: <1314379000.1651.4.camel@henriknordstrom.net>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 19:16:53 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Fri, 26 Aug 2011 19:16:43 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Fri, 26 Aug 2011 17:16:47 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

fre 2011-08-26 klockan 16:43 +0200 skrev Daniel Stenberg:

> We should work on fixing things so that we never send broken packets, even if 
> EAGAIN is returned and another function is called afterwards.

That kind of already works at the transport level with very simple
change, but not at higher level code where there is state machines.

It's not really a difficult thing to fix, and if done right will
simplify code.

BUT, if you are getting EAGAIN on any other operation than channel_read
then there quite likely is transport congestion, and won't really help
trying some other operation.

Regards
Henrik

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

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 19:51:09 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QHow5d013147;
	Fri, 26 Aug 2011 19:51:07 +0200
Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com
	[209.85.216.175])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QHou6X013115
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 19:50:57 +0200
Received: by qyk4 with SMTP id 4so560800qyk.20
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 10:50:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:content-type;
	bh=J9sppNjcAet5n7rJQNNWa/c2xzy0NURyO80wy3Lj1ws=;
	b=L8KxIAn4/753ozMBpszSR4sIpfRYAgbX3CHSp/pVO9lyPtRI78SPbNrOvEhdVSEA1L
	+EA1EXTgUBobjO8B1dsn8u3Umof5jgP9hSqDwXdCieMRUjkGMrQb/o/rkuE8mX7Pc6aI
	Y2WkPH+Blx8xtGxBuwCs78XaSnQ3RUkIyOwNw=
MIME-Version: 1.0
Received: by 10.229.101.34 with SMTP id a34mr1905045qco.8.1314381053697; Fri,
	26 Aug 2011 10:50:53 -0700 (PDT)
Received: by 10.229.219.7 with HTTP; Fri, 26 Aug 2011 10:50:53 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108261847090.32130@tvnag.unkk.fr>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
	<CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
	<CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
	<CABhJMFJ+wfvaoKg1PtT83Ds-YrW+jPiMRv4o3P76Dhe7wmpc0w@mail.gmail.com>
	<CAG0PjLwewrDKxg+k190HKZ+amEdrnrspVJ6KB6iw8MSoDj=1mg@mail.gmail.com>
	<CABhJMFLwZyhRzLzp-WHMiCVyPQGgSJmB2R=d9UjNxqiGeNWcxA@mail.gmail.com>
	<1314363358.27581.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108261518060.23869@tvnag.unkk.fr>
	<CADyPeTPc-7Lyd0TFPL9bzrO9Mk+q=2r2PN0ay5W-0j4P_ad1Dg@mail.gmail.com>
	<alpine.DEB.2.00.1108261640400.32130@tvnag.unkk.fr>
	<CADyPeTNCUbdZrrwNeEFQ+q-=6v=hUsJRLNt8i9j3Hup6MuJh2g@mail.gmail.com>
	<alpine.DEB.2.00.1108261847090.32130@tvnag.unkk.fr>
Date: Fri, 26 Aug 2011 18:50:53 +0100
X-Google-Sender-Auth: 5otFu7pAmSQTZcrCu1ykoH-moB4
Message-ID: <CADyPeTMrcV5eWa4aW8dZWKpaKDVHpV8fQPXz3bighV=CxriRZQ@mail.gmail.com>
Subject: Re: libssh2_sftp_seek64 doesn't work
From: Alexander Lamaison <swish@lammy.co.uk>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 19:51:08 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 26 Aug 2011 19:50:57 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On 26 August 2011 17:51, Daniel Stenberg <daniel@haxx.se> wrote:
> On Fri, 26 Aug 2011, Alexander Lamaison wrote:
>
>>> We should work on fixing things so that we never send broken packets,
>>> even
>>> if EAGAIN is returned and another function is called afterwards.
>>
>> Out of interest, what are people using the non-blocking mode for now if
>> this doesn't work? Only for progress display?
>
> Well, first it is only a problem in a very small fraction of all cases.
> Then, the problem is probably often not that serious to an application when
> it occurs since it would normally be when it shuts down things.

Howso?  Can't all functions return E_AGAIN at which point the caller
might choose to abort (i.e. not call the function again, possibly
calling a different function later)?

> I've never seen a report about this, not here and not among libcurl users
> (who should be able to trigger this I suspect).
>
> I don't know what people use non-blocking mode for, but I know that libcurl
> uses it to offer SCP and SFTP transfers to applications such as curl.

I guess what I'm asking then is in what way does curl benefit from
using libssh2 in non-blocking rather than blocking mode?

Alex

--
Swish: Easy SFTP for Windows Explorer (http://www.swish-sftp.org)
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 20:04:18 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QI46IV021117;
	Fri, 26 Aug 2011 20:04:16 +0200
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 p7QI443s021100
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 20:04:04 +0200
Date: Fri, 26 Aug 2011 20:04:04 +0200 (CEST)
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_seek64 doesn't work
In-Reply-To: <CADyPeTMrcV5eWa4aW8dZWKpaKDVHpV8fQPXz3bighV=CxriRZQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108261956100.32130@tvnag.unkk.fr>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
	<CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
	<CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
	<CABhJMFJ+wfvaoKg1PtT83Ds-YrW+jPiMRv4o3P76Dhe7wmpc0w@mail.gmail.com>
	<CAG0PjLwewrDKxg+k190HKZ+amEdrnrspVJ6KB6iw8MSoDj=1mg@mail.gmail.com>
	<CABhJMFLwZyhRzLzp-WHMiCVyPQGgSJmB2R=d9UjNxqiGeNWcxA@mail.gmail.com>
	<1314363358.27581.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108261518060.23869@tvnag.unkk.fr>
	<CADyPeTPc-7Lyd0TFPL9bzrO9Mk+q=2r2PN0ay5W-0j4P_ad1Dg@mail.gmail.com>
	<alpine.DEB.2.00.1108261640400.32130@tvnag.unkk.fr>
	<CADyPeTNCUbdZrrwNeEFQ+q-=6v=hUsJRLNt8i9j3Hup6MuJh2g@mail.gmail.com>
	<alpine.DEB.2.00.1108261847090.32130@tvnag.unkk.fr>
	<CADyPeTMrcV5eWa4aW8dZWKpaKDVHpV8fQPXz3bighV=CxriRZQ@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 20:04:18 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 26 Aug 2011 20:04:05 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Fri, 26 Aug 2011, Alexander Lamaison wrote:

>> Well, first it is only a problem in a very small fraction of all cases. 
>> Then, the problem is probably often not that serious to an application when 
>> it occurs since it would normally be when it shuts down things.
>
> Howso?  Can't all functions return E_AGAIN at which point the caller might 
> choose to abort (i.e. not call the function again, possibly calling a 
> different function later)?

Yes, just about all functions can do that but to actually decide to abort 
exactly after such a return code and then to hit a problem with it is rare.

I'm not saying it can't happen, as I admit it can.

I figure other use cases might be able to trigger problems easier, I just know 
that I've never seen anyone hit any such problems with (lib)curl.

> I guess what I'm asking then is in what way does curl benefit from using 
> libssh2 in non-blocking rather than blocking mode?

For several reasons. For one, libcurl wants to be able to provide progress 
callback and be in full control of when to wait for network conditions and how 
to handle timeouts and to be able to abort due to too slow transfers etc. But 
most importantly libcurl offers multiple simultaneous transfers in a single 
thread so no individual transfer may ever block as then all the other 
transfers would halt.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Fri Aug 26 20:52:21 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QIqBxG009416;
	Fri, 26 Aug 2011 20:52:20 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7QIq9RG009402
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 20:52:09 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7QIqDgr028263
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 18:52:14 GMT
Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged))
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7QIqCa2003216
	for <libssh2-devel@cool.haxx.se>; Fri, 26 Aug 2011 20:52:12 +0200
Subject: Re: libssh2_sftp_seek64 doesn't work
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Fri, 26 Aug 2011 20:52:12 +0200
In-Reply-To: <CADyPeTMrcV5eWa4aW8dZWKpaKDVHpV8fQPXz3bighV=CxriRZQ@mail.gmail.com>
References: <CAG0PjLxpUTL1VUiM=1=0C0rruTf+MvE7ctBx9WNrfuPXNZYd_w@mail.gmail.com>
	<CABhJMFL4=GOpHenTm8P-bK1Gu6Sd4J_ZrwxR=xJDpZq8sm_7Hg@mail.gmail.com>
	<CAG0PjLwif7hckX+Fu6wJnothQ2=-Shgd_EnWXzsc4PiJHFfA-A@mail.gmail.com>
	<CABhJMFJ+wfvaoKg1PtT83Ds-YrW+jPiMRv4o3P76Dhe7wmpc0w@mail.gmail.com>
	<CAG0PjLwewrDKxg+k190HKZ+amEdrnrspVJ6KB6iw8MSoDj=1mg@mail.gmail.com>
	<CABhJMFLwZyhRzLzp-WHMiCVyPQGgSJmB2R=d9UjNxqiGeNWcxA@mail.gmail.com>
	<1314363358.27581.10.camel@henriknordstrom.net>
	<alpine.DEB.2.00.1108261518060.23869@tvnag.unkk.fr>
	<CADyPeTPc-7Lyd0TFPL9bzrO9Mk+q=2r2PN0ay5W-0j4P_ad1Dg@mail.gmail.com>
	<alpine.DEB.2.00.1108261640400.32130@tvnag.unkk.fr>
	<CADyPeTNCUbdZrrwNeEFQ+q-=6v=hUsJRLNt8i9j3Hup6MuJh2g@mail.gmail.com>
	<alpine.DEB.2.00.1108261847090.32130@tvnag.unkk.fr>
	<CADyPeTMrcV5eWa4aW8dZWKpaKDVHpV8fQPXz3bighV=CxriRZQ@mail.gmail.com>
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Message-ID: <1314384732.1651.12.camel@henriknordstrom.net>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Fri, 26 Aug 2011 20:52:21 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Fri, 26 Aug 2011 20:52:09 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Fri, 26 Aug 2011 18:52:14 +0000 (UTC)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

fre 2011-08-26 klockan 18:50 +0100 skrev Alexander Lamaison:

> Howso?  Can't all functions return E_AGAIN at which point the caller
> might choose to abort (i.e. not call the function again, possibly
> calling a different function later)?

If EAGAIN is returned then you need to keep calling that function with
the exact same arguments after the blocking condition have been
fulfilled.

Internal state will be messed up if you do not, and in some cases the
transport will jam completely (when EAGAIN is returned due to transport
congestion).

About the only exception is libssh2_channel_read() which also reports
EAGAIN when there simply is no data available to read in the channel at
the moment.

Regards
Henrik

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

From libssh2-devel-bounces@cool.haxx.se  Mon Aug 29 15:53:36 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7TDrBv2000517;
	Mon, 29 Aug 2011 15:53:31 +0200
Received: from dns-factory.at (mail.dns-factory.at [194.242.35.75])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7TDr9Pt000500
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Mon, 29 Aug 2011 15:53:09 +0200
Received: from [172.17.100.7] lists@gknw.net [88.153.64.58]
	by dns-factory.at with NetMail SMTP Agent $Revision: 8582 $ on Novell
	NetWare via secured & encrypted transport (TLS);
	Mon, 29 Aug 2011 15:53:01 +0200
Message-ID: <4E5B99B8.2000000@gknw.net>
Date: Mon, 29 Aug 2011 15:52:56 +0200
From: Guenter <lists@gknw.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de;
	rv:1.9.2.20) Gecko/20110804 Lightning/1.0b2 Thunderbird/3.1.12
MIME-Version: 1.0
To: libssh2 hacking <libssh2-devel@cool.haxx.se>
Subject: sftp download issue -> next release
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Mon, 29 Aug 2011 15:53:36 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Mon, 29 Aug 2011 15:53:09 +0200 (CEST)
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id
	p7TDr9Pt000500
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="iso-8859-15"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p7TDrBv2000517

Hi all,
Daniel fixed an issue with sftp downloads:
 > This turned out to be a flaw in libssh2
 > and I just now pushed a fix there:
 > http://git.libssh2.org/?p=libssh2.git;a=commitdiff;h=900c90ccbe9;js=1
and I suggested to push this fix soon out with a new release before we 
do another libcurl release so that binaries will be able to be build 
against a fixed libssh2; Daniel also agreed to this:
 > Seems like a good idea with another release, yes.
 > Let's make it a 1.3.0 release right away due to the new stuff
 > we have added.
 > I think we can wait slightly for some further fixes if people come
 > up with any and aim for a release around 5-6 september something.

Gün.



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

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 30 09:59:20 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7U7wv2o018259;
	Tue, 30 Aug 2011 09:59:17 +0200
Received: from mail-pz0-f43.google.com (mail-pz0-f43.google.com
	[209.85.210.43])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7U7wsua018247
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 30 Aug 2011 09:58:55 +0200
Received: by pzk1 with SMTP id 1so14210190pzk.30
	for <libssh2-devel@cool.haxx.se>; Tue, 30 Aug 2011 00:58:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
	bh=hfu9HKtUh8LPxaW7cj0p4z0rilK6mf3x8yfh8PUj+uc=;
	b=owjOVJAYjbnkRHJNW8XcoZ2SQwjRkpK5TGSYuQooA04mwI5QfLljcOsKnHzd2LlrWD
	OoHtuIhqHB/YE3Std0bKg2vJSu12dUASEo3D/mXv2yABErimuztCWjtx03/iMRwusPsS
	qJzPvncMYSu2W9/E6k7BPrtqfETd7iGbP2s3Q=
Received: by 10.142.214.12 with SMTP id m12mr3149499wfg.73.1314691130423;
	Tue, 30 Aug 2011 00:58:50 -0700 (PDT)
Received: from localhost ([61.175.197.204])
	by mx.google.com with ESMTPS id q19sm3406857wfn.6.2011.08.30.00.58.44
	(version=TLSv1/SSLv3 cipher=OTHER);
	Tue, 30 Aug 2011 00:58:49 -0700 (PDT)
From: liuzl <xieepp@gmail.com>
To: libssh2-devel@cool.haxx.se
Subject: [PATCH] libssh2_channel_receive_window_adjust: adjust the remote
	window_size
Date: Tue, 30 Aug 2011 15:58:20 +0800
Message-Id: <1314691100-1684-1-git-send-email-xieepp@gmail.com>
X-Mailer: git-send-email 1.7.4.msysgit.0
In-Reply-To: <1>
References: <1>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 30 Aug 2011 09:59:20 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 30 Aug 2011 09:58:56 +0200 (CEST)
Cc: liuzl <xieepp@gmail.com>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

adjust the remote window_size

Signed-off-by: liuzl <xieepp@gmail.com>
---
 src/channel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/channel.c b/src/channel.c
index be6a680..ec1b550 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -1584,7 +1584,7 @@ _libssh2_channel_receive_window_adjust(LIBSSH2_CHANNEL * channel,
                        "Would block sending window adjust");
         return rc;
     }
-    else if (rc) {
+    else if (rc < 0) {
         channel->adjust_queue = adjustment;
         return _libssh2_error(channel->session, LIBSSH2_ERROR_SOCKET_SEND,
                               "Unable to send transfer-window adjustment "
-- 
1.7.4.msysgit.0

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

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 30 11:54:04 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7U9rpXf019238;
	Tue, 30 Aug 2011 11:54:02 +0200
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 p7U9ror1019232; 
	Tue, 30 Aug 2011 11:53:50 +0200
Date: Tue, 30 Aug 2011 11:53:50 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: [PATCH] libssh2_channel_receive_window_adjust: adjust the remote
	window_size
In-Reply-To: <1314691100-1684-1-git-send-email-xieepp@gmail.com>
Message-ID: <alpine.DEB.2.00.1108301152210.11462@tvnag.unkk.fr>
References: <1> <1314691100-1684-1-git-send-email-xieepp@gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 30 Aug 2011 11:54:04 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 30 Aug 2011 11:53:50 +0200 (CEST)
Cc: liuzl <xieepp@gmail.com>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Tue, 30 Aug 2011, liuzl wrote:

> adjust the remote window_size

Thanks. This patch seems to imply that _libssh2_transport_send() can in fact 
return a positive number that you shouldn't treat as an error? Or why did you 
feel the need to check rc for being less than zero?

_libssh2_transport_send() is documented to only return 0 on success and a 
negative value on error so this change shouldn't be required.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 30 17:23:28 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7UFN5Np002485;
	Tue, 30 Aug 2011 17:23:23 +0200
Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com
	[209.85.220.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7UFN2wh002406
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 30 Aug 2011 17:23:03 +0200
Received: by vxh11 with SMTP id 11so6521258vxh.41
	for <libssh2-devel@cool.haxx.se>; Tue, 30 Aug 2011 08:23:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=iQpRHvvx1Bxv67sTWzBmPBxetPY1zXdVwJV6rHYwt+U=;
	b=Xl57RHVdnilxm5zJyBeD6tg0YGLTYw648QhtE88ZtOMewJcBpQgwb1fsTnuFthDn8z
	4zJJJXebVlIKx1n/Snc3OwlhUl/Ngq259pndD2U3whDREjMDWRon13PXapSeDHHU3CxQ
	d23WJeCa7btWL2Ib5Bc4h+VeEWofdYLhVJJLc=
MIME-Version: 1.0
Received: by 10.52.23.130 with SMTP id m2mr1581968vdf.191.1314717780624; Tue,
	30 Aug 2011 08:23:00 -0700 (PDT)
Received: by 10.220.16.194 with HTTP; Tue, 30 Aug 2011 08:23:00 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108301152210.11462@tvnag.unkk.fr>
References: <1314691100-1684-1-git-send-email-xieepp@gmail.com>
	<alpine.DEB.2.00.1108301152210.11462@tvnag.unkk.fr>
Date: Tue, 30 Aug 2011 23:23:00 +0800
Message-ID: <CABhJMFK_kOm9oy3un9w3W8PZsYEumFyGdKvrXhiP_F6u5JUA2A@mail.gmail.com>
Subject: Re: [PATCH] libssh2_channel_receive_window_adjust: adjust the remote
	window_size
From: m odd <xieepp@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 30 Aug 2011 17:23:28 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 30 Aug 2011 17:23:03 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============0172364917=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0172364917==
Content-Type: multipart/alternative; boundary=20cf307814fa4b444604abba9681

--20cf307814fa4b444604abba9681
Content-Type: text/plain; charset=ISO-8859-1

Yes, it does no effort here.
what's about packet.c:708, does it forget to change remote.window_size?

if ((datalen - data_head) > channelp->remote.window_size) {
                _libssh2_error(session,
                               LIBSSH2_ERROR_CHANNEL_WINDOW_EXCEEDED,
                               "Remote sent more data than current "
                               "window allows, truncating");
                datalen = channelp->remote.window_size + data_head;
    +          channelp->remote.window_size = 0;
            }
            else
                /* Now that we've received it, shrink our window */
                channelp->remote.window_size -= datalen - data_head;

I have a problem about remote.window_size, I haven't find out the real
bug.In my test
the remote.window_size is often reduce to 0 and nerver grow.

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

<span class=3D"Apple-style-span" style=3D"font-family: arial, sans-serif; f=
ont-size: 13px; border-collapse: collapse; ">Yes, it does no effort here.<b=
r><div>what&#39;s about packet.c:708, does it forget to change=A0remote.win=
dow_size?</div>
<div><br></div><div><div>if ((datalen - data_head) &gt; channelp-&gt;remote=
.window_size) {</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 _libssh2_error(se=
ssion,</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0LIBSSH2_ERROR_CHANNEL_WINDOW_EXCEEDED,</div>
<div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;R=
emote sent more data than current &quot;</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;window allows, truncating&quot=
;);</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 datalen =3D channelp-&gt;remo=
te.window_size + data_head;</div>
<div>=A0 =A0 + =A0 =A0 =A0 =A0 =A0channelp-&gt;remote.window_size =3D 0;</d=
iv><div>=A0 =A0 =A0 =A0 =A0 =A0 }</div><div>=A0 =A0 =A0 =A0 =A0 =A0 else</d=
iv><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Now that we&#39;ve received it, =
shrink our window */</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 channelp-&gt=
;remote.window_size -=3D datalen - data_head;</div>
</div><div><br></div><div>I have a problem about=A0remote.window_size, I ha=
ven&#39;t find out the real bug.In my test</div><div>the remote.window_size=
 is often reduce to 0 and nerver grow.</div></span>

--20cf307814fa4b444604abba9681--

--===============0172364917==
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

--===============0172364917==--

From libssh2-devel-bounces@cool.haxx.se  Tue Aug 30 23:48:11 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7ULlpQ7016469;
	Tue, 30 Aug 2011 23:48:08 +0200
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 p7ULlnRJ016458
	for <libssh2-devel@cool.haxx.se>; Tue, 30 Aug 2011 23:47:49 +0200
Date: Tue, 30 Aug 2011 23:47:49 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: [PATCH] libssh2_channel_receive_window_adjust: adjust the remote
	window_size
In-Reply-To: <CABhJMFK_kOm9oy3un9w3W8PZsYEumFyGdKvrXhiP_F6u5JUA2A@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1108302343450.4012@tvnag.unkk.fr>
References: <1314691100-1684-1-git-send-email-xieepp@gmail.com>
	<alpine.DEB.2.00.1108301152210.11462@tvnag.unkk.fr>
	<CABhJMFK_kOm9oy3un9w3W8PZsYEumFyGdKvrXhiP_F6u5JUA2A@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 30 Aug 2011 23:48:11 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 30 Aug 2011 23:47:49 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Tue, 30 Aug 2011, m odd wrote:

> what's about packet.c:708, does it forget to change remote.window_size?

>   +  channelp->remote.window_size = 0;

Yes, that seems like the correct thing to do there. Of course that's an 
unusual situation so perhaps that's rather an indication of an earlier 
problem...

> I have a problem about remote.window_size, I haven't find out the real 
> bug.In my test the remote.window_size is often reduce to 0 and nerver grow.

I fail to see how the change above will fix that though. It looks more like 
the opposite!

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 31 11:06:08 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7V95iuH017266;
	Wed, 31 Aug 2011 11:06:04 +0200
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 p7V95hKL017246
	for <libssh2-devel@cool.haxx.se>; Wed, 31 Aug 2011 11:05:43 +0200
Date: Wed, 31 Aug 2011 11:05:43 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Missing git push notifications
Message-ID: <alpine.DEB.2.00.1108311103570.14495@tvnag.unkk.fr>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 31 Aug 2011 11:06:08 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 31 Aug 2011 11:05:43 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

Hi,

It seems the git push notifications have stopped to work (and I find it 
disturbing to not know when we push changes to the repository), and I can't 
get hold of Peter Stuge who runs the server side for this...

Peter, if you read this, please poke the server accordingly!

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 31 14:27:11 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7VCQlAj009693;
	Wed, 31 Aug 2011 14:27:06 +0200
Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com
	[209.85.212.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7VCQi1n009665
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 31 Aug 2011 14:26:45 +0200
Received: by vws18 with SMTP id 18so618993vws.41
	for <libssh2-devel@cool.haxx.se>; Wed, 31 Aug 2011 05:26:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type; bh=64X7qWuZ7/jtKkhxnVxd5kJyHVnOFjgShps7yTGzOTw=;
	b=XYazO2bpxlBXWLjdmE1nCUOPz8YLrNSdRL3bzqwUuCaMmQq8mhPN0UGvU5DlFTz5a7
	DMg2DrLQRlYTZYoNcsrg7JtbJeOvdy9TNaONHkLvDpICOwhmr1iIjKgneSoEfYDqmJph
	X7tR3uxk+J0mT3dZ83zwN5H5kTiTL6ICfOJ9A=
MIME-Version: 1.0
Received: by 10.220.116.6 with SMTP id k6mr87163vcq.60.1314793600256; Wed, 31
	Aug 2011 05:26:40 -0700 (PDT)
Received: by 10.220.16.194 with HTTP; Wed, 31 Aug 2011 05:26:40 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1108302343450.4012@tvnag.unkk.fr>
References: <1314691100-1684-1-git-send-email-xieepp@gmail.com>
	<alpine.DEB.2.00.1108301152210.11462@tvnag.unkk.fr>
	<CABhJMFK_kOm9oy3un9w3W8PZsYEumFyGdKvrXhiP_F6u5JUA2A@mail.gmail.com>
	<alpine.DEB.2.00.1108302343450.4012@tvnag.unkk.fr>
Date: Wed, 31 Aug 2011 20:26:40 +0800
Message-ID: <CABhJMFK0v3NrpGrn=uvXY_cq2=9mQLWaU95SbMxSBUhTsgQuaA@mail.gmail.com>
Subject: Re: [PATCH] libssh2_channel_receive_window_adjust: adjust the remote
	window_size
From: m odd <xieepp@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 31 Aug 2011 14:27:11 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 31 Aug 2011 14:26:45 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============0687642889=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0687642889==
Content-Type: multipart/alternative; boundary=f46d0438945f7f09cc04abcc3db5

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

 client :windows 7,32bit,vs 2005,libssh2
 server: Red Hat Enterprise Linux AS release 4,Linux version
2.6.9-55,OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003

 Test code (off track, otherwise, the problem does not occur so easily):
 Buffer length should be long enough.

    //libssh2_trace(session, LIBSSH2_TRACE_ERROR);
    const int mem_len = 500 * 2000;
    char *mem = new char[mem_len];
    do {
        while ((rc = libssh2_sftp_read(sftp_handle, mem, mem_len)) ==
LIBSSH2_ERROR_EAGAIN) {
            waitsocket(sock, session);
        }

        if (rc >= 0) {
            total += rc;
            fwrite(mem, rc, 1, local);
        } else {
            break;
        }
    } while (rc > 0);

 The function sftp_read() have the following code:
    if((buffer_size*4) > already)
            count = (buffer_size*4) - already;
So, in fact the size of the request will be: 4 * 500 * 2000 = 2000 * 2000
The nodes number in handle->packet_list will be:2000 * 2000 / 2000 = 2000
Each request size of node is 292 bits in my test,totally 2000 * 292 / 1024
= 570K to be sent
which is much bigger than the socket send buffer 8K,so blocking is normal
while sending.
the receive window adjust packet will send failed with error
code LIBSSH2_ERROR_BAD_USE
because of the previous blocking,transport.c:599:
if ((data != p->odata) || (data_len != p->olen)) {
        return LIBSSH2_ERROR_BAD_USE;
    }
if the blocking is continued until the remote.window_size reduce to 0 , then
no incoming data anymore because
channel.c:1853
if (!bytes_read) {
   return ..
}
 will return anyway,there is no chance to expand the receive window.

Hope someone can understand what I mean for my english is pool.

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

<div style=3D"border-collapse: collapse; color: rgb(80, 0, 80); font-family=
: arial, sans-serif; "><span class=3D"Apple-style-span" style=3D"border-col=
lapse: separate; color: rgb(0, 0, 0); font-family: arial; ">=A0client :wind=
ows 7,32bit,vs 2005,libssh2=A0</span></div>
<div><span class=3D"Apple-style-span" style=3D"border-collapse: separate; c=
olor: rgb(0, 0, 0); font-family: arial; ">=A0server:=A0</span>Red Hat Enter=
prise Linux AS release 4,Linux version 2.6.9-55,OpenSSH_3.9p1, OpenSSL 0.9.=
7a Feb 19 2003</div>
<div><br></div><div style=3D"border-collapse: collapse; color: rgb(80, 0, 8=
0); font-family: arial, sans-serif; ">=A0Test code (off track, otherwise, t=
he problem does not occur so easily):</div><div style=3D"border-collapse: c=
ollapse; color: rgb(80, 0, 80); font-family: arial, sans-serif; ">
=A0Buffer length should be long enough.</div><div style=3D"border-collapse:=
 collapse; color: rgb(80, 0, 80); font-family: arial, sans-serif; "><br></d=
iv><div style=3D"border-collapse: collapse; color: rgb(80, 0, 80); font-fam=
ily: arial, sans-serif; ">
=A0=A0 =A0//libssh2_trace(session, LIBSSH2_TRACE_ERROR);</div><div style=3D=
"border-collapse: collapse; color: rgb(80, 0, 80); font-family: arial, sans=
-serif; ">=A0=A0 =A0const int mem_len =3D 500 * 2000;</div><div style=3D"bo=
rder-collapse: collapse; color: rgb(80, 0, 80); font-family: arial, sans-se=
rif; ">
=A0=A0 =A0char *mem =3D new char[mem_len];</div><div style=3D"border-collap=
se: collapse; color: rgb(80, 0, 80); font-family: arial, sans-serif; ">=A0=
=A0 =A0do {</div><div style=3D"border-collapse: collapse; color: rgb(80, 0,=
 80); font-family: arial, sans-serif; ">
=A0=A0 =A0 =A0 =A0while ((rc =3D libssh2_sftp_read(sftp_handle, mem, mem_le=
n)) =3D=3D LIBSSH2_ERROR_EAGAIN) {</div><div style=3D"border-collapse: coll=
apse; color: rgb(80, 0, 80); font-family: arial, sans-serif; ">=A0=A0 =A0 =
=A0 =A0 =A0 =A0waitsocket(sock, session);</div>
<div style=3D"border-collapse: collapse; color: rgb(80, 0, 80); font-family=
: arial, sans-serif; ">=A0=A0 =A0 =A0 =A0}</div><div style=3D"border-collap=
se: collapse; color: rgb(80, 0, 80); font-family: arial, sans-serif; ">=A0=
=A0 =A0 =A0 =A0</div>
<div style=3D"border-collapse: collapse; color: rgb(80, 0, 80); font-family=
: arial, sans-serif; ">=A0=A0 =A0 =A0 =A0if (rc &gt;=3D 0) {</div><div styl=
e=3D"border-collapse: collapse; color: rgb(80, 0, 80); font-family: arial, =
sans-serif; ">
=A0=A0 =A0 =A0 =A0 =A0 =A0total +=3D rc;</div><div style=3D"border-collapse=
: collapse; color: rgb(80, 0, 80); font-family: arial, sans-serif; ">=A0=A0=
 =A0 =A0 =A0 =A0 =A0fwrite(mem, rc, 1, local);</div><div style=3D"border-co=
llapse: collapse; color: rgb(80, 0, 80); font-family: arial, sans-serif; ">
=A0=A0 =A0 =A0 =A0} else {</div><div style=3D"border-collapse: collapse; co=
lor: rgb(80, 0, 80); font-family: arial, sans-serif; ">=A0=A0 =A0 =A0 =A0 =
=A0 =A0break;</div><div style=3D"border-collapse: collapse; color: rgb(80, =
0, 80); font-family: arial, sans-serif; ">
=A0=A0 =A0 =A0 =A0}</div><div style=3D"border-collapse: collapse; color: rg=
b(80, 0, 80); font-family: arial, sans-serif; ">=A0=A0 =A0} while (rc &gt; =
0);</div><div style=3D"border-collapse: collapse; color: rgb(80, 0, 80); fo=
nt-family: arial, sans-serif; ">
<br></div><div style=3D"border-collapse: collapse; color: rgb(80, 0, 80); f=
ont-family: arial, sans-serif; ">=A0The function sftp_read() have the follo=
wing code:</div><div style=3D"border-collapse: collapse; color: rgb(80, 0, =
80); font-family: arial, sans-serif; ">
=A0=A0 =A0<span class=3D"Apple-style-span" style=3D"border-collapse: separa=
te; color: rgb(0, 0, 0); font-family: arial; ">if((buffer_size*4) &gt; alre=
ady)</span></div><div>=A0=A0 =A0 =A0 =A0 =A0 =A0count =3D (buffer_size*4) -=
 already;</div><div>So, in fact the size of the request will be: 4 * 500 * =
2000 =3D 2000 * 2000</div>
<div>The nodes number in handle-&gt;packet_list will be:2000 * 2000 / 2000 =
=3D 2000</div><div>Each request size of node is 292 bits in my test,totally=
 2000 * 292 / 1024 =3D=A0570K to be sent=A0</div><div>which is much bigger =
than the socket send buffer 8K,so blocking is normal while sending.</div>
<div>the receive=A0window adjust packet will send failed with error code=A0=
LIBSSH2_ERROR_BAD_USE</div><div>because of the previous blocking,transport.=
c:599:</div><div><div>if ((data !=3D p-&gt;odata) || (data_len !=3D p-&gt;o=
len)) {</div>
<div>=A0=A0 =A0 =A0 =A0return LIBSSH2_ERROR_BAD_USE;</div><div>=A0=A0 =A0}<=
/div></div><div>if the blocking is continued until the remote.window_size=
=A0reduce to 0 , then no incoming data anymore because</div><div>channel.c:=
1853</div><div><div>
if (!bytes_read) {</div><div>=A0=A0 return ..</div><div>}</div></div><div>=
=A0will return anyway,there is no chance to expand the receive window.</div=
><div><br></div><div>Hope someone can understand what I mean for my english=
 is pool.</div>
<div><br></div><div><br></div><div><br></div><div><br></div>

--f46d0438945f7f09cc04abcc3db5--

--===============0687642889==
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

--===============0687642889==--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 31 14:41:43 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7VCfcxf016946;
	Wed, 31 Aug 2011 14:41:43 +0200
Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7VCfYMg016864
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 31 Aug 2011 14:41:35 +0200
Received: by gwb15 with SMTP id 15so11337gwb.41
	for <libssh2-devel@cool.haxx.se>; Wed, 31 Aug 2011 05:41:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;
	bh=qhRtQtAueL2gWpTbwUHsWyHWQXzl/DBImO7uf2vXOfQ=;
	b=HOVCPdS5Cv5zOrgCwwmQNihPoHDGPqD+JMu3ZpJt9hTuoBM/wg4td2fmF/XzygezCx
	Hz+6zs9btgRZhAazsWo89vJ7jF5R4QVKJePuxZErGZduMrAdZTpX7gOlntx99OEq6w5z
	9oNp8Q3M7xfs54gtxvVlaSbAttvFeqqkPJ/+c=
Received: by 10.142.246.11 with SMTP id t11mr78873wfh.292.1314794492570;
	Wed, 31 Aug 2011 05:41:32 -0700 (PDT)
Received: from localhost ([61.175.197.204])
	by mx.google.com with ESMTPS id x1sm1843447wfc.13.2011.08.31.05.41.28
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 31 Aug 2011 05:41:31 -0700 (PDT)
From: liuzl <xieepp@gmail.com>
To: libssh2-devel@cool.haxx.se
Subject: [PATCH] Adjust the receive window correctly
Date: Wed, 31 Aug 2011 20:40:59 +0800
Message-Id: <1314794459-2552-1-git-send-email-xieepp@gmail.com>
X-Mailer: git-send-email 1.7.4.msysgit.0
In-Reply-To: <1>
References: <1>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 31 Aug 2011 14:41:43 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 31 Aug 2011 14:41:36 +0200 (CEST)
Cc: liuzl <xieepp@gmail.com>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

Handle the error code LIBSSH2_ERROR_BAD_USE correctly,
avoid the receive window reduce to zero.

Signed-off-by: liuzl <xieepp@gmail.com>
---
 src/channel.c |   54 +++++++++++++++++++++++++-----------------------------
 1 files changed, 25 insertions(+), 29 deletions(-)

diff --git a/src/channel.c b/src/channel.c
index be6a680..2cbe934 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -1585,8 +1585,7 @@ _libssh2_channel_receive_window_adjust(LIBSSH2_CHANNEL * channel,
         return rc;
     }
     else if (rc) {
-        channel->adjust_queue = adjustment;
-        return _libssh2_error(channel->session, LIBSSH2_ERROR_SOCKET_SEND,
+        return _libssh2_error(channel->session, rc,
                               "Unable to send transfer-window adjustment "
                               "packet, deferring");
     }
@@ -1765,13 +1764,12 @@ ssize_t _libssh2_channel_read(LIBSSH2_CHANNEL *channel, int stream_id,
     if ((rc < 0) && (rc != LIBSSH2_ERROR_EAGAIN))
         return _libssh2_error(session, rc, "transport read");
 
-    /*
-     * =============================== NOTE ===============================
-     * I know this is very ugly and not a really good use of "goto", but
-     * this case statement would be even uglier to do it any other way
-     */
-    if (channel->read_state == libssh2_NB_state_jump1) {
-        goto channel_read_ex_point1;
+    if (channel->remote.window_size < (LIBSSH2_CHANNEL_WINDOW_DEFAULT*30)
+            && channel->adjust_state == libssh2_NB_state_idle) {
+        /* the window is getting too narrow, expand it!
+        Ignore all the sending errors since we are receiving. */
+        _libssh2_channel_receive_window_adjust(channel,
+            (LIBSSH2_CHANNEL_WINDOW_DEFAULT*60), 0, NULL);
     }
 
     read_packet = _libssh2_list_first(&session->packets);
@@ -1871,26 +1869,6 @@ ssize_t _libssh2_channel_read(LIBSSH2_CHANNEL *channel, int stream_id,
            more off the network again */
         channel->read_state = libssh2_NB_state_created;
 
-    if(channel->remote.window_size < (LIBSSH2_CHANNEL_WINDOW_DEFAULT*30)) {
-        /* the window is getting too narrow, expand it! */
-
-      channel_read_ex_point1:
-        channel->read_state = libssh2_NB_state_jump1;
-        /* the actual window adjusting may not finish so we need to deal with
-           this special state here */
-        rc = _libssh2_channel_receive_window_adjust(channel,
-                                                    (LIBSSH2_CHANNEL_WINDOW_DEFAULT*60), 0, NULL);
-        if (rc == LIBSSH2_ERROR_EAGAIN)
-            return rc;
-
-        _libssh2_debug(session, LIBSSH2_TRACE_CONN,
-                       "channel_read() filled %d adjusted %d",
-                       bytes_read, buflen);
-        /* continue in 'created' state to drain the already read packages
-           first before starting to empty the socket further */
-        channel->read_state = libssh2_NB_state_created;
-    }
-
     return bytes_read;
 }
 
@@ -1996,6 +1974,24 @@ _libssh2_channel_write(LIBSSH2_CHANNEL *channel, int stream_id,
     if(buflen > 32700)
         buflen = 32700;
 
+    /* The previous receive window adjust failed, try again. */
+    if (channel->adjust_state == libssh2_NB_state_created) {
+        /* Adjust the receive window size as soon as we can. */
+        rc = _libssh2_channel_receive_window_adjust(channel,
+            (LIBSSH2_CHANNEL_WINDOW_DEFAULT*60), 0, NULL);
+
+        /* Logic error, we will try again next time. */
+        if (rc == LIBSSH2_ERROR_BAD_USE) {
+            _libssh2_error(channel->session, rc,
+                "Unable to send transfer-window adjustment packet in "
+                "_libssh2_channel_write(), deferring");
+        }
+        /* Block or really socket error. */
+        else if (rc < 0){
+            return rc;
+        }
+    }
+
     if (channel->write_state == libssh2_NB_state_idle) {
         unsigned char *s = channel->write_packet;
 
-- 
1.7.4.msysgit.0

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

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 31 21:35:55 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7VJZVmi026031;
	Wed, 31 Aug 2011 21:35:49 +0200
Received: from ld73.inmotionhosting.com (ld73.inmotionhosting.com
	[74.124.194.138])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7VJZT4n025971
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 31 Aug 2011 21:35:30 +0200
Received: from 108-93-26-230.lightspeed.irvnca.sbcglobal.net ([108.93.26.230]
	helo=BTRD462)
	by ld73.inmotionhosting.com with esmtpsa (TLSv1:AES128-SHA:128)
	(Exim 4.69) (envelope-from <cliftongonsalves@btrade.com>)
	id 1QyqZM-0006kQ-93
	for libssh2-devel@cool.haxx.se; Wed, 31 Aug 2011 12:35:28 -0700
From: "Clifton Gonsalves" <cliftongonsalves@btrade.com>
To: <libssh2-devel@cool.haxx.se>
Subject: Problems Receiving Files from  Maveric SSH Server
Date: Wed, 31 Aug 2011 12:34:17 -0700
Message-ID: <005b01cc6814$fb0e1320$f12a3960$@com>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AcxoFPgRJuRikeDmSHi+i2utg79fxA==
Content-Language: en-us
x-cr-hashedpuzzle: Ay6M BW+Z B9jK B/gw Croa D9kb EsB6 E62X E92m Fy+e HQqn HRvP
	JKuR Jl05 J8H4 KapB; 1;
	bABpAGIAcwBzAGgAMgAtAGQAZQB2AGUAbABAAGMAbwBvAGwALgBoAGEAeAB4AC4AcwBlAA==;
	Sosha1_v1; 7; {4E6064D6-B971-492E-838C-5DBB8BDDA190};
	YwBsAGkAZgB0AG8AbgBnAG8AbgBzAGEAbAB2AGUAcwBAAGIAdAByAGEAZABlAC4AYwBvAG0A;
	Wed, 31 Aug 2011 19:34:15 GMT;
	UAByAG8AYgBsAGUAbQBzACAAUgBlAGMAZQBpAHYAaQBuAGcAIABGAGkAbABlAHMAIABmAHIAbwBtACAAIABNAGEAdgBlAHIAaQBjACAAUwBTAEgAIABTAGUAcgB2AGUAcgA=
x-cr-puzzleid: {4E6064D6-B971-492E-838C-5DBB8BDDA190}
X-AntiAbuse: This header was added to track abuse,
	please include it with any abuse report
X-AntiAbuse: Primary Hostname - ld73.inmotionhosting.com
X-AntiAbuse: Original Domain - cool.haxx.se
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - btrade.com
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 31 Aug 2011 21:35:55 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 31 Aug 2011 21:35:30 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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="===============1337285025=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

This is a multipart message in MIME format.

--===============1337285025==
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_005C_01CC67DA.4EAF3B20"
Content-Language: en-us

This is a multipart message in MIME format.

------=_NextPart_000_005C_01CC67DA.4EAF3B20
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit

Hello,

I am having problems receiving  large number of files from Maverick  SSH
server.

The connection intermittently times out after few transfers.

The exact place where it times out is after send the command to get a file,
The connection remains open I do not receive any data from the server and it
times out.

 

eg:

If I have to download 2000 files, I can download 1500 files in one
connections but it fails after that.

 

 

Any ideas?

 


------=_NextPart_000_005C_01CC67DA.4EAF3B20
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:x=3D"urn:schemas-microsoft-com:office:excel" =
xmlns:p=3D"urn:schemas-microsoft-com:office:powerpoint" =
xmlns:a=3D"urn:schemas-microsoft-com:office:access" =
xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" =
xmlns:s=3D"uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" =
xmlns:rs=3D"urn:schemas-microsoft-com:rowset" xmlns:z=3D"#RowsetSchema" =
xmlns:b=3D"urn:schemas-microsoft-com:office:publisher" =
xmlns:ss=3D"urn:schemas-microsoft-com:office:spreadsheet" =
xmlns:c=3D"urn:schemas-microsoft-com:office:component:spreadsheet" =
xmlns:odc=3D"urn:schemas-microsoft-com:office:odc" =
xmlns:oa=3D"urn:schemas-microsoft-com:office:activation" =
xmlns:html=3D"http://www.w3.org/TR/REC-html40" =
xmlns:q=3D"http://schemas.xmlsoap.org/soap/envelope/" =
xmlns:rtc=3D"http://microsoft.com/officenet/conferencing" =
xmlns:D=3D"DAV:" xmlns:Repl=3D"http://schemas.microsoft.com/repl/" =
xmlns:mt=3D"http://schemas.microsoft.com/sharepoint/soap/meetings/" =
xmlns:x2=3D"http://schemas.microsoft.com/office/excel/2003/xml" =
xmlns:ppda=3D"http://www.passport.com/NameSpace.xsd" =
xmlns:ois=3D"http://schemas.microsoft.com/sharepoint/soap/ois/" =
xmlns:dir=3D"http://schemas.microsoft.com/sharepoint/soap/directory/" =
xmlns:ds=3D"http://www.w3.org/2000/09/xmldsig#" =
xmlns:dsp=3D"http://schemas.microsoft.com/sharepoint/dsp" =
xmlns:udc=3D"http://schemas.microsoft.com/data/udc" =
xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" =
xmlns:sub=3D"http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/"=
 xmlns:ec=3D"http://www.w3.org/2001/04/xmlenc#" =
xmlns:sp=3D"http://schemas.microsoft.com/sharepoint/" =
xmlns:sps=3D"http://schemas.microsoft.com/sharepoint/soap/" =
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
xmlns:udcs=3D"http://schemas.microsoft.com/data/udc/soap" =
xmlns:udcxf=3D"http://schemas.microsoft.com/data/udc/xmlfile" =
xmlns:udcp2p=3D"http://schemas.microsoft.com/data/udc/parttopart" =
xmlns:wf=3D"http://schemas.microsoft.com/sharepoint/soap/workflow/" =
xmlns:dsss=3D"http://schemas.microsoft.com/office/2006/digsig-setup" =
xmlns:dssi=3D"http://schemas.microsoft.com/office/2006/digsig" =
xmlns:mdssi=3D"http://schemas.openxmlformats.org/package/2006/digital-sig=
nature" =
xmlns:mver=3D"http://schemas.openxmlformats.org/markup-compatibility/2006=
" xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns:mrels=3D"http://schemas.openxmlformats.org/package/2006/relationshi=
ps" xmlns:spwp=3D"http://microsoft.com/sharepoint/webpartpages" =
xmlns:ex12t=3D"http://schemas.microsoft.com/exchange/services/2006/types"=
 =
xmlns:ex12m=3D"http://schemas.microsoft.com/exchange/services/2006/messag=
es" =
xmlns:pptsl=3D"http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/=
" =
xmlns:spsl=3D"http://microsoft.com/webservices/SharePointPortalServer/Pub=
lishedLinksService" xmlns:Z=3D"urn:schemas-microsoft-com:" =
xmlns:st=3D"&#1;" xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal>Hello,<o:p></o:p></p>

<p class=3DMsoNormal>I am having problems receiving &nbsp;large number =
of files from
Maverick &nbsp;SSH server.<o:p></o:p></p>

<p class=3DMsoNormal>The connection intermittently times out after few =
transfers.<o:p></o:p></p>

<p class=3DMsoNormal>The exact place where it times out is after send =
the command
to get a file, The connection remains open I do not receive any data =
from the
server and it times out.<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>eg:<o:p></o:p></p>

<p class=3DMsoNormal>If I have to download 2000 files, I can download =
1500 files
in one connections but it fails after that.<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Any ideas?<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>

------=_NextPart_000_005C_01CC67DA.4EAF3B20--


--===============1337285025==
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

--===============1337285025==--

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 31 22:42:14 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7VKg1Tq031718;
	Wed, 31 Aug 2011 22:42:12 +0200
Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net
	[IPv6:2a02:750:7::d0a])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7VKg09Z031715
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 31 Aug 2011 22:42:00 +0200
Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1])
	by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP
	id p7VKg3Cc022147; Wed, 31 Aug 2011 20:42:04 GMT
Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged))
	by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id
	p7VKg1Ts015959; Wed, 31 Aug 2011 22:42:02 +0200
Subject: Re: [PATCH] Adjust the receive window correctly
From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= <henrik@henriknordstrom.net>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Wed, 31 Aug 2011 22:42:01 +0200
In-Reply-To: <1314794459-2552-1-git-send-email-xieepp@gmail.com>
References: <1> <1314794459-2552-1-git-send-email-xieepp@gmail.com>
X-Mailer: Evolution 3.0.2 (3.0.2-3.fc15) 
Message-ID: <1314823322.15491.1.camel@henriknordstrom.net>
Mime-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 31 Aug 2011 22:42:14 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [IPv6:2a00:1a28:1200:9::2]);
	Wed, 31 Aug 2011 22:42:00 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0
	(vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]);
	Wed, 31 Aug 2011 20:42:05 +0000 (UTC)
Cc: liuzl <xieepp@gmail.com>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

ons 2011-08-31 klockan 20:40 +0800 skrev liuzl:
> Handle the error code LIBSSH2_ERROR_BAD_USE correctly,
> avoid the receive window reduce to zero.

You should never see LIBSSH2_ERROR_BAD_USE. If you do then the library
is wrongly used (or perhaps there is a non-blocking bug in the library).

When/why are you getting the BAD_USE error?

Regards
Henrik

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

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 31 23:41:28 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7VLfKQn028287;
	Wed, 31 Aug 2011 23:41:26 +0200
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 p7VLfIUn028282
	for <libssh2-devel@cool.haxx.se>; Wed, 31 Aug 2011 23:41:18 +0200
Date: Wed, 31 Aug 2011 23:41:18 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Problems Receiving Files from  Maveric SSH Server
In-Reply-To: <005b01cc6814$fb0e1320$f12a3960$@com>
Message-ID: <alpine.DEB.2.00.1108312339290.21352@tvnag.unkk.fr>
References: <005b01cc6814$fb0e1320$f12a3960$@com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 31 Aug 2011 23:41:28 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 31 Aug 2011 23:41:18 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Wed, 31 Aug 2011, Clifton Gonsalves wrote:

> I am having problems receiving large number of files from Maverick SSH 
> server. The connection intermittently times out after few transfers.
>
> Any ideas?

Using libssh2 1.2.9 already? If not, please do. On which platform?

Can you provide us a full program that repeats the problem? What's the 
smallest amount of files to transfer required to trigger the problem? Does it 
fail on the same file/byte offset if you repeat the exact same transfer 
scenario?

Have you tried to enable tracing and repeat the bug?

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Wed Aug 31 23:44:41 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p7VLiXWK029013;
	Wed, 31 Aug 2011 23:44:40 +0200
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 p7VLiVxs029002
	for <libssh2-devel@cool.haxx.se>; Wed, 31 Aug 2011 23:44:31 +0200
Date: Wed, 31 Aug 2011 23:44:31 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Problems Receiving Files from  Maveric SSH Server
In-Reply-To: <alpine.DEB.2.00.1108312339290.21352@tvnag.unkk.fr>
Message-ID: <alpine.DEB.2.00.1108312343500.21352@tvnag.unkk.fr>
References: <005b01cc6814$fb0e1320$f12a3960$@com>
	<alpine.DEB.2.00.1108312339290.21352@tvnag.unkk.fr>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 31 Aug 2011 23:44:41 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 31 Aug 2011 23:44:31 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
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"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Wed, 31 Aug 2011, Daniel Stenberg wrote:

> Have you tried to enable tracing and repeat the bug?

Also, you didn't mention how you get the files. I assumed SFTP in my head but 
did you perhaps use SCP?

-- 

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

