From libssh2-devel-bounces@cool.haxx.se  Sat Jan  1 00:07:30 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBVN7OZ6029551;
	Sat, 1 Jan 2011 00:07:29 +0100
Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com
	[74.125.82.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBVN7Nrd029537
	for <libssh2-devel@cool.haxx.se>; Sat, 1 Jan 2011 00:07:23 +0100
Received: by wyf19 with SMTP id 19so12649191wyf.41
	for <libssh2-devel@cool.haxx.se>; Fri, 31 Dec 2010 15:07:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=gamma;
	h=domainkey-signature:received:received:from:to:references
	:in-reply-to:subject:date:message-id:mime-version:content-type
	:content-transfer-encoding:x-mailer:thread-index:content-language;
	bh=v29UTHZTkUzRbsg1MCaoKnBFuSkgb0HgxHJS1fxDKCA=;
	b=QP2AWZUvFTQNFn6zxxpSStvDeMms7kWfcmrislJCVAg9a39ptDflKvVBOV4jlxIEbF
	w4mMvSvdra/pAKAJY6vOwoYF6J3l5QtMPXvZzAGmwVCe6MEvXACjckL567bspmEVv5Ry
	NWh8/ISuDirFblvrC6UkbZXfaIcSI226OxkvA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma;
	h=from:to:references:in-reply-to:subject:date:message-id:mime-version
	:content-type:content-transfer-encoding:x-mailer:thread-index
	:content-language;
	b=oG+9opvtDnsv2Lxm/Ewrb1CKEMORHwTmFT/vIRo1RvFsrbke6kdh+mlT0+emDjhEuJ
	L3NIkMndpGeJjHtYtjWFgreKfquxajxQqEEYJJy/Wz+eEZT+Z2VPwwN44T6FrEulzAfo
	88r/9uwop9L8xwYY9bGbncoPxfianWSWpJZPc=
Received: by 10.216.153.210 with SMTP id f60mr15580115wek.114.1293836834108;
	Fri, 31 Dec 2010 15:07:14 -0800 (PST)
Received: from Arche (cpc2-pmth10-2-0-cust728.6-1.cable.virginmedia.com
	[81.97.2.217])
	by mx.google.com with ESMTPS id n11sm8508916wej.43.2010.12.31.15.07.12
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Fri, 31 Dec 2010 15:07:13 -0800 (PST)
From: "Steve Legg" <smlegg@googlemail.com>
To: "'libssh2 development'" <libssh2-devel@cool.haxx.se>
References: <000501cba902$3b3be1c0$b1b3a540$@com>
	<alpine.DEB.2.00.1012312334570.25754@tvnag.unkk.fr>
In-Reply-To: <alpine.DEB.2.00.1012312334570.25754@tvnag.unkk.fr>
Subject: RE: Bug in channel.c/channel_request_pty_size?
Date: Fri, 31 Dec 2010 23:06:48 -0000
Message-ID: <000c01cba93f$681f59f0$385e0dd0$@com>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AcupO3dOMvqjDsBwSOOxV9CtqinwjAAAsRXw
Content-Language: en-gb
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sat, 01 Jan 2011 00:07:30 -875900 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]);
	Sat, 01 Jan 2011 00:07:23 -875900 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

> On Fri, 31 Dec 2010, Steve Legg wrote:
> 
> > Am I wrong, and there is actually a way for reqPTY_state to be set
> > back to idle?  Or is this a real bug?
> 
> It looks like a real bug to me!

Cool, thought so.
 
> > (it looks to me like the code has been written with asynchrony in
> > mind, but never actually finished - the reqPTY_state code appears to
> > be mostly redundant).
> 
> Not entirely redundant since it avoids doing all that initing of the
> packet during situations when the transport layer returns
> LIBSSH2_ERROR_EAGAIN.

Ah yes, I didn't notice the BLOCK_ADJUST macro.  I see how it works now (or
is supposed to work except in this case ;)

> How about fixing this bug with a patch like the attached?

Looks good to me - I'll give that a go later (I'm using it for an Android
project and building libssh2 means a trip through Linux for me [too hard to
get libssh2/openssl building with the android toolchain under windows ;] so
I'll give it a go tomorrow probably).  Thanks!

Steve.

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

From libssh2-devel-bounces@cool.haxx.se  Sun Jan  2 23:50:51 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p02MoSlH019720;
	Sun, 2 Jan 2011 23:50:47 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p02MoRMJ019705
	for <libssh2-devel@cool.haxx.se>; Sun, 2 Jan 2011 23:50:27 +0100
Date: Sun, 2 Jan 2011 23:50:27 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: sftp_symlink() with too small buffer
Message-ID: <alpine.DEB.2.00.1101022347380.17681@tvnag.unkk.fr>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sun, 02 Jan 2011 23:50:51 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sun, 02 Jan 2011 23:50:27 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hi friends,

I'd like to start having libssh2_sftp_symlink_ex() return 
LIBSSH2_ERROR_BUFFER_TOO_SMALL if the caller provides a too small buffer that 
won't fit the received file name when doing SSH_FXP_REALPATH.

Currently the code will truncate the received information and return that 
shorter length. My application then has no idea if the data was exactly that 
long or if it was truncated. I would prefer to get an error to allow the 
application to increase the buffer and ask again.

Comments?

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Mon Jan  3 00:47:38 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p02NlVMd020888;
	Mon, 3 Jan 2011 00:47:37 +0100
Received: from imail.ipswitch.com (imail.ipswitch.com [156.21.1.5])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p02NlT2i020855
	for <libssh2-devel@cool.haxx.se>; Mon, 3 Jan 2011 00:47:30 +0100
DKIM-Signature: q=dns/txt; v=1; c=relaxed/relaxed; s=ipswitch;
	d=ipswitch.com; a=rsa-sha1;
	h=Subject:References:From:Content-Type:In-Reply-To:Message-Id:Date:
	To:Content-Transfer-Encoding:Mime-Version;
	b=NlolBQEjg/BB5Q3BjDtqhbGWpiolmcFrT1vZWSzaKy6SHO5SrFdL1sYGD2TcevZXqB
	KXfY2IjWVEgZSzxVY0Zq2DxAsu2WtjF6kvpt/fQCOdb6huQ0eJ6x3Zfgn3ZehUF3D30X
	BskdOUfxuD1AZfiPOVvjvZetETF/XLGTLgEhY=;
	bh=TjEMopt5hqTmOKcppvSmeQGNrng=; t=1294012040;
Received: from [192.168.12.109] [76.250.44.135] by ipswitch.com with ESMTP
	(SMTPD-11.03) id 376a0044f8481419; Sun, 2 Jan 2011 18:47:19 -0500
Subject: Re: sftp_symlink() with too small buffer
References: <alpine.DEB.2.00.1101022347380.17681@tvnag.unkk.fr>
From: Mark Riordan <mriordan@ipswitch.com>
X-Mailer: iPhone Mail (8C148a)
In-Reply-To: <alpine.DEB.2.00.1101022347380.17681@tvnag.unkk.fr>
Message-Id: <4362239F-05C6-4EC8-96F0-ED05D0AAD7BB@ipswitch.com>
Date: Sun, 2 Jan 2011 17:47:40 -0600
To: libssh2 development <libssh2-devel@cool.haxx.se>
Mime-Version: 1.0 (iPhone Mail 8C148a)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 03 Jan 2011 00:47:38 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 03 Jan 2011 00:47:30 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

This sounds like a good idea to me. 

Mark R

On Jan 2, 2011, at 16:50, Daniel Stenberg <daniel@haxx.se> wrote:

> Hi friends,
> 
> I'd like to start having libssh2_sftp_symlink_ex() return LIBSSH2_ERROR_BUFFER_TOO_SMALL if the caller provides a too small buffer that won't fit the received file name when doing SSH_FXP_REALPATH.
...
> 
> Daniel

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

From libssh2-devel-bounces@cool.haxx.se  Mon Jan  3 16:23:12 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p03FMP4U014023;
	Mon, 3 Jan 2011 16:23:09 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id p03FMNN6013990
	for <libssh2-devel@cool.haxx.se>; Mon, 3 Jan 2011 16:22:23 +0100
Received: (qmail 12774 invoked by uid 501); 3 Jan 2011 15:22:17 -0000
Message-ID: <20110103152217.12773.qmail@stuge.se>
Date: Mon, 3 Jan 2011 16:22:17 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: sftp_symlink() with too small buffer
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <alpine.DEB.2.00.1101022347380.17681@tvnag.unkk.fr>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.00.1101022347380.17681@tvnag.unkk.fr>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 03 Jan 2011 16:23:12 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 03 Jan 2011 16:22:23 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Daniel Stenberg wrote:
> I'd like to start having libssh2_sftp_symlink_ex() return 
> LIBSSH2_ERROR_BUFFER_TOO_SMALL if the caller provides a too small
> buffer that won't fit the received file name when doing
> SSH_FXP_REALPATH.

It's an API change, but I think it is one we need.


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

From libssh2-devel-bounces@cool.haxx.se  Mon Jan  3 17:24:27 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p03GNZwb020721;
	Mon, 3 Jan 2011 17:24:27 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p03GNZPB020716
	for <libssh2-devel@cool.haxx.se>; Mon, 3 Jan 2011 17:23:35 +0100
Date: Mon, 3 Jan 2011 17:23:35 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: sftp_symlink() with too small buffer
In-Reply-To: <20110103152217.12773.qmail@stuge.se>
Message-ID: <alpine.DEB.2.00.1101031625060.12762@tvnag.unkk.fr>
References: <alpine.DEB.2.00.1101022347380.17681@tvnag.unkk.fr>
	<20110103152217.12773.qmail@stuge.se>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 03 Jan 2011 17:24:27 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 03 Jan 2011 17:23:35 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Mon, 3 Jan 2011, Peter Stuge wrote:

>> I'd like to start having libssh2_sftp_symlink_ex() return 
>> LIBSSH2_ERROR_BUFFER_TOO_SMALL if the caller provides a too small buffer 
>> that won't fit the received file name when doing SSH_FXP_REALPATH.
>
> It's an API change, but I think it is one we need.

Yes, it is a minor behavior modification but I can't think of another way to 
do it (adding a separate function just for this little change feels bad) and I 
guess this change will only affect a small amount of users.

BTW, I noticed the same flaw and need in the sftp_readdir function, and I 
guess it may also be elsewhere once we start looking closer.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Mon Jan  3 17:28:54 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p03GSDYQ022604;
	Mon, 3 Jan 2011 17:28:54 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id p03GSBbT022563
	for <libssh2-devel@cool.haxx.se>; Mon, 3 Jan 2011 17:28:11 +0100
Received: (qmail 28511 invoked by uid 501); 3 Jan 2011 16:28:08 -0000
Message-ID: <20110103162808.28510.qmail@stuge.se>
Date: Mon, 3 Jan 2011 17:28:08 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: sftp_symlink() with too small buffer
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <alpine.DEB.2.00.1101022347380.17681@tvnag.unkk.fr>
	<20110103152217.12773.qmail@stuge.se>
	<alpine.DEB.2.00.1101031625060.12762@tvnag.unkk.fr>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.00.1101031625060.12762@tvnag.unkk.fr>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 03 Jan 2011 17:28:54 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 03 Jan 2011 17:28:11 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Daniel Stenberg wrote:
>>> I'd like to start having libssh2_sftp_symlink_ex() return 
>>> LIBSSH2_ERROR_BUFFER_TOO_SMALL if the caller provides a too small
>>> buffer
>>
>> It's an API change, but I think it is one we need.
>
> Yes, it is a minor behavior modification but I can't think of another
> way to do it .. and I guess this change will only affect a small
> amount of users.

Yes, and it should be a safe change since it will at worst only
introduce a new error, pointing to code in libssh2 users that should
be fixed anyway.


> BTW, I noticed the same flaw and need in the sftp_readdir function,
> and I guess it may also be elsewhere once we start looking closer.

I say let's fix it everywhere.


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

From libssh2-devel-bounces@cool.haxx.se  Tue Jan  4 14:05:33 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p04D55YW001648;
	Tue, 4 Jan 2011 14:05:28 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id p04D52s1001319
	for <libssh2-devel@cool.haxx.se>; Tue, 4 Jan 2011 14:05:02 +0100
Received: (qmail 3372 invoked by uid 501); 4 Jan 2011 13:04:57 -0000
Message-ID: <20110104130457.3371.qmail@stuge.se>
Date: Tue, 4 Jan 2011 14:04:57 +0100
From: Peter Stuge <peter@stuge.se>
To: ahmed.obied@gmail.com
Subject: SSHAuth pGina plugin
Mail-Followup-To: ahmed.obied@gmail.com, libssh2-devel@cool.haxx.se
MIME-Version: 1.0
Content-Disposition: inline
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 04 Jan 2011 14:05:33 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 04 Jan 2011 14:05:02 +0100 (CET)
Cc: libssh2-devel@cool.haxx.se
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hi Ahmed,

I'm one of the libssh2 developers, and just now I came across your
SSHAuth pGina plugin. Nice!

On http://sshauth.sourceforge.net/ I read:

* Known issues
SSHAuth can only authenticate users against SSH servers running on
Linux systems. If you try to authenticate to an SSH servers running
on Solaris or BSD then the plugin might crash. This is due to a bug
in the libssh2 library used by the plugin when the plugin calls the
function: libssh2_session_startup.


Could you tell us more about this bug? Maybe it has been solved
already? If not, we would of course like to know all details so that
we can fix it.

As I am sure you know there is a difference between the password and
the keyboard-interactive authentication methods, and the simplest
libssh2 examples only demonstrate the former, but the library also
supports keyboard-interactive, so the pGina plugin could certainly be
made to work also with non-Linux SSH servers.


Kind regards

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

From libssh2-devel-bounces@cool.haxx.se  Tue Jan  4 14:50:25 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p04DoHTj022155;
	Tue, 4 Jan 2011 14:50:24 +0100
Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com
	[209.85.216.175])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p04DoEci022137
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 4 Jan 2011 14:50:15 +0100
Received: by qyk8 with SMTP id 8so16077484qyk.20
	for <libssh2-devel@cool.haxx.se>; Tue, 04 Jan 2011 05:50:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:content-type:content-transfer-encoding;
	bh=8cFkhIm1T9Gd6uQf86UWHrsqmX+8RpBnFGZ98D7QZSM=;
	b=SAxPEo4PmNwG7xmaBbIYu4PFZVELzo21LLVy/w5W1Rv/KWVbEUN/mnihuM2+5slrxz
	ymDFedOxPQDR4QNtDscG1ypy8OU+pZgA+KS8k55hwHKtcT/orUhDZdT9jSjYFK9LfFx6
	1s2gZIfKkTHcy4nBOS62liMqoSUESEujckCkc=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:content-type
	:content-transfer-encoding;
	b=OyqmCGEUqYak0lryzU4FjNDNy2JKq41zqVzyHZx8GEaCesXpQ2+t5sI+NvtBmvaVD9
	XRY/gaGkZDro8WIn55dJr7dM0MsmbiumBp7/KDVJEdUc7BQYSXusVLpwzaVoMQ2nfFKo
	3KTXTDfwqRkWRGGUfEkHPlA7Y8MF4xPw/x5PI=
MIME-Version: 1.0
Received: by 10.229.184.208 with SMTP id cl16mr18873184qcb.105.1294149006949; 
	Tue, 04 Jan 2011 05:50:06 -0800 (PST)
Received: by 10.229.85.202 with HTTP; Tue, 4 Jan 2011 05:50:06 -0800 (PST)
In-Reply-To: <20110104133124.30892.qmail@earth.stuge.se>
References: <20110104133124.30892.qmail@earth.stuge.se>
Date: Tue, 4 Jan 2011 13:50:06 +0000
X-Google-Sender-Auth: ILJVaP5niZoMIlr_tZ50Ll6xZNE
Message-ID: <AANLkTi=b9CHHpPNk8ZK5ft6ektONFWwVr41YP11cb6Sf@mail.gmail.com>
Subject: Re: libssh2 master 164838c sftp_readdir: return error if buffer is
	too small
From: Alexander Lamaison <swish@lammy.co.uk>
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 04 Jan 2011 14:50:25 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 04 Jan 2011 14:50:15 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On 4 January 2011 13:31,  <libssh2@git.stuge.se> wrote:
> - Log -----------------------------------------------------------------
> commit 164838c7dd26aa084d00dfa178b870dcda41968f
> Author: Daniel Stenberg <daniel@haxx.se>
> Commit: Daniel Stenberg <daniel@haxx.se>
>
> =A0 =A0sftp_readdir: return error if buffer is too small
>
> =A0 =A0If asked to read data into a buffer and the buffer is too small to=
 hold
> =A0 =A0the data, this function now returns an error instead of as previou=
sly
> =A0 =A0just copy as much as fits.

As libssh2 knows the length the buffer needs to be in each case, could
we add a separate API call that fetches this buffer size?  This would
allow very careful code to avoid the buffer length problem entirely.

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  Tue Jan  4 14:57:16 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p04DvEml024965;
	Tue, 4 Jan 2011 14:57:16 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id p04DvBoA024959
	for <libssh2-devel@cool.haxx.se>; Tue, 4 Jan 2011 14:57:12 +0100
Received: (qmail 12162 invoked by uid 501); 4 Jan 2011 13:57:09 -0000
Message-ID: <20110104135709.12161.qmail@stuge.se>
Date: Tue, 4 Jan 2011 14:57:09 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: libssh2 master 164838c sftp_readdir: return error if buffer is
	too small
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <20110104133124.30892.qmail@earth.stuge.se>
	<AANLkTi=b9CHHpPNk8ZK5ft6ektONFWwVr41YP11cb6Sf@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <AANLkTi=b9CHHpPNk8ZK5ft6ektONFWwVr41YP11cb6Sf@mail.gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 04 Jan 2011 14:57:16 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 04 Jan 2011 14:57:12 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

QWxleGFuZGVyIExhbWFpc29uIHdyb3RlOgo+ID4gwqAgwqBzZnRwX3JlYWRkaXI6IHJldHVybiBl
cnJvciBpZiBidWZmZXIgaXMgdG9vIHNtYWxsCj4gCj4gQXMgbGlic3NoMiBrbm93cyB0aGUgbGVu
Z3RoIHRoZSBidWZmZXIgbmVlZHMgdG8gYmUgaW4gZWFjaCBjYXNlLCBjb3VsZAo+IHdlIGFkZCBh
IHNlcGFyYXRlIEFQSSBjYWxsIHRoYXQgZmV0Y2hlcyB0aGlzIGJ1ZmZlciBzaXplPyAgVGhpcyB3
b3VsZAo+IGFsbG93IHZlcnkgY2FyZWZ1bCBjb2RlIHRvIGF2b2lkIHRoZSBidWZmZXIgbGVuZ3Ro
IHByb2JsZW0gZW50aXJlbHkuCgpTb3JyeSwgSSBkb24ndCB1bmRlcnN0YW5kIHdoYXQgeW91IG1l
YW4gaGVyZS4gQ291bGQgeW91IGVsYWJvcmF0ZSBhCmxpdHRsZT8KCgpUaGFua3MhCgovL1BldGVy
Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCmxpYnNzaDIt
ZGV2ZWwgaHR0cDovL2Nvb2wuaGF4eC5zZS9jZ2ktYmluL21haWxtYW4vbGlzdGluZm8vbGlic3No
Mi1kZXZlbAo=

From libssh2-devel-bounces@cool.haxx.se  Tue Jan  4 15:15:11 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p04EEwY4004817;
	Tue, 4 Jan 2011 15:15:10 +0100
Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com
	[209.85.216.175])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p04EEtVn004774
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 4 Jan 2011 15:14:57 +0100
Received: by qyk8 with SMTP id 8so16101618qyk.20
	for <libssh2-devel@cool.haxx.se>; Tue, 04 Jan 2011 06:14:48 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:content-type:content-transfer-encoding;
	bh=wOykBOjP0zLGw13o9jcX/LOYywO/Ga6F/CG+TFjkPBI=;
	b=USMO7/PZTqIkvo974UlSkGdZXv5hKtBRwjq4C5R64FtyAYROKghbXJb+R10WG7/OSs
	90vm8GFmaxRBq8pm3F/GxnFdjeQ0HYjtI9MLj5Mna14p/lJEwvroyiktDQMbh8WMyqox
	KmReaBeqYnQQOGKY4tyahy02CdOhVDjllH8CU=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:content-type
	:content-transfer-encoding;
	b=J963apmy8/MHXPeFW+KHY11eazZOWChIl0gK9uuyuV2T724iClP52jHCaOR05CKSW+
	9gubMnT3yL24Q9+knmulCiVr+Dizf0e0NTrwny+M/qW+VADJG9UWSkrhGW9W7LQ34bLY
	GFuqD4lc0I0PTI0K8jAbirhtuEZFWIXT/ZC/w=
MIME-Version: 1.0
Received: by 10.229.181.9 with SMTP id bw9mr18864288qcb.143.1294150488169;
	Tue, 04 Jan 2011 06:14:48 -0800 (PST)
Received: by 10.229.85.202 with HTTP; Tue, 4 Jan 2011 06:14:48 -0800 (PST)
In-Reply-To: <20110104135709.12161.qmail@stuge.se>
References: <20110104133124.30892.qmail@earth.stuge.se>
	<AANLkTi=b9CHHpPNk8ZK5ft6ektONFWwVr41YP11cb6Sf@mail.gmail.com>
	<20110104135709.12161.qmail@stuge.se>
Date: Tue, 4 Jan 2011 14:14:48 +0000
X-Google-Sender-Auth: mC05B_cTVAzY-D1Wvnf1X2X2Omk
Message-ID: <AANLkTimLnooP1Xb3YKD-mhVorXRkMj3gwh-3oCt6+=AW@mail.gmail.com>
Subject: Re: libssh2 master 164838c sftp_readdir: return error if buffer is
	too small
From: Alexander Lamaison <swish@lammy.co.uk>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 04 Jan 2011 15:15:11 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 04 Jan 2011 15:14:57 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Sorry.  Not the world's clearest explanation, I grant you.

libssh2 has the actual lengths of the filename and longentry available
(it computes them during the call and stores them in filename_len and
longentry_len) but it doesn't expose them to the caller.  The caller
blindly provides a buffer of a certain length and just has to hope
this does the trick.  Instead we could add another API function
(sftp_readdir_lengths?) which only does the length computations and
returns these.  Then the caller allocates buffers of those lengths and
calls sftp_readdir as usual but without the risk of a BUFFER_TOO_SMALL
error.

A different strategy found in the Windows API is to use a single API
function but if the first call to it uses too small a buffer it
returns the required size as the error value.  The caller can then fix
the size of the buffer and call it again.  However, I don't think this
alternative fits well with the libssh2 norm of returning a simple
error code.

Alex
--
Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)


On 4 January 2011 13:57, Peter Stuge <peter@stuge.se> wrote:
> Alexander Lamaison wrote:
>> > =A0 =A0sftp_readdir: return error if buffer is too small
>>
>> As libssh2 knows the length the buffer needs to be in each case, could
>> we add a separate API call that fetches this buffer size? =A0This would
>> allow very careful code to avoid the buffer length problem entirely.
>
> Sorry, I don't understand what you mean here. Could you elaborate a
> little?
>
>
> Thanks!
>
> //Peter
> _______________________________________________
> 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  Thu Jan  6 10:38:59 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p069cWIR030006;
	Thu, 6 Jan 2011 10:38:53 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p069cUT7030003
	for <libssh2-devel@cool.haxx.se>; Thu, 6 Jan 2011 10:38:30 +0100
Received: (qmail 30869 invoked from network); 6 Jan 2011 09:38:26 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 6 Jan 2011 09:38:26 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Thu, 06 Jan 2011 09:38:26 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #92: SCP recursive file transfer
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/92#comment:3
Message-ID: <060.aa8fa8e59c91636c0f43105d47afdf69@libssh2.stuge.se>
References: <045.8c447f8eb2c5e93297da572cbf5f263e@libssh2.stuge.se>
X-Trac-Ticket-ID: 92
In-Reply-To: <045.8c447f8eb2c5e93297da572cbf5f263e@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 06 Jan 2011 10:38:59 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 06 Jan 2011 10:38:30 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#92: SCP recursive file transfer
------------------------+---------------------------------------------------
  Reporter:  anonymous  |        Owner:          
      Type:  defect     |       Status:  reopened
  Priority:  normal     |    Milestone:          
 Component:  SCP        |      Version:          
Resolution:             |     Keywords:          
    Blocks:             |   Blocked By:          
------------------------+---------------------------------------------------
Changes (by www.google.com/accounts/o8/id?id=aitoawleji0ugwpfzxb0kogpf78hivdw7p18ywg):

  * status:  closed => reopened


Comment:

 It would be nice if there was an API in libssh2 so that D and E SCP
 protocol messages can be made use of for recursive copying. Otherwise to
 implement this in client program, I guess we should use mkdir with
 libssh2_channel_exec() or so and libssh2_scp_send64() repeatedly. Or is
 there any better way?

-- 
Ticket URL: <http://trac.libssh2.org/ticket/92#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  Thu Jan  6 23:58:08 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p06Mvpjr017277;
	Thu, 6 Jan 2011 23:58:05 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p06Mvosj017261
	for <libssh2-devel@cool.haxx.se>; Thu, 6 Jan 2011 23:57:50 +0100
Received: (qmail 14955 invoked from network); 6 Jan 2011 22:57:47 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 6 Jan 2011 22:57:47 -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, 06 Jan 2011 22:57:47 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #92: SCP recursive file transfer
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/92#comment:4
Message-ID: <060.662fe35a7ca5a46056d3c183bc94eed9@libssh2.stuge.se>
References: <045.8c447f8eb2c5e93297da572cbf5f263e@libssh2.stuge.se>
X-Trac-Ticket-ID: 92
In-Reply-To: <045.8c447f8eb2c5e93297da572cbf5f263e@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 06 Jan 2011 23:58:08 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 06 Jan 2011 23:57:50 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#92: SCP recursive file transfer
--------------------------+-------------------------------------------------
  Reporter:  anonymous    |        Owner:          
      Type:  enhancement  |       Status:  reopened
  Priority:  normal       |    Milestone:          
 Component:  SCP          |      Version:          
Resolution:               |     Keywords:          
    Blocks:               |   Blocked By:          
--------------------------+-------------------------------------------------
Changes (by bagder):

  * type:  defect => enhancement


Comment:

 This is still not a bug.

 Feel free to bring your suggestions and ideas etc to the mailing list and
 we can discuss them there and see what kind of API we can make up or
 suggest for you.

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

From libssh2-devel-bounces@cool.haxx.se  Fri Jan  7 09:20:27 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p078K1RO026596;
	Fri, 7 Jan 2011 09:20:22 +0100
Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com
	[209.85.214.54])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p078K0Iu026587
	for <libssh2-devel@cool.haxx.se>; Fri, 7 Jan 2011 09:20:01 +0100
Received: by bwz12 with SMTP id 12so10761916bwz.41
	for <libssh2-devel@cool.haxx.se>; Fri, 07 Jan 2011 00:19:59 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:mime-version:received:from:date
	:message-id:subject:to:content-type;
	bh=R5VMAiAZ8pPn9TFqq+SQs7or9e/a+21Q51/67C0kaDQ=;
	b=wjrWd/awKUXjVhDp6bn1brFlzDU5td/vPFOk2bTpQYQVUrRult4ZbXQP93pVaJ/fjt
	4kO1Nago/xKZJAoSRSD7mhfqA795g+BgO6crRqrKmWyIN6HVpEUwW8vpkGQQJlgmrBre
	lzZjLcbrq/h0UiHNKRn54e8uF1JuQ0dXmkySA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:from:date:message-id:subject:to:content-type;
	b=YI5SAtq26CHipZ6eCdUN1Y4ToduxkiiJF5gHubEhh+yy5Eok8oRN5YFG8Zz64TrTuu
	nrRGeRkDwBWFId9tUzFDeKfEwqchpI89DqRSk6l9je7+RX+8AAq+TLsKGvl0Sl2R0q3k
	/yqSeehTPvIVU8gA0zJijp4bIu3/rqFkAB6vU=
Received: by 10.204.70.137 with SMTP id d9mr792928bkj.141.1294388398992; Fri,
	07 Jan 2011 00:19:58 -0800 (PST)
MIME-Version: 1.0
Received: by 10.204.127.147 with HTTP; Fri, 7 Jan 2011 00:14:04 -0800 (PST)
From: Samuel ROZE <samuel.roze@gmail.com>
Date: Fri, 7 Jan 2011 09:14:04 +0100
Message-ID: <AANLkTi=Z-9w-a_wkHbW+s-sn4abEO8v91WLh0SZ-GEed@mail.gmail.com>
Subject: Persistent shell
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Fri, 07 Jan 2011 09:20:26 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Fri, 07 Jan 2011 09:20:01 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hello,

I'm using the libssh2 with the PECL/ssh2 extension. I would like to
have a persistent ssh2 shell connection, do you know if it is
possible?

Thanks in advance,
Samuel ROZE.
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Fri Jan  7 10:23:15 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p079N0KL009487;
	Fri, 7 Jan 2011 10:23:14 +0100
Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com
	[209.85.214.54])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p079MwxW009442
	for <libssh2-devel@cool.haxx.se>; Fri, 7 Jan 2011 10:22:58 +0100
Received: by bwz12 with SMTP id 12so10791636bwz.41
	for <libssh2-devel@cool.haxx.se>; Fri, 07 Jan 2011 01:22:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:received:in-reply-to
	:references:date:message-id:subject:from:to:content-type;
	bh=O2UkInjyFNZl7mUuEVu5y2+nlJDINJ9YnjLgvoItfK0=;
	b=x+QZ4xgpbqX23c38qXWnwp5DABkJdsM4eRwhGCti9CPU0KNyP9Vat26k0lhELQD2DP
	8ZMkmZX+t0pdUNZIK7nMxixFqpz9rKooR8bXP1yELNLuLa6vs5djtEOiMWjA1jW0ATFz
	JSbEgzOSDYZiQjt2vRbyadvyTzSIxwSWViy5U=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type;
	b=v3rzO2MKrUK1eYDrqtaYgwwL+fBy6S4AhRXyBmCvQfx4Hcr4ctKp/9cKpE0KrvEK9B
	3sQcKrKNEUDyNvK9SB0Hiom5esRVsFuXnLIUYfgHDy3e323Z+biktMc26GwQlbDGXq7W
	iKSxkhvgWFETBGyiXT11gEDwPMGQ3FpJi4yR0=
MIME-Version: 1.0
Received: by 10.204.117.10 with SMTP id o10mr11663378bkq.10.1294392174862;
	Fri, 07 Jan 2011 01:22:54 -0800 (PST)
Received: by 10.204.52.129 with HTTP; Fri, 7 Jan 2011 01:22:54 -0800 (PST)
In-Reply-To: <AANLkTi=Z-9w-a_wkHbW+s-sn4abEO8v91WLh0SZ-GEed@mail.gmail.com>
References: <AANLkTi=Z-9w-a_wkHbW+s-sn4abEO8v91WLh0SZ-GEed@mail.gmail.com>
Date: Fri, 7 Jan 2011 10:22:54 +0100
Message-ID: <AANLkTimrHMhck8g3z1qQUs0G-Bykvd5gJu34LrsiGPYC@mail.gmail.com>
Subject: Re: Persistent shell
From: Pierre Joye <pierre.php@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Fri, 07 Jan 2011 10:23:15 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Fri, 07 Jan 2011 10:22:58 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

hi,

ssh2_shell?

Cheers,

On Fri, Jan 7, 2011 at 9:14 AM, Samuel ROZE <samuel.roze@gmail.com> wrote:
> Hello,
>
> I'm using the libssh2 with the PECL/ssh2 extension. I would like to
> have a persistent ssh2 shell connection, do you know if it is
> possible?
>
> Thanks in advance,
> Samuel ROZE.
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>



-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Fri Jan  7 11:26:44 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p07AQSVT021475;
	Fri, 7 Jan 2011 11:26:43 +0100
Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com
	[209.85.214.54])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p07AQQVc021470
	for <libssh2-devel@cool.haxx.se>; Fri, 7 Jan 2011 11:26:26 +0100
Received: by bwz12 with SMTP id 12so10825517bwz.41
	for <libssh2-devel@cool.haxx.se>; Fri, 07 Jan 2011 02:26:25 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:mime-version:received:in-reply-to
	:references:from:date:message-id:subject:to:content-type;
	bh=9bgWL0RmbhY8ECkHQ9FtyxMpfF0bjL8nHJSEabCMEGU=;
	b=yECn/gJt+hEozr8sJksYWG3rGHvCg7v3PtipIe89iPz6JxiNMvV2OMjiY+P6WKPEFU
	LsEBXtQnrclS2hoXnYaYE7K6kUNGQltpieEen1v4e2G8tsd1ZmTdDL6mq2rvuCBAbUYA
	iDiYFSjelPz20XQAx2MZWbtkiIF+h1oiqnc5c=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:content-type;
	b=xgEFMUEXWbMFtZUVYiO5NjGvy4+P6sAspWE6ItLBHnb+SJA1nMu9qR+jU9eLQPJCLO
	z1+Tb0M2FpxCjG58RQQS8UDXgeNz2NoAF7bHWo0DV8UGNjnm3BAK7P+8/tFkwjMgkO4p
	n1If94CaJqcSR7e+B6Ty2EkKl/n3eFy16gH88=
Received: by 10.204.118.3 with SMTP id t3mr583704bkq.87.1294395983738; Fri, 07
	Jan 2011 02:26:23 -0800 (PST)
MIME-Version: 1.0
Received: by 10.204.127.147 with HTTP; Fri, 7 Jan 2011 02:26:03 -0800 (PST)
In-Reply-To: <AANLkTimrHMhck8g3z1qQUs0G-Bykvd5gJu34LrsiGPYC@mail.gmail.com>
References: <AANLkTi=Z-9w-a_wkHbW+s-sn4abEO8v91WLh0SZ-GEed@mail.gmail.com>
	<AANLkTimrHMhck8g3z1qQUs0G-Bykvd5gJu34LrsiGPYC@mail.gmail.com>
From: Samuel ROZE <samuel.roze@gmail.com>
Date: Fri, 7 Jan 2011 11:26:03 +0100
Message-ID: <AANLkTingnDduFabRjkMDzE=gAPby70hBexEM641-xtpg@mail.gmail.com>
Subject: Re: Persistent shell
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Fri, 07 Jan 2011 11:26:44 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Fri, 07 Jan 2011 11:26:26 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hi,

ssh2_shell give me an interactive shell, but when the PHP page is
loaded, the connection is closed. What I want is that between pages,
the connection stay alive...

Cheers,

2011/1/7 Pierre Joye <pierre.php@gmail.com>:
> hi,
>
> ssh2_shell?
>
> Cheers,
>
> On Fri, Jan 7, 2011 at 9:14 AM, Samuel ROZE <samuel.roze@gmail.com> wrote:
>> Hello,
>>
>> I'm using the libssh2 with the PECL/ssh2 extension. I would like to
>> have a persistent ssh2 shell connection, do you know if it is
>> possible?
>>
>> Thanks in advance,
>> Samuel ROZE.
>> _______________________________________________
>> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>>
>
>
>
> --
> Pierre
>
> @pierrejoye | http://blog.thepimp.net | http://www.libgd.org
> _______________________________________________
> 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  Fri Jan  7 12:53:50 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p07BrNxe007111;
	Fri, 7 Jan 2011 12:53:46 +0100
Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com
	[209.85.214.54])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p07BrL0f007105
	for <libssh2-devel@cool.haxx.se>; Fri, 7 Jan 2011 12:53:22 +0100
Received: by bwz12 with SMTP id 12so10875625bwz.41
	for <libssh2-devel@cool.haxx.se>; Fri, 07 Jan 2011 03:53:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:received:in-reply-to
	:references:date:message-id:subject:from:to:content-type;
	bh=oNQ2WhmcClhIDepmyO5oVszJEXverQ48Mq5O8r+CqoU=;
	b=MgdIHwVw3291iFupdpILXBzC0tzKtgolmOa/p9XtGEBKiv35PaEuH5rjeBwlMZO9HI
	+rg/LmYt3YsWNXXWz8NtwVvsECoVQR6SQ06RA4od5K7ccELjCY28Xh5KC/Vb5ETiXcmm
	RJhJez3tmvizn8ltdyhnjrQHUa4DoGhfoUGqw=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type;
	b=rYeyTFfMvUMWlgCTZj5MfDr9zISUToaJ/hxlC+GWdnSKQxUeGJHn0j4OsUemMicg1e
	hzuW7bqa/Lul3okjnNqIWFPst5M7EWzmh0TLxQ0XAMebJXcRARLp0fckJqhOfPst8N7X
	m/53NIvWWM9joTji7r4e6qh9IfXT5xRz3MPFs=
MIME-Version: 1.0
Received: by 10.204.101.83 with SMTP id b19mr3189649bko.199.1294401196515;
	Fri, 07 Jan 2011 03:53:16 -0800 (PST)
Received: by 10.204.52.129 with HTTP; Fri, 7 Jan 2011 03:53:16 -0800 (PST)
In-Reply-To: <AANLkTingnDduFabRjkMDzE=gAPby70hBexEM641-xtpg@mail.gmail.com>
References: <AANLkTi=Z-9w-a_wkHbW+s-sn4abEO8v91WLh0SZ-GEed@mail.gmail.com>
	<AANLkTimrHMhck8g3z1qQUs0G-Bykvd5gJu34LrsiGPYC@mail.gmail.com>
	<AANLkTingnDduFabRjkMDzE=gAPby70hBexEM641-xtpg@mail.gmail.com>
Date: Fri, 7 Jan 2011 12:53:16 +0100
Message-ID: <AANLkTimKe0UbV4p_bnqVaLKHEr_d19KeAfy7MXLVQPud@mail.gmail.com>
Subject: Re: Persistent shell
From: Pierre Joye <pierre.php@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Fri, 07 Jan 2011 12:53:50 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Fri, 07 Jan 2011 12:53:22 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

hi,

Not possible and I don't think we will ever implement it in the PHP
binding. Everything is destroyed at the end of a request, it is
possible to have persistent connection for some databases but that's a
very special case. And even for this case, we recommend not to do it.

Cheers,

On Fri, Jan 7, 2011 at 11:26 AM, Samuel ROZE <samuel.roze@gmail.com> wrote:
> Hi,
>
> ssh2_shell give me an interactive shell, but when the PHP page is
> loaded, the connection is closed. What I want is that between pages,
> the connection stay alive...


-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Sat Jan  8 23:00:39 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p08M0GFE009283;
	Sat, 8 Jan 2011 23:00:34 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p08M0DIq009092
	for <libssh2-devel@cool.haxx.se>; Sat, 8 Jan 2011 23:00:13 +0100
Received: (qmail 15695 invoked from network); 8 Jan 2011 22:00:08 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 8 Jan 2011 22:00:08 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Sat, 08 Jan 2011 22:00:08 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #198: _libssh2_channel_close() may hang
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/198#comment:6
Message-ID: <055.9e6d65fe41275bed291ab5ad8c38c034@libssh2.stuge.se>
References: <040.f267185fd189c3163b83597a7e73540d@libssh2.stuge.se>
X-Trac-Ticket-ID: 198
In-Reply-To: <040.f267185fd189c3163b83597a7e73540d@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sat, 08 Jan 2011 23:00:38 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sat, 08 Jan 2011 23:00:13 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#198: _libssh2_channel_close() may hang
---------------------+------------------------------------------------------
  Reporter:  fd64    |        Owner:  bagder
      Type:  defect  |       Status:  closed
  Priority:  normal  |    Milestone:  1.2.8 
 Component:  API     |      Version:  1.2.7 
Resolution:  fixed   |     Keywords:        
    Blocks:          |   Blocked By:        
---------------------+------------------------------------------------------
Changes (by bagder):

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


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

From libssh2-devel-bounces@cool.haxx.se  Sun Jan  9 00:37:02 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p08Nalvc032647;
	Sun, 9 Jan 2011 00:37:01 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p08NakEW032631
	for <libssh2-devel@cool.haxx.se>; Sun, 9 Jan 2011 00:36:46 +0100
Received: (qmail 32304 invoked from network); 8 Jan 2011 23:36:42 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 8 Jan 2011 23:36:42 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Sat, 08 Jan 2011 23:36:42 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #205: "Error waiting for FXP_READ ACK" during large
	download on Windows
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/205#comment:2
Message-ID: <060.66c17b65ecbff721f259456e3035266e@libssh2.stuge.se>
References: <045.22cd8a9b7f08a7953dd719389d002842@libssh2.stuge.se>
X-Trac-Ticket-ID: 205
In-Reply-To: <045.22cd8a9b7f08a7953dd719389d002842@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sun, 09 Jan 2011 00:37:02 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sun, 09 Jan 2011 00:36:46 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

Comment (by bagder):

 Can you please try to apply a debug patch such as the following to see
 what kind of size libssh2 thinks it is getting:

 {{{
 --- a/src/sftp.c
 +++ b/src/sftp.c
 @@ -205,10 +205,13 @@ sftp_packet_read(LIBSSH2_SFTP *sftp)
          packet_len = _libssh2_ntohu32(sftp->partial_size);
          /* make sure we don't proceed if the packet size is unreasonably
             large */
 -        if (packet_len > LIBSSH2_SFTP_PACKET_MAXLEN)
 +        if (packet_len > LIBSSH2_SFTP_PACKET_MAXLEN) {
 +            fprintf(stderr, "INFO: Got %u bytes packet\n",
 +                    packet_len);
              return _libssh2_error(session,
                                    LIBSSH2_ERROR_CHANNEL_PACKET_EXCEEDED,
                                    "SFTP packet too large");
 +        }

          _libssh2_debug(session, LIBSSH2_TRACE_SFTP,
                         "Data begin - Packet Length: %lu", packet_len);

 }}}

-- 
Ticket URL: <http://trac.libssh2.org/ticket/205#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  Sun Jan  9 00:38:05 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p08Nc2ib000641;
	Sun, 9 Jan 2011 00:38:04 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p08Nc1IY000602
	for <libssh2-devel@cool.haxx.se>; Sun, 9 Jan 2011 00:38:01 +0100
Received: (qmail 32482 invoked from network); 8 Jan 2011 23:37:58 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 8 Jan 2011 23:37:58 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Sat, 08 Jan 2011 23:37:58 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #205: "Error waiting for FXP_READ ACK" during large
	download on Windows
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/205#comment:3
Message-ID: <060.59fa2d54477bc28776ffae8a1f9e441d@libssh2.stuge.se>
References: <045.22cd8a9b7f08a7953dd719389d002842@libssh2.stuge.se>
X-Trac-Ticket-ID: 205
In-Reply-To: <045.22cd8a9b7f08a7953dd719389d002842@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sun, 09 Jan 2011 00:38:05 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sun, 09 Jan 2011 00:38:01 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

Comment (by bagder):

 Oops sorry, your trace already had that info: 1728053336.

 which when translated to hex becomes: 67000058 ... It clearly looks like
 it is somehow out of sync...

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

From libssh2-devel-bounces@cool.haxx.se  Mon Jan 10 00:11:13 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p09NAlDX011468;
	Mon, 10 Jan 2011 00:11:08 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p09NAkCu011456
	for <libssh2-devel@cool.haxx.se>; Mon, 10 Jan 2011 00:10:46 +0100
Received: (qmail 17501 invoked from network); 9 Jan 2011 23:10:40 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 9 Jan 2011 23:10:40 -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: Sun, 09 Jan 2011 23:10:40 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #205: "Error waiting for FXP_READ ACK" during large
	download on Windows
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/205#comment:4
Message-ID: <060.698bebf10fb1875f3ebee7362f5008ce@libssh2.stuge.se>
References: <045.22cd8a9b7f08a7953dd719389d002842@libssh2.stuge.se>
X-Trac-Ticket-ID: 205
In-Reply-To: <045.22cd8a9b7f08a7953dd719389d002842@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 10 Jan 2011 00:11:13 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 10 Jan 2011 00:10:46 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

Comment (by bagder):

 What's your typical round-trip latency to this server? I'm running your
 sample code on Linux and want to work to see if I can trigger this bug
 here...

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

From libssh2-devel-bounces@cool.haxx.se  Mon Jan 10 00:12:58 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p09NCvpu012083;
	Mon, 10 Jan 2011 00:12:58 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p09NCtHi012070
	for <libssh2-devel@cool.haxx.se>; Mon, 10 Jan 2011 00:12:55 +0100
Date: Mon, 10 Jan 2011 00:12:55 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: A release
Message-ID: <alpine.DEB.2.00.1101100011140.5922@tvnag.unkk.fr>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 10 Jan 2011 00:12:58 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 10 Jan 2011 00:12:55 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hi all,

I do want to start working towards a new release. I know we have a few open 
bugs right now so I'd like to urge everyone to help out with those, and if 
there are other problems not currently submitted to trac: now is a great time 
to do that.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Mon Jan 10 11:35:08 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0AAYP4D013339;
	Mon, 10 Jan 2011 11:35:03 +0100
Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com
	[209.85.160.54])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0AAYNPn013240
	for <libssh2-devel@cool.haxx.se>; Mon, 10 Jan 2011 11:34:24 +0100
Received: by pwi10 with SMTP id 10so3581739pwi.41
	for <libssh2-devel@cool.haxx.se>; Mon, 10 Jan 2011 02:34:15 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:message-id:date:from
	:organization:user-agent:mime-version:to:subject:content-type
	:content-transfer-encoding;
	bh=NdoFsXhTPrr9gLTbr9qBafCZER1NqJoukDspv53JPc0=;
	b=PFXPYB7Bv+1fiXkcQNxOZ1E9fb8GDDp186zDFWQGFq9P3vXwvfabdCXDukvyHbbYg0
	Tp+GeCPhxVTZivuLq8kme/iC5UbFhzpyl773yEQeXFsVCt6e7fK7zbBtuUxSryTHf2US
	fW0G0J3LqlOmlvxupZFK67ePzsOIrOqKRhPaQ=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=message-id:date:from:organization:user-agent:mime-version:to
	:subject:content-type:content-transfer-encoding;
	b=UoAwuLjqcx4POCOHKqVmkhbqB5DYQONrndpKzP7LBBFm9pnxUC8eaY3vzATgAp0Mc7
	c/E3UkT2JCJrq1hDcOZT3Xq3veCFNyaLdq0YA+wQ4iaqHkeJDbUXl89BIuod/ymxcNUk
	kCy+FKiZKjIOXbPEId+lHY3vsp0VljR/VoWIs=
Received: by 10.142.180.16 with SMTP id c16mr494686wff.81.1294655655016;
	Mon, 10 Jan 2011 02:34:15 -0800 (PST)
Received: from Sunjith-P-Ss-MacBook-Pro.local ([115.119.57.30])
	by mx.google.com with ESMTPS id w22sm7481927wfd.7.2011.01.10.02.34.12
	(version=SSLv3 cipher=RC4-MD5); Mon, 10 Jan 2011 02:34:13 -0800 (PST)
Message-ID: <4D2AE0A1.5050403@gmail.com>
Date: Mon, 10 Jan 2011 16:04:09 +0530
From: Sunjith P S <sunjithps@gmail.com>
Organization: AdMod Technologies Pvt Ltd.
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;
	rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4
MIME-Version: 1.0
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: SCP recursive file transfer
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 10 Jan 2011 11:35:08 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 10 Jan 2011 11:34:24 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

  Hi,

It would be nice if there was an API in libssh2 so that D and E SCP 
protocol messages can be made use of for recursive copying. Otherwise to 
implement this in client program, I guess we should use mkdir with 
libssh2_channel_exec() or so and libssh2_scp_send64() repeatedly. Or is 
there any better way?

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

From libssh2-devel-bounces@cool.haxx.se  Mon Jan 10 16:43:23 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0AFh41m010146;
	Mon, 10 Jan 2011 16:43:19 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0AFh1Pb010052
	for <libssh2-devel@cool.haxx.se>; Mon, 10 Jan 2011 16:43:02 +0100
Received: (qmail 13845 invoked from network); 10 Jan 2011 15:42:58 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 10 Jan 2011 15:42:58 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Mon, 10 Jan 2011 15:42:58 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #205: "Error waiting for FXP_READ ACK" during large
	download on Windows
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/205#comment:5
Message-ID: <060.0d78d25350b539a14cbc1d3f17d7ed45@libssh2.stuge.se>
References: <045.22cd8a9b7f08a7953dd719389d002842@libssh2.stuge.se>
X-Trac-Ticket-ID: 205
In-Reply-To: <045.22cd8a9b7f08a7953dd719389d002842@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 10 Jan 2011 16:43:23 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 10 Jan 2011 16:43:02 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

Comment (by riordanmr):

 ping reports "time<1ms".  The client and server are on the same LAN.

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

From libssh2-devel-bounces@cool.haxx.se  Mon Jan 10 18:27:46 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0AHRTVW007554;
	Mon, 10 Jan 2011 18:27:45 +0100
Received: from mail.gmx.net (mailout-de.gmx.net [213.165.64.23])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id p0AHRRe3007534
	for <libssh2-devel@cool.haxx.se>; Mon, 10 Jan 2011 18:27:27 +0100
Received: (qmail 15570 invoked by uid 0); 10 Jan 2011 17:27:20 -0000
Received: from 141.169.250.17 by www122.gmx.net with HTTP;
	Mon, 10 Jan 2011 18:27:17 +0100 (CET)
Date: Mon, 10 Jan 2011 18:27:17 +0100
From: "Arno Schmitt" <ars-rt@gmx.de>
Message-ID: <20110110172717.202280@gmx.net>
MIME-Version: 1.0
Subject: sftp size of 2GB files
To: libssh2-devel@cool.haxx.se
X-Authenticated: #36309713
X-Flags: 0001
X-Mailer: WWW-Mail 6100 (Global Message Exchange)
X-Priority: 3
X-Provags-ID: V01U2FsdGVkX1/MEKhtmFvMcBmMyRtbBsB7VUcclo60wxtShsihPH
	nS0SjjJLCOngXb1yq2GLb1TQVOxWV1BfNwLg== 
X-GMX-UID: FChefjB6ODB6KLtrWWZM6TI9Ji9SWtKg
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 10 Jan 2011 18:27:45 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 10 Jan 2011 18:27:27 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hello,

I'm running libssh2 with sftp file transfer under Suse Linux 11.2, 64 Bit.
Using function libssh2_sftp_readdir_ex() on a directory containing a 2GB=2^31 byte (exatcly) file reports file size = 18446744071562067968.

I've changed method 

libssh2_uint64_t
_libssh2_ntohu64(const unsigned char *buf)

in src/misc.c to the following code:

libssh2_uint64_t
_libssh2_ntohu64(const unsigned char *buf)
{
    unsigned long msl = 0;
    unsigned long lsl = 0;

    msl = ((unsigned )buf[0] << 24) | ((unsigned )buf[1] << 16) | ((unsigned )buf[2] << 8) | (unsigned )buf[3];
    lsl = ((unsigned )buf[4] << 24) | ((unsigned )buf[5] << 16) | ((unsigned )buf[6] << 8) | (unsigned )buf[7];

    return ((libssh2_uint64_t)msl <<32) | lsl;
}

This is essentially the same code as your original code. Only difference is the explicit cast of buf[i] to unsigned int.

I did not observe this problem running in a 32 bit environment. My gcc version 4.4.1 uses 8 bytes for long and 4 bytes for int in the 64 bit environment. In 32 bit environment both have size 4 bytes.

Best regards
Arno
-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Mon Jan 10 18:56:12 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0AHu2m8023164;
	Mon, 10 Jan 2011 18:56:10 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0AHu1vF023113
	for <libssh2-devel@cool.haxx.se>; Mon, 10 Jan 2011 18:56:01 +0100
Date: Mon, 10 Jan 2011 18:56:01 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: sftp size of 2GB files
In-Reply-To: <20110110172717.202280@gmx.net>
Message-ID: <alpine.DEB.2.00.1101101853400.7528@tvnag.unkk.fr>
References: <20110110172717.202280@gmx.net>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 10 Jan 2011 18:56:12 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 10 Jan 2011 18:56:01 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Mon, 10 Jan 2011, Arno Schmitt wrote:

> I'm running libssh2 with sftp file transfer under Suse Linux 11.2, 64 Bit. 
> Using function libssh2_sftp_readdir_ex() on a directory containing a 
> 2GB=2^31 byte (exatcly) file reports file size = 18446744071562067968.
>
> I've changed method libssh2_uint64_t _libssh2_ntohu64(const unsigned char 
> *buf)

Thanks!

It's not very clear to me though.

You changed it from what (or put in other words: "you should've provided the 
patch as a diff -u output")? This exact function has already been fixed in git 
(commit fd691deb1786caff). Are you saying that fix is bad or are you 
(re-)fixing the bug we had in 1.2.7 and earlier?

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Mon Jan 10 19:07:08 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0AI71ou032065;
	Mon, 10 Jan 2011 19:07:07 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0AI70oj032051
	for <libssh2-devel@cool.haxx.se>; Mon, 10 Jan 2011 19:07:00 +0100
Date: Mon, 10 Jan 2011 19:07:00 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: SCP recursive file transfer
In-Reply-To: <4D2AE0A1.5050403@gmail.com>
Message-ID: <alpine.DEB.2.00.1101101856110.7528@tvnag.unkk.fr>
References: <4D2AE0A1.5050403@gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 10 Jan 2011 19:07:08 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 10 Jan 2011 19:07:00 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Mon, 10 Jan 2011, Sunjith P S wrote:

> It would be nice if there was an API in libssh2 so that D and E SCP protocol 
> messages can be made use of for recursive copying.

I certainly wouldn't mind having explicit support for recursive SCP. Any 
thoughts on how that API would look like?

> Otherwise to implement this in client program, I guess we should use mkdir 
> with libssh2_channel_exec() or so and libssh2_scp_send64() repeatedly. Or is 
> there any better way?

None that I can think of off the top of my head, no.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Mon Jan 10 19:40:48 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0AIeX9f016024;
	Mon, 10 Jan 2011 19:40:46 +0100
Received: from mail.gmx.net (mailout-de.gmx.net [213.165.64.23])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id p0AIeVrr015890
	for <libssh2-devel@cool.haxx.se>; Mon, 10 Jan 2011 19:40:31 +0100
Received: (qmail 9748 invoked by uid 0); 10 Jan 2011 18:40:23 -0000
Received: from 141.169.250.17 by www165.gmx.net with HTTP;
	Mon, 10 Jan 2011 19:40:21 +0100 (CET)
Date: Mon, 10 Jan 2011 19:40:21 +0100
From: "Arno Schmitt" <ars-rt@gmx.de>
In-Reply-To: <alpine.DEB.2.00.1101101853400.7528@tvnag.unkk.fr>
Message-ID: <20110110184021.273100@gmx.net>
MIME-Version: 1.0
References: <20110110172717.202280@gmx.net>
	<alpine.DEB.2.00.1101101853400.7528@tvnag.unkk.fr>
Subject: Re: sftp size of 2GB files
To: libssh2-devel@cool.haxx.se
X-Authenticated: #36309713
X-Flags: 0001
X-Mailer: WWW-Mail 6100 (Global Message Exchange)
X-Priority: 3
X-Provags-ID: V01U2FsdGVkX18LYpotOPcL2nQ4ii/NNSvJSyiqq0r631ezP5dxJq
	MKtztn0BD2w7mcUJOw+Sxd9QFVr01JVrV9OQ== 
X-GMX-UID: 8zZDAJULbHIhQ6MyEzY0muIiJihyapDf
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 10 Jan 2011 19:40:48 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 10 Jan 2011 19:40:31 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Sorry for not being clear.

I use version 1.2.7 (latest release). My message relates to this version only, not to the actual git revision. If it's already fixed there forget about my message.

Best regards
Arno
-------- Original-Nachricht --------
> Datum: Mon, 10 Jan 2011 18:56:01 +0100 (CET)
> Von: Daniel Stenberg <daniel@haxx.se>
> An: libssh2 development <libssh2-devel@cool.haxx.se>
> Betreff: Re: sftp size of 2GB files

> On Mon, 10 Jan 2011, Arno Schmitt wrote:
> 
> > I'm running libssh2 with sftp file transfer under Suse Linux 11.2, 64
> Bit. 
> > Using function libssh2_sftp_readdir_ex() on a directory containing a 
> > 2GB=2^31 byte (exatcly) file reports file size = 18446744071562067968.
> >
> > I've changed method libssh2_uint64_t _libssh2_ntohu64(const unsigned
> char 
> > *buf)
> 
> Thanks!
> 
> It's not very clear to me though.
> 
> You changed it from what (or put in other words: "you should've provided
> the 
> patch as a diff -u output")? This exact function has already been fixed in
> git 
> (commit fd691deb1786caff). Are you saying that fix is bad or are you 
> (re-)fixing the bug we had in 1.2.7 and earlier?
> 
> -- 
> 
>   / daniel.haxx.se
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Jan 11 05:44:29 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0B4ZYZB002564;
	Tue, 11 Jan 2011 05:36:30 +0100
Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com
	[209.85.210.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0B4ZUID002478
	for <libssh2-devel@cool.haxx.se>; Tue, 11 Jan 2011 05:35:31 +0100
Received: by iyb26 with SMTP id 26so21380887iyb.41
	for <libssh2-devel@cool.haxx.se>; Mon, 10 Jan 2011 20:35:24 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:received:date:message-id
	:subject:from:to:content-type;
	bh=jfLGFEk1FPd5ukNAy2xhqmWkrtRRvBvYdRUMMU4bMHY=;
	b=MKKUKCNyQOxSJABxzZvnsacy9suYKJc8tFjeYep2YHUU5VPE93rtXCTtGWfG8xuqO9
	Xbl/25YxxSSc39yn6lCq3ZzVPicJlQgfYJFGpvXrjVnysb8zR9zZlPfZH98y1lIrT3Pg
	lxXqBJiB+PP2/YJHwcwgCi0MFTDpLoPN3HvM0=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=NsPBfKkOB4QDwKUKkxDPKokwwzjPPnrLPL1YjSmqZ6Sh9ViX43qhxpV/Zbbua9Vk92
	/PAMLE4grsyVQhG9jxKmSJ9DyB9WOR6bMZStjI46C3oaEg2dopUvnu/jLqYgR4qzz8VL
	rFOCB0LNQeZasvIHKxLPWfdK/OXq0zNzallzI=
MIME-Version: 1.0
Received: by 10.231.207.66 with SMTP id fx2mr29963645ibb.108.1294720524213;
	Mon, 10 Jan 2011 20:35:24 -0800 (PST)
Received: by 10.231.145.201 with HTTP; Mon, 10 Jan 2011 20:35:23 -0800 (PST)
Date: Tue, 11 Jan 2011 12:35:23 +0800
Message-ID: <AANLkTikdieizmCfaVL078Jy7e+-iZ5LdWgKJS8iHEj3j@mail.gmail.com>
Subject: multiple SFTP subsystem
From: zl liu <xieepp@gmail.com>
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 11 Jan 2011 05:36:35 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 11 Jan 2011 05:35:31 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0287237997=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============0287237997==
Content-Type: multipart/alternative; boundary=90e6ba4fc486eddfb404998a9c77

--90e6ba4fc486eddfb404998a9c77
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: quoted-printable

I want to use multiple SFTP subsystem=A3=BA
LIBSSH2_SESSION *session =3D libssh2_session_init();

LIBSSH2_SFTP *sftp_session1 =3D libssh2_sftp_init(session);
LIBSSH2_SFTP *sftp_session2 =3D libssh2_sftp_init(session);
LIBSSH2_SFTP *sftp_session3 =3D libssh2_sftp_init(session);

LIBSSH2_SFTP_HANDLE *sftp_handle1 =3D libssh2_sftp_open(sftp_sessions1, ...=
);
LIBSSH2_SFTP_HANDLE *sftp_handle2 =3D libssh2_sftp_open(sftp_sessions2, ...=
);
LIBSSH2_SFTP_HANDLE *sftp_handle3 =3D libssh2_sftp_open(sftp_sessions3, ...=
);

How to make use of this three handles to transfer files faster, thanks!

--90e6ba4fc486eddfb404998a9c77
Content-Type: text/html; charset=GB2312
Content-Transfer-Encoding: quoted-printable

<div>I want to use multiple SFTP subsystem=A3=BA</div><div>LIBSSH2_SESSION =
*session =3D libssh2_session_init();</div><div><br></div><div>LIBSSH2_SFTP =
*sftp_session1 =3D libssh2_sftp_init(session);</div><div>LIBSSH2_SFTP *sftp=
_session2 =3D libssh2_sftp_init(session);</div>
<div>LIBSSH2_SFTP *sftp_session3 =3D libssh2_sftp_init(session);</div><div>=
<br></div><div>LIBSSH2_SFTP_HANDLE *sftp_handle1 =3D libssh2_sftp_open(sftp=
_sessions1, ...);</div><div>LIBSSH2_SFTP_HANDLE *sftp_handle2 =3D libssh2_s=
ftp_open(sftp_sessions2, ...);</div>
<div>LIBSSH2_SFTP_HANDLE *sftp_handle3 =3D libssh2_sftp_open(sftp_sessions3=
, ...);</div><div><br></div><div>How to make use of this three handles to t=
ransfer files faster, thanks!</div>

--90e6ba4fc486eddfb404998a9c77--

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

--===============0287237997==--

From libssh2-devel-bounces@cool.haxx.se  Tue Jan 11 06:15:16 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0B5FBNc003218;
	Tue, 11 Jan 2011 06:15:15 +0100
Received: from mail-pz0-f54.google.com (mail-pz0-f54.google.com
	[209.85.210.54])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0B5F8I3003023
	for <libssh2-devel@cool.haxx.se>; Tue, 11 Jan 2011 06:15:09 +0100
Received: by pzk32 with SMTP id 32so4555150pzk.41
	for <libssh2-devel@cool.haxx.se>; Mon, 10 Jan 2011 21:15:02 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:message-id:date:from
	:organization:user-agent:mime-version:to:subject:references
	:in-reply-to:content-type:content-transfer-encoding;
	bh=+Sty/AEhStkqqNMgTGehqSBrAg+VKb+rujGNB+bJ14A=;
	b=b5x/hzeI4vVrq+UK7opxB1UQ8Ou37o+xj1Ic4hF2n10O+qQOCI9cY1m3QbsQmjaH8B
	yTQo04PQWA38wJRa+9KRm2NxkOLBZGF9+A0frxzNIa8mZzlaszISX9uNLcWuKNJAdsh6
	qMfka8y6JW+w4tFRq/BfApo6zHYgm4B/MEtvE=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=message-id:date:from:organization:user-agent:mime-version:to
	:subject:references:in-reply-to:content-type
	:content-transfer-encoding;
	b=HMKb+DkStFkMs63wehNZCxYTXyxSARz2VUDsOAf2lxPefg5vdPs6vSexqW/fiYE0uS
	4mdQ9eGnGmAKhs/IgED7/0dvx7C4s0vVVpVPS9rEgrRadt2prCDeK28Wp/+k2oeqwUnU
	AVNpEcSuBYQC16qUlWd8d9ZTn+sQiuANvVUzo=
Received: by 10.142.217.16 with SMTP id p16mr5240593wfg.279.1294722902422;
	Mon, 10 Jan 2011 21:15:02 -0800 (PST)
Received: from Sunjith-P-Ss-MacBook-Pro.local ([115.119.57.30])
	by mx.google.com with ESMTPS id b11sm8668643wff.9.2011.01.10.21.14.59
	(version=SSLv3 cipher=RC4-MD5); Mon, 10 Jan 2011 21:15:01 -0800 (PST)
Message-ID: <4D2BE751.2050000@gmail.com>
Date: Tue, 11 Jan 2011 10:44:57 +0530
From: Sunjith P S <sunjithps@gmail.com>
Organization: AdMod Technologies Pvt Ltd.
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US;
	rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4
MIME-Version: 1.0
To: libssh2-devel@cool.haxx.se
Subject: Re: SCP recursive file transfer
References: <4D2AE0A1.5050403@gmail.com>
	<alpine.DEB.2.00.1101101856110.7528@tvnag.unkk.fr>
In-Reply-To: <alpine.DEB.2.00.1101101856110.7528@tvnag.unkk.fr>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 11 Jan 2011 06:15:16 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 11 Jan 2011 06:15:09 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

  On 10/01/11 11:37 PM, Daniel Stenberg wrote:
> On Mon, 10 Jan 2011, Sunjith P S wrote:
>
>> It would be nice if there was an API in libssh2 so that D and E SCP 
>> protocol messages can be made use of for recursive copying.
>
> I certainly wouldn't mind having explicit support for recursive SCP. 
> Any thoughts on how that API would look like?
Something like:
ssize_t libssh2_scp_send_recursive(LIBSSH2_SESSION *session, const char 
*src_path, const char *dst_path);

It should open a channel internally with the given session, read 
recursively from source directory and send the directories and files 
using D, E, C & T scp protocol messages. The modes for D & C messages, 
lengths for C messages and atimes & mtimes for T messages can be read 
from local filesystem.

Return value: No. of bytes transferred or negative on failure.
Errors: appropriate LIBSSH2_ERROR_*

We may need a function like scp_send in scp.c with "scp -rt " option in 
scpSend_command and mechanism to loop on src_path recursively and 
sending appropriate protocol messages and file data.

Thank you.

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

From libssh2-devel-bounces@cool.haxx.se  Tue Jan 11 06:15:48 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0B53AAk023024;
	Tue, 11 Jan 2011 06:03:16 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id p0B538nS022971
	for <libssh2-devel@cool.haxx.se>; Tue, 11 Jan 2011 06:03:08 +0100
Received: (qmail 8643 invoked by uid 501); 11 Jan 2011 05:03:07 -0000
Message-ID: <20110111050307.8642.qmail@stuge.se>
Date: Tue, 11 Jan 2011 06:03:07 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: multiple SFTP subsystem
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <AANLkTikdieizmCfaVL078Jy7e+-iZ5LdWgKJS8iHEj3j@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <AANLkTikdieizmCfaVL078Jy7e+-iZ5LdWgKJS8iHEj3j@mail.gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 11 Jan 2011 06:03:17 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 11 Jan 2011 06:03:08 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

emwgbGl1IHdyb3RlOgo+IEkgd2FudCB0byB1c2UgbXVsdGlwbGUgU0ZUUCBzdWJzeXN0ZW3vvJoK
PiBMSUJTU0gyX1NFU1NJT04gKnNlc3Npb24gPSBsaWJzc2gyX3Nlc3Npb25faW5pdCgpOwo+IAo+
IExJQlNTSDJfU0ZUUCAqc2Z0cF9zZXNzaW9uMSA9IGxpYnNzaDJfc2Z0cF9pbml0KHNlc3Npb24p
Owo+IExJQlNTSDJfU0ZUUCAqc2Z0cF9zZXNzaW9uMiA9IGxpYnNzaDJfc2Z0cF9pbml0KHNlc3Np
b24pOwo+IExJQlNTSDJfU0ZUUCAqc2Z0cF9zZXNzaW9uMyA9IGxpYnNzaDJfc2Z0cF9pbml0KHNl
c3Npb24pOwo+IAo+IExJQlNTSDJfU0ZUUF9IQU5ETEUgKnNmdHBfaGFuZGxlMSA9IGxpYnNzaDJf
c2Z0cF9vcGVuKHNmdHBfc2Vzc2lvbnMxLCAuLi4pOwo+IExJQlNTSDJfU0ZUUF9IQU5ETEUgKnNm
dHBfaGFuZGxlMiA9IGxpYnNzaDJfc2Z0cF9vcGVuKHNmdHBfc2Vzc2lvbnMyLCAuLi4pOwo+IExJ
QlNTSDJfU0ZUUF9IQU5ETEUgKnNmdHBfaGFuZGxlMyA9IGxpYnNzaDJfc2Z0cF9vcGVuKHNmdHBf
c2Vzc2lvbnMzLCAuLi4pOwo+IAo+IEhvdyB0byBtYWtlIHVzZSBvZiB0aGlzIHRocmVlIGhhbmRs
ZXMgdG8gdHJhbnNmZXIgZmlsZXMgZmFzdGVyLCB0aGFua3MhCgpUaGlzIGRvZXMgbm90IG1ha2Ug
eW91ciB0cmFuc2ZlciBmYXN0ZXIgYmVjYXVzZSBhcyB5b3UgcHJvYmFibHkga25vdwp0aGUgU0ZU
UCBjaGFubmVscyBhcmUgY29tYmluZWQgaW4gb25lIHNlc3Npb24sIHdoaWNoIG1lYW5zIGluIG9u
ZSBUQ1AKY29ubmVjdGlvbi4KCkkgdGhpbmsgeW91IG9ubHkgaGF2ZSB0d28gY2hvaWNlczoKCjEu
IEhlbHAgdXMgaW1wcm92ZSBwZXJmb3JtYW5jZSBvZiB0aGUgbGlic3NoMiB0cmFuc3BvcnQgbGF5
ZXIuCjIuIFVzZSBtdWx0aXBsZSBzZXBhcmF0ZSBUQ1AgY29ubmVjdGlvbnMgdG8gdGhlIHNlcnZl
ci4gTm90ZSB0aGF0CnRoaXMgaXMgcmF0aGVyIHVnbHkgYmVoYXZpb3IgZm9yIGEgY2xpZW50LCBh
bmQgbm90ZSB0aGF0IHlvdSBtdXN0CmF1dGhlbnRpY2F0ZSBlYWNoIGNvbm5lY3Rpb24uCgoKLy9Q
ZXRlcgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpsaWJz
c2gyLWRldmVsIGh0dHA6Ly9jb29sLmhheHguc2UvY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL2xp
YnNzaDItZGV2ZWwK

From libssh2-devel-bounces@cool.haxx.se  Tue Jan 11 07:12:46 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0B6C4ip007036;
	Tue, 11 Jan 2011 07:12:43 +0100
Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com
	[209.85.210.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0B6C1kK006944
	for <libssh2-devel@cool.haxx.se>; Tue, 11 Jan 2011 07:12:02 +0100
Received: by iyb26 with SMTP id 26so21433961iyb.41
	for <libssh2-devel@cool.haxx.se>; Mon, 10 Jan 2011 22:11:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:received:in-reply-to
	:references:date:message-id:subject:from:to:content-type;
	bh=UN0jpt3NU2lxur05intIKTXN1p33Bzk55iKnGf0BUoc=;
	b=JFr/iVakdIkFevD4c5tAOUnMl9MvomK4yJ19KiKZiUv0HL48I4OZMfsRpJU8C8d03A
	ifAXFk4/55py5xdECWzm+fzFPY4LFK9DPcyUgKPjywxLHEIzMs34hY+qrBH0hg/D0/eP
	9vM2EaYUlsYdybg8bQQYuxpMC1HQ4Py3TITtg=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type;
	b=gT7DGvPomyzwxUYV4/QHpSV0cgtKrBzXvuyx7JFTCGU9ksCVIzXuVw+wBUjaNDlmiE
	/b6dflektZZdfROqyTGHeTN34QbcR21FlBmEkr6/zcZg43PjEkSAJtNtu6Hr09MjdUPe
	Baj9BNbsxBeQ12AkcVchcVtas2oK3cDWOBlb8=
MIME-Version: 1.0
Received: by 10.231.14.199 with SMTP id h7mr13802593iba.158.1294726314823;
	Mon, 10 Jan 2011 22:11:54 -0800 (PST)
Received: by 10.231.145.201 with HTTP; Mon, 10 Jan 2011 22:11:54 -0800 (PST)
In-Reply-To: <20110111050307.8642.qmail@stuge.se>
References: <AANLkTikdieizmCfaVL078Jy7e+-iZ5LdWgKJS8iHEj3j@mail.gmail.com>
	<20110111050307.8642.qmail@stuge.se>
Date: Tue, 11 Jan 2011 14:11:54 +0800
Message-ID: <AANLkTinM72S7B+TNnwv6UEcAuMX8MkdFbatF_yAYJUeX@mail.gmail.com>
Subject: Re: multiple SFTP subsystem
From: zl liu <xieepp@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 11 Jan 2011 07:12:45 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 11 Jan 2011 07:12:02 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1994124070=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============1994124070==
Content-Type: multipart/alternative; boundary=002354332a261390d204998bf62c

--002354332a261390d204998bf62c
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: quoted-printable

Thanks for answer!

I have used multiple separate TCP connections a long time,in my usage
 the network usage can increased to 32% form 4% than one connection,
 and i split file into several parts to transfer together. as you said it's
ugly,
but i think it's no better way so far.  thanks again.

// Liu
2011/1/11 Peter Stuge <peter@stuge.se>

> zl liu wrote:
> > I want to use multiple SFTP subsystem=A3=BA
> > LIBSSH2_SESSION *session =3D libssh2_session_init();
> >
> > LIBSSH2_SFTP *sftp_session1 =3D libssh2_sftp_init(session);
> > LIBSSH2_SFTP *sftp_session2 =3D libssh2_sftp_init(session);
> > LIBSSH2_SFTP *sftp_session3 =3D libssh2_sftp_init(session);
> >
> > LIBSSH2_SFTP_HANDLE *sftp_handle1 =3D libssh2_sftp_open(sftp_sessions1,
> ...);
> > LIBSSH2_SFTP_HANDLE *sftp_handle2 =3D libssh2_sftp_open(sftp_sessions2,
> ...);
> > LIBSSH2_SFTP_HANDLE *sftp_handle3 =3D libssh2_sftp_open(sftp_sessions3,
> ...);
> >
> > How to make use of this three handles to transfer files faster, thanks!
>
> This does not make your transfer faster because as you probably know
> the SFTP channels are combined in one session, which means in one TCP
> connection.
>
> I think you only have two choices:
>
> 1. Help us improve performance of the libssh2 transport layer.
> 2. Use multiple separate TCP connections to the server. Note that
> this is rather ugly behavior for a client, and note that you must
> authenticate each connection.
>
>
> //Peter
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>

--002354332a261390d204998bf62c
Content-Type: text/html; charset=GB2312
Content-Transfer-Encoding: quoted-printable

Thanks for answer!<br><br><div>I have&nbsp;used multiple separate TCP conne=
ctions a long time,in my usage</div><div>&nbsp;the network usage can&nbsp;i=
ncreased to 32% form 4%&nbsp;than one connection,</div><div>&nbsp;and i&nbs=
p;split file into several parts to transfer together.&nbsp;as you said it&#=
39;s ugly,</div>
<div>but i think it&#39;s no better way so far. &nbsp;thanks again.</div><d=
iv><br></div><div>// Liu</div><div><div class=3D"gmail_quote">2011/1/11 Pet=
er Stuge <span dir=3D"ltr">&lt;<a href=3D"mailto:peter@stuge.se">peter@stug=
e.se</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;"><div><div></div><div class=3D"h5">zl liu wr=
ote:<br>
&gt; I want to use multiple SFTP subsystem=A3=BA<br>
&gt; LIBSSH2_SESSION *session =3D libssh2_session_init();<br>
&gt;<br>
&gt; LIBSSH2_SFTP *sftp_session1 =3D libssh2_sftp_init(session);<br>
&gt; LIBSSH2_SFTP *sftp_session2 =3D libssh2_sftp_init(session);<br>
&gt; LIBSSH2_SFTP *sftp_session3 =3D libssh2_sftp_init(session);<br>
&gt;<br>
&gt; LIBSSH2_SFTP_HANDLE *sftp_handle1 =3D libssh2_sftp_open(sftp_sessions1=
, ...);<br>
&gt; LIBSSH2_SFTP_HANDLE *sftp_handle2 =3D libssh2_sftp_open(sftp_sessions2=
, ...);<br>
&gt; LIBSSH2_SFTP_HANDLE *sftp_handle3 =3D libssh2_sftp_open(sftp_sessions3=
, ...);<br>
&gt;<br>
&gt; How to make use of this three handles to transfer files faster, thanks=
!<br>
<br>
</div></div>This does not make your transfer faster because as you probably=
 know<br>
the SFTP channels are combined in one session, which means in one TCP<br>
connection.<br>
<br>
I think you only have two choices:<br>
<br>
1. Help us improve performance of the libssh2 transport layer.<br>
2. Use multiple separate TCP connections to the server. Note that<br>
this is rather ugly behavior for a client, and note that you must<br>
authenticate each connection.<br>
<br>
<br>
//Peter<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>
</blockquote></div><br></div>

--002354332a261390d204998bf62c--

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

--===============1994124070==--

From libssh2-devel-bounces@cool.haxx.se  Tue Jan 11 09:08:45 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0B886UX015325;
	Tue, 11 Jan 2011 09:08:41 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0B884R1015309
	for <libssh2-devel@cool.haxx.se>; Tue, 11 Jan 2011 09:08:04 +0100
Date: Tue, 11 Jan 2011 09:08:04 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: multiple SFTP subsystem
In-Reply-To: <AANLkTinM72S7B+TNnwv6UEcAuMX8MkdFbatF_yAYJUeX@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1101110905390.2218@tvnag.unkk.fr>
References: <AANLkTikdieizmCfaVL078Jy7e+-iZ5LdWgKJS8iHEj3j@mail.gmail.com>
	<20110111050307.8642.qmail@stuge.se>
	<AANLkTinM72S7B+TNnwv6UEcAuMX8MkdFbatF_yAYJUeX@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 11 Jan 2011 09:08:45 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 11 Jan 2011 09:08:04 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Tue, 11 Jan 2011, zl liu wrote:

> I have used multiple separate TCP connections a long time,in my usage the 
> network usage can increased to 32% form 4% than one connection, and i split 
> file into several parts to transfer together. as you said it's ugly, but i 
> think it's no better way so far.  thanks again.

We've done consierable SFTP performance improvements in the current git 
version, and I've reported about these in the past.

We will of course appreciate your feedback on tests done on the current code 
to see how we do right now.

I want to make a release with this code, but we're still suffering from a few 
bugs (regressions) I want fixed before shipping.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Tue Jan 11 12:12:18 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0BBBriq032166;
	Tue, 11 Jan 2011 12:12:14 +0100
Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com
	[209.85.210.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0BBBo89032107
	for <libssh2-devel@cool.haxx.se>; Tue, 11 Jan 2011 12:11:51 +0100
Received: by iyb26 with SMTP id 26so21628623iyb.41
	for <libssh2-devel@cool.haxx.se>; Tue, 11 Jan 2011 03:11:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:mime-version:received:from:date
	:message-id:subject:to:content-type;
	bh=Qzqd76X7fBvUlWe80kB/0a2Qz2GYX8ZUD6iUZq3fTbk=;
	b=gfct07tQPh9p59LUA9tDDCDQRATvY8MmxWTerywK/87/50kfeUhW5ZF01l40iFVjEa
	bsdVv379DKM91gcn9dyHVbMVCoyGEaG7+4iEYcr3ltn1zBKAG0SRqB3dLFy6u1TLUhbl
	PA/TNt+pE887HcN6seGFvCaIFnNnRotI2GlCU=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:from:date:message-id:subject:to:content-type;
	b=unQoFEJNMJE+2IW0TGfBl7BLNK16qK9DFIt37+ToCy5mPlkLt5FJ3JnCb6C6D57IGV
	SBZTrfihqnoso5aVNrQgOJFNTva56ajMH2YLjjv+ffBcNMzzQ5wXFXrnvfpr5ks6lhTT
	UDmHMh7k+Xoqd0/PbsG3IlMau9TtKa/+ZQpms=
Received: by 10.231.37.70 with SMTP id w6mr20165140ibd.169.1294744302159; Tue,
	11 Jan 2011 03:11:42 -0800 (PST)
MIME-Version: 1.0
Received: by 10.231.85.204 with HTTP; Tue, 11 Jan 2011 03:11:21 -0800 (PST)
From: Dmitry Teslenko <dteslenko@gmail.com>
Date: Tue, 11 Jan 2011 14:11:21 +0300
Message-ID: <AANLkTinLiX16m_E74Yu0ioNUkbx8QC2fjKoOpNz1VTJL@mail.gmail.com>
Subject: need help on multiple direct tcpip channels
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 11 Jan 2011 12:12:18 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 11 Jan 2011 12:11:51 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hello!
Is libssh2 capable of creating mutiple direct tcpip channels on win32
platform?
Is it capable of connect to one host and forward port to another host,
i.e. -L<port>:<one host>:<port> <user>@<another host>?

I there's not so much open source software that uses libssh2 to
look for example. I found medusa, ksftpgrabber and perl/php bindings only.
Can you point to usable example or provide hint how to do it?

I guess channel init should be in blocking mode and
data transfer should be in non-blocking mode. And blocking is global
for all session. There's no example of proper
channel shutdown also. Help to figure how to use library. Please.

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Jan 11 14:29:55 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0BDTjTB023447;
	Tue, 11 Jan 2011 14:29:54 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0BDTibE023441
	for <libssh2-devel@cool.haxx.se>; Tue, 11 Jan 2011 14:29:44 +0100
Date: Tue, 11 Jan 2011 14:29:44 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: need help on multiple direct tcpip channels
In-Reply-To: <AANLkTinLiX16m_E74Yu0ioNUkbx8QC2fjKoOpNz1VTJL@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1101111423320.2218@tvnag.unkk.fr>
References: <AANLkTinLiX16m_E74Yu0ioNUkbx8QC2fjKoOpNz1VTJL@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 11 Jan 2011 14:29:55 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 11 Jan 2011 14:29:44 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Tue, 11 Jan 2011, Dmitry Teslenko wrote:

> Is libssh2 capable of creating mutiple direct tcpip channels on win32 
> platform?

I'm not aware of anything that would limit that ability so I would say yes.

> Is it capable of connect to one host and forward port to another host,
> i.e. -L<port>:<one host>:<port> <user>@<another host>?

Yes.

> I there's not so much open source software that uses libssh2 to look for 
> example.

Right. libssh2 is still to be discovered by the world! =)

> Can you point to usable example or provide hint how to do it?

I can only point to our docs, our examples and our source code.

> I guess channel init should be in blocking mode

You never _need_ to use blocking mode, but you can most often opt to use it.

> data transfer should be in non-blocking mode.

Yes, mostly due to the fact that you currently can't really figure out which 
channel that has traffic when you know there's something to read from the 
socket so you need to check them all and then you don't want to block on any.

> And blocking is global for all session.

I don't see the point with having it finer grained that so. Do you?

> There's no example of proper channel shutdown also.

libssh2_channel_close ?

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Wed Jan 12 06:58:13 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0C5vmvD013736;
	Wed, 12 Jan 2011 06:58:10 +0100
Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com
	[209.85.210.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0C5vk4S013673
	for <libssh2-devel@cool.haxx.se>; Wed, 12 Jan 2011 06:57:47 +0100
Received: by iyb26 with SMTP id 26so230790iyb.41
	for <libssh2-devel@cool.haxx.se>; Tue, 11 Jan 2011 21:57:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:date:message-id:subject:from:to
	:content-type; bh=XuGk9n8XcGRD3lL2e/BOUG0Lpe5wVOP8bhbDfCEgYSg=;
	b=NXIfEkUpzpPwSB3hcdepVz7mzw33u8argYhouYwLNsDhHHHxU0qjJsA/mXqU4x3r/z
	Q7Vp6sBnF/qqoAcKTob8INVmOrpK+V3VPVaWug3kgVPWuFxB0UnqgCek4yrKSf/5pHqa
	yskTCmunD9+nWAsrbVbwYhiWyAllvoIMvljgg=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=vXa4bIFG5qszqGtKkQW3ZNKhwaESy2EFaDcuiHSUBR3U91GLvPZxoTDc4F6MeyhqCd
	dnHVzT+prtjNH8VqF8BW/ErO+7l4iUoogs1977ONSpTjaEqqY1OMCyyPGt7a1BBtnpUG
	+MHfAcC6upE2xn7YvLlOp2WZ+h9CkGEEEZbK0=
MIME-Version: 1.0
Received: by 10.231.207.66 with SMTP id fx2mr561615ibb.108.1294811861162; Tue,
	11 Jan 2011 21:57:41 -0800 (PST)
Received: by 10.231.145.201 with HTTP; Tue, 11 Jan 2011 21:57:41 -0800 (PST)
Date: Wed, 12 Jan 2011 13:57:41 +0800
Message-ID: <AANLkTins8uw3iwdrbWYof+6ak3x8hEN8aNgq_xXWmoKh@mail.gmail.com>
Subject: libssh2-1.2.8-20110111 issue
From: zl liu <xieepp@gmail.com>
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 12 Jan 2011 06:58:13 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 12 Jan 2011 06:57:47 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1464681586=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============1464681586==
Content-Type: multipart/alternative; boundary=90e6ba4fc486091d9004999fe1fb

--90e6ba4fc486091d9004999fe1fb
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: quoted-printable

hello everyone=A3=A1
The testing of libssh2-1.2.8-20110111=A3=AC
Compiled with visual c++ 6.0 and has following errors=A3=BA
libssh2-1.2.8-20110111\src\session.c(359) : error C2065: 'socklen_t' :
undeclared identifier

Also has two linking errors=A3=BA
Linking...
   Creating library Release_dll/libssh2.lib and object
Release_dll/libssh2.exp
agent.obj : error LNK2001: unresolved external symbol __imp__FindWindowA@8
agent.obj : error LNK2001: unresolved external symbol __imp__SendMessageA@1=
6

execute the example sftp_write_nonblock.c with
lib 1.2.7:
Fingerprint: BA 7C C3 63 61 E6 CB A1 52 82 00 E3 F7 8F C3 7E 5C 85 DA 54
libssh2_sftp_init()!
libssh2_sftp_open()!
libssh2_sftp_open() is done, now send data!
30989877 bytes in 81 seconds makes 382591.1 bytes/sec
all done

lib 1.2.8
Fingerprint: BA 7C C3 63 61 E6 CB A1 52 82 00 E3 F7 8F C3 7E 5C 85 DA 54
libssh2_sftp_init()!
libssh2_sftp_open()!
libssh2_sftp_open() is done, now send data!
30989877 bytes in 61 seconds makes 508030.8 bytes/sec
all done

the performance has increased 32%=A3=BA
*(508 030.8 - 382 591.1) / 382 591.1 =3D 0.32786884*

--90e6ba4fc486091d9004999fe1fb
Content-Type: text/html; charset=GB2312
Content-Transfer-Encoding: quoted-printable

hello everyone=A3=A1<div>The testing&nbsp;of libssh2-1.2.8-20110111=A3=AC</=
div><div>Compiled with visual c++ 6.0 and has following errors=A3=BA</div><=
div>libssh2-1.2.8-20110111\src\session.c(359) : error C2065: &#39;socklen_t=
&#39; : undeclared identifier</div>
<div><br></div><div>Also has two linking errors=A3=BA</div><div><div>Linkin=
g...</div><div>&nbsp;&nbsp; Creating library Release_dll/libssh2.lib and ob=
ject Release_dll/libssh2.exp</div><div>agent.obj : error LNK2001: unresolve=
d external symbol __imp__FindWindowA@8</div>
<div>agent.obj : error LNK2001: unresolved external symbol __imp__SendMessa=
geA@16</div></div><div><br></div><div>execute the example sftp_write_nonblo=
ck.c with</div><div>lib 1.2.7:</div><div><div>Fingerprint: BA 7C C3 63 61 E=
6 CB A1 52 82 00 E3 F7 8F C3 7E 5C 85 DA 54</div>
<div>libssh2_sftp_init()!</div><div>libssh2_sftp_open()!</div><div>libssh2_=
sftp_open() is done, now send data!</div><div>30989877 bytes in 81 seconds =
makes 382591.1 bytes/sec</div><div>all done</div></div><div><br></div><div>
lib 1.2.8</div><div><div>Fingerprint: BA 7C C3 63 61 E6 CB A1 52 82 00 E3 F=
7 8F C3 7E 5C 85 DA 54</div><div>libssh2_sftp_init()!</div><div>libssh2_sft=
p_open()!</div><div>libssh2_sftp_open() is done, now send data!</div><div>
30989877 bytes in 61 seconds makes 508030.8 bytes/sec</div><div>all done</d=
iv></div><div><br></div><div>the performance has increased 32%=A3=BA</div><=
div><span class=3D"Apple-style-span" style=3D"font-family: arial, sans-seri=
f; font-size: 18px; line-height: 17px; -webkit-border-horizontal-spacing: 2=
px; -webkit-border-vertical-spacing: 2px; "><b>(508<font size=3D"-2">&nbsp;=
</font>030.8 - 382<font size=3D"-2">&nbsp;</font>591.1) / 382<font size=3D"=
-2">&nbsp;</font>591.1 =3D 0.32786884</b></span></div>

--90e6ba4fc486091d9004999fe1fb--

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

--===============1464681586==--

From libssh2-devel-bounces@cool.haxx.se  Wed Jan 12 22:24:07 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0CLNiRi027583;
	Wed, 12 Jan 2011 22:24:04 +0100
Received: from MTA.quazal.local (mail.quazal.com [64.254.252.195])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0CLJ3QU025200
	(version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 12 Jan 2011 22:19:05 +0100
Received: from MTA.quazal.local ([fe80::49b5:4dd6:ecb4:292c]) by
	MTA.quazal.local ([fe80::49b5:4dd6:ecb4:292c%13]) with mapi id
	14.01.0270.001; Wed, 12 Jan 2011 16:19:45 -0500
From: Philippe Lemoine <plemoine@quazal.com>
To: "'libssh2-devel@cool.haxx.se'" <'libssh2-devel@cool.haxx.se'>
Subject: Platforms with lengthy disconnection timeouts
Thread-Topic: Platforms with lengthy disconnection timeouts
Thread-Index: AcuymuJ+6YwCqn0BRzyHA2StfQde+wAA2BAg
Date: Wed, 12 Jan 2011 21:19:45 +0000
Message-ID: <4343B29C56C61444A66123E4644FC9A205741A@MTA.quazal.local>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [192.168.20.53]
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 12 Jan 2011 22:24:07 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 12 Jan 2011 22:19:05 +0100 (CET)
X-Mailman-Approved-At: Wed, 12 Jan 2011 22:23:43 +0100
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0139187605=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============0139187605==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_4343B29C56C61444A66123E4644FC9A205741AMTAquazallocal_"

--_000_4343B29C56C61444A66123E4644FC9A205741AMTAquazallocal_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable



Hello,

We are using libssh2 1.2.4 with libCurl 7.18.2.

What is the best approach to make libssh2 react very quickly upon a physica=
l disconnection, in the case the platform on which we are running don`t det=
ect those events immediately on the socket level?

We have some workaround where, at the moment a fault is detected through an=
other online service (i.e. caused by a failed heartbeat): we pre-emptively =
call closesocket() on the channel on which the transfer is in progress. We =
confirmed with engineers of this platform (Sony PS3) that it is expected th=
at the comm layer does not react quickly.

However, as our customer reported, the transfer still attempt to resume if =
the cable pulled is between the wall and the router.  So, is there a way to=
 configure libssh2 or libcurl to react accordingly? Is there something I am=
 missing?

Thanks!


Philippe Lemoine
Senior Software Designer
555, boulevard Rene-Levesque Ouest
Montreal, QC, Canada
H2Z 1B1
Tel: 1-514-395-4646 x211
Fax: 1-514-395-6006


--_000_4343B29C56C61444A66123E4644FC9A205741AMTAquazallocal_
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-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@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:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-fareast-language:EN-US;}
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;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
span.EmailStyle18
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></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=3D"EN-CA" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span style=3D"color:#1F497D"><o:p>&nbsp;</o:p></spa=
n></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Hello,<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">We are using libssh2 1.2.4 with libCurl 7.18.2.<o:p>=
</o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">What is the best approach to make libssh2 react very=
 quickly upon a physical disconnection, in the case the platform on which w=
e are running don`t detect those events immediately on the socket level?<o:=
p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">We have some workaround where, at the moment a fault=
 is detected through another online service (i.e. caused by a failed heartb=
eat): we pre-emptively call closesocket() on the channel on which the trans=
fer is in progress. We confirmed with
 engineers of this platform (Sony PS3) that it is expected that the comm la=
yer does not react quickly.<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">However, as our customer reported, the transfer stil=
l attempt to resume if the cable pulled is between the wall and the router.=
 &nbsp;So, is there a way to configure libssh2 or libcurl to react accordin=
gly? Is there something I am missing?<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal">Thanks!<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
<p class=3D"MsoNormal"><b><span style=3D"font-family:&quot;Arial&quot;,&quo=
t;sans-serif&quot;;mso-fareast-language:EN-CA">Philippe Lemoine<o:p></o:p><=
/span></b></p>
<p class=3D"MsoNormal"><b><span style=3D"font-family:&quot;Arial&quot;,&quo=
t;sans-serif&quot;;mso-fareast-language:EN-CA">Senior Software Designer<o:p=
></o:p></span></b></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Arial&quot;,&quot;s=
ans-serif&quot;;color:black;mso-fareast-language:EN-CA">555, boulevard Rene=
-Levesque Ouest<br>
Montreal, QC, Canada </span><span style=3D"color:black;mso-fareast-language=
:EN-CA"><o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Arial&quot;,&quot;s=
ans-serif&quot;;color:black;mso-fareast-language:EN-CA">H2Z 1B1<br>
Tel: 1-514-395-4646</span><span style=3D"mso-fareast-language:EN-CA"> x211<=
o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-family:&quot;Arial&quot;,&quot;s=
ans-serif&quot;;color:black;mso-fareast-language:EN-CA">Fax: 1-514-395-6006=
<o:p></o:p></span></p>
<p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>

--_000_4343B29C56C61444A66123E4644FC9A205741AMTAquazallocal_--

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

--===============0139187605==--

From libssh2-devel-bounces@cool.haxx.se  Wed Jan 12 22:58:09 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0CLvxWk016983;
	Wed, 12 Jan 2011 22:58:07 +0100
Received: from ponderosa.fch.wimsey.bc.ca (zz20920564179.cipherkey.net
	[209.205.64.179])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0CLvuKh016947
	for <libssh2-devel@cool.haxx.se>; Wed, 12 Jan 2011 22:57:58 +0100
Received: by coneharvesters.com
	via sendmail with stdio id <m1Pd8hP-000l6IC@ponderosa.fch.wimsey.bc.ca>
	for libssh2-devel@cool.haxx.se; Wed, 12 Jan 2011 13:57:47 -0800 (PST)
Date: Wed, 12 Jan 2011 13:57:46 -0800
From: Dan Fandrich <dan@coneharvesters.com>
To: libssh2-devel@cool.haxx.se
Subject: Re: Platforms with lengthy disconnection timeouts
Message-ID: <20110112215743.GB21163@coneharvesters.com>
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <4343B29C56C61444A66123E4644FC9A205741A@MTA.quazal.local>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <4343B29C56C61444A66123E4644FC9A205741A@MTA.quazal.local>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 12 Jan 2011 22:58:09 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 12 Jan 2011 22:57:58 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Wed, Jan 12, 2011 at 09:19:45PM +0000, Philippe Lemoine wrote:
> We are using libssh2 1.2.4 with libCurl 7.18.2.
> 
> What is the best approach to make libssh2 react very quickly upon a physical
> disconnection, in the case the platform on which we are running don`t detect
> those events immediately on the socket level?

If you're using libssh2 through libcurl, then this question should be posed to
the libcurl mailing list, since libcurl abstracts libssh2 entirely away.
This is actually a libcurl FAQ:
http://curl.haxx.se/docs/faq.html#Why_doesn_t_cURL_return_an_error

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

From libssh2-devel-bounces@cool.haxx.se  Wed Jan 12 23:56:35 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0CMuOHD023902;
	Wed, 12 Jan 2011 23:56:34 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id p0CMuMSp023877
	for <libssh2-devel@cool.haxx.se>; Wed, 12 Jan 2011 23:56:22 +0100
Received: (qmail 23312 invoked by uid 501); 12 Jan 2011 22:56:18 -0000
Message-ID: <20110112225618.23311.qmail@stuge.se>
Date: Wed, 12 Jan 2011 23:56:18 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: Platforms with lengthy disconnection timeouts
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <4343B29C56C61444A66123E4644FC9A205741A@MTA.quazal.local>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <4343B29C56C61444A66123E4644FC9A205741A@MTA.quazal.local>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 12 Jan 2011 23:56:34 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 12 Jan 2011 23:56:22 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Philippe Lemoine wrote:
> What is the best approach to make libssh2 react very quickly upon a
> physical disconnection, in the case the platform on which we are
> running don`t detect those events immediately on the socket level?

How would libssh2 know more than the operating system?

What you write doesn't make sense at all.


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

From libssh2-devel-bounces@cool.haxx.se  Wed Jan 12 23:57:57 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0CMvuoS024798;
	Wed, 12 Jan 2011 23:57:57 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0CMvsVu024787
	for <libssh2-devel@cool.haxx.se>; Wed, 12 Jan 2011 23:57:54 +0100
Date: Wed, 12 Jan 2011 23:57:54 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Platforms with lengthy disconnection timeouts
In-Reply-To: <20110112225618.23311.qmail@stuge.se>
Message-ID: <alpine.DEB.2.00.1101122357210.5355@tvnag.unkk.fr>
References: <4343B29C56C61444A66123E4644FC9A205741A@MTA.quazal.local>
	<20110112225618.23311.qmail@stuge.se>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 12 Jan 2011 23:57:57 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 12 Jan 2011 23:57:54 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Wed, 12 Jan 2011, Peter Stuge wrote:

>> What is the best approach to make libssh2 react very quickly upon a 
>> physical disconnection, in the case the platform on which we are running 
>> don`t detect those events immediately on the socket level?
>
> How would libssh2 know more than the operating system?

Is this a question about using keep-alive to make libssh2 detect disconnects 
better/faster?

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Thu Jan 13 00:10:41 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0CNAcW6000803;
	Thu, 13 Jan 2011 00:10:40 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id p0CNAboo000790
	for <libssh2-devel@cool.haxx.se>; Thu, 13 Jan 2011 00:10:37 +0100
Received: (qmail 25362 invoked by uid 501); 12 Jan 2011 23:10:33 -0000
Message-ID: <20110112231033.25361.qmail@stuge.se>
Date: Thu, 13 Jan 2011 00:10:33 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: Platforms with lengthy disconnection timeouts
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <4343B29C56C61444A66123E4644FC9A205741A@MTA.quazal.local>
	<20110112225618.23311.qmail@stuge.se>
	<alpine.DEB.2.00.1101122357210.5355@tvnag.unkk.fr>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.00.1101122357210.5355@tvnag.unkk.fr>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 13 Jan 2011 00:10:40 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 13 Jan 2011 00:10:37 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Daniel Stenberg wrote:
>>> What is the best approach to make libssh2 react very quickly upon a 
>>> physical disconnection, in the case the platform on which we are
>>> running don`t detect those events immediately on the socket level?
>>
>> How would libssh2 know more than the operating system?
>
> Is this a question about using keep-alive to make libssh2 detect 
> disconnects better/faster?

I interpret it to be about libssh2 detecting link loss when the
operating system can not, which does not make sense, and in fact
short-circuits a big chunk of TCP functionality.

If you want fast link drop detection in your TCP stack then really
you have to tweak your TCP stack. libssh2 can't do much about it..


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

From libssh2-devel-bounces@cool.haxx.se  Thu Jan 13 03:21:23 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0D2L0Zm004127;
	Thu, 13 Jan 2011 03:21:21 +0100
Received: from dns-factory.at (mail.dns-factory.at [194.242.35.75])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0D2Kw05004082
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 13 Jan 2011 03:20:58 +0100
Received: from [172.17.100.7] lists@gknw.net [84.63.11.57]
	by dns-factory.at with NetMail SMTP Agent $Revision: 8582 $ on Novell
	NetWare via secured & encrypted transport (TLS);
	Thu, 13 Jan 2011 03:20:44 +0100
Message-ID: <4D2E614B.1060207@gknw.net>
Date: Thu, 13 Jan 2011 03:19:55 +0100
From: Guenter <lists@gknw.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de;
	rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7
MIME-Version: 1.0
To: libssh2-devel@cool.haxx.se
Subject: Re: libssh2-1.2.8-20110111 issue
References: <AANLkTins8uw3iwdrbWYof+6ak3x8hEN8aNgq_xXWmoKh@mail.gmail.com>
In-Reply-To: <AANLkTins8uw3iwdrbWYof+6ak3x8hEN8aNgq_xXWmoKh@mail.gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 13 Jan 2011 03:21:23 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 13 Jan 2011 03:20:58 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: base64
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

SGksCkFtIDEyLjAxLjIwMTEgMDY6NTcsIHNjaHJpZWIgemwgbGl1Ogo+IFRoZSB0ZXN0aW5nIG9m
IGxpYnNzaDItMS4yLjgtMjAxMTAxMTGjrAo+IENvbXBpbGVkIHdpdGggdmlzdWFsIGMrKyA2LjAg
YW5kIGhhcyBmb2xsb3dpbmcgZXJyb3Jzo7oKPiBsaWJzc2gyLTEuMi44LTIwMTEwMTExXHNyY1xz
ZXNzaW9uLmMoMzU5KSA6IGVycm9yIEMyMDY1OiAnc29ja2xlbl90JyA6Cj4gdW5kZWNsYXJlZCBp
ZGVudGlmaWVyCndlIGRvbnQgc3VwcG9ydCBWQyA2LjAgd2l0aG91dCBQU0RLOyBpZiB5b3UgcmVh
bGx5IHdhbnQgdG8gY29tcGlsZSB3aXRoCjEyKyB5ZWFyIG9sZCBoZWFkZXJzIHRoZW4geW91IG5l
ZWQgdG8gYWRkIGEgbGluZQp0eXBlZGVmIGludCBzb2NrbGVuX3Q7CnRvIHlvdXIgd2luc29jazIu
aCBoZWFkZXIuCgpHqLluLgoKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fCmxpYnNzaDItZGV2ZWwgaHR0cDovL2Nvb2wuaGF4eC5zZS9jZ2ktYmluL21haWxt
YW4vbGlzdGluZm8vbGlic3NoMi1kZXZlbAo=

From libssh2-devel-bounces@cool.haxx.se  Fri Jan 14 16:40:41 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0EFeInL009084;
	Fri, 14 Jan 2011 16:40:37 +0100
Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com
	[209.85.215.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0EFeG5U009049
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 14 Jan 2011 16:40:17 +0100
Received: by eyf6 with SMTP id 6so1522914eyf.41
	for <libssh2-devel@cool.haxx.se>; Fri, 14 Jan 2011 07:40:14 -0800 (PST)
Received: by 10.204.116.206 with SMTP id n14mr719705bkq.65.1295019614247;
	Fri, 14 Jan 2011 07:40:14 -0800 (PST)
Received: from [192.168.0.35] (96-160.ftth.onsbrabantnet.nl [88.159.160.96])
	by mx.google.com with ESMTPS id d27sm1372870bkw.14.2011.01.14.07.40.11
	(version=SSLv3 cipher=RC4-MD5); Fri, 14 Jan 2011 07:40:12 -0800 (PST)
Message-ID: <4D306E5A.4040102@peut.org>
Date: Fri, 14 Jan 2011 16:40:10 +0100
From: Jose Baars <peut@peut.org>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; nl;
	rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7
MIME-Version: 1.0
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Platforms with lengthy disconnection timeouts
References: <4343B29C56C61444A66123E4644FC9A205741A@MTA.quazal.local>	<20110112225618.23311.qmail@stuge.se>	<alpine.DEB.2.00.1101122357210.5355@tvnag.unkk.fr>
	<20110112231033.25361.qmail@stuge.se>
In-Reply-To: <20110112231033.25361.qmail@stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Fri, 14 Jan 2011 16:40:41 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Fri, 14 Jan 2011 16:40:17 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1933871327=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

This is a cryptographically signed message in MIME format.

--===============1933871327==
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha1; boundary="------------ms000304060204080702040805"

This is a cryptographically signed message in MIME format.

--------------ms000304060204080702040805
Content-Type: multipart/alternative;
 boundary="------------050605060308070503050609"

This is a multi-part message in MIME format.
--------------050605060308070503050609
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable

Op 1/13/2011 12:10 AM, Peter Stuge schreef:
>
> I interpret it to be about libssh2 detecting link loss when the
> operating system can not, which does not make sense, and in fact
> short-circuits a big chunk of TCP functionality.
>
> If you want fast link drop detection in your TCP stack then really
> you have to tweak your TCP stack. libssh2 can't do much about it..
>
>
> //Peter
Yes. We had this discussion before on keep-alive.

--=20
*Jos=E9 Baars*


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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content=3D"text/html; charset=3DISO-8859-1"
      http-equiv=3D"Content-Type">
    <title></title>
  </head>
  <body text=3D"#000000" bgcolor=3D"#ffffff">
    Op 1/13/2011 12:10 AM, Peter Stuge schreef:
    <blockquote cite=3D"mid:20110112231033.25361.qmail@stuge.se"
      type=3D"cite"><br>
      <pre wrap=3D"">I interpret it to be about libssh2 detecting link lo=
ss when the
operating system can not, which does not make sense, and in fact
short-circuits a big chunk of TCP functionality.

If you want fast link drop detection in your TCP stack then really
you have to tweak your TCP stack. libssh2 can't do much about it..


//Peter
</pre>
    </blockquote>
    Yes. We had this discussion before on keep-alive. <br>
    <br>
    <div class=3D"moz-signature">-- <br>
      <title></title>
      <font face=3D"Helvetica, Arial, sans-serif"><b>Jos&eacute;
          Baars</b><br>
      </font><br>
    </div>
  </body>
</html>

--------------050605060308070503050609--

--------------ms000304060204080702040805
Content-Type: application/pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIRtDCC
BV0wggRFoAMCAQICEBUPxTeUYVibM15V7SdI4YcwDQYJKoZIhvcNAQEFBQAwgd0xCzAJBgNV
BAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1
c3QgTmV0d29yazE7MDkGA1UECxMyVGVybXMgb2YgdXNlIGF0IGh0dHBzOi8vd3d3LnZlcmlz
aWduLmNvbS9ycGEgKGMpMDkxHjAcBgNVBAsTFVBlcnNvbmEgTm90IFZhbGlkYXRlZDE3MDUG
A1UEAxMuVmVyaVNpZ24gQ2xhc3MgMSBJbmRpdmlkdWFsIFN1YnNjcmliZXIgQ0EgLSBHMzAe
Fw0xMDExMTIwMDAwMDBaFw0xMTExMTIyMzU5NTlaMIIBCjEXMBUGA1UEChMOVmVyaVNpZ24s
IEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxRjBEBgNVBAsTPXd3dy52
ZXJpc2lnbi5jb20vcmVwb3NpdG9yeS9SUEEgSW5jb3JwLiBieSBSZWYuLExJQUIuTFREKGMp
OTgxHjAcBgNVBAsTFVBlcnNvbmEgTm90IFZhbGlkYXRlZDEzMDEGA1UECxMqRGlnaXRhbCBJ
RCBDbGFzcyAxIC0gTmV0c2NhcGUgRnVsbCBTZXJ2aWNlMRMwEQYDVQQDFApKb3NlIEJhYXJz
MRwwGgYJKoZIhvcNAQkBFg1wZXV0QHBldXQub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
MIIBCgKCAQEAr/QJrg4jLwhCrNdHOzbC5HFzjE/FoklGXizIWpmW/bQOf6UQCVmJIPK7dsaJ
Dz2zytkbrrre5s/qfPcNkSScKSOguxyBmnQ/tW6Y0OnlYzv0ZrYyC0J8zzntDfZ5mLOzBTCY
rGS0Pqy8n7vRScDT927/62dEfgHiA3ceWbc+NCIJYdgupDjByypHgmi2H6JAiv6N16U2LRfM
2ZNBu4RYgWHQp31Y9cX/a/CHEv1rG/5MPVDQP6t45saHKJN/gcH4oXeCfHINZ7iUJhIWpk9i
pGEjwPLpgRAsGJFRHrZTBgOjrwrdzfrDgnKWkB2RY+IAYQ7z+8+KJGHwfuWvsH2EbQIDAQAB
o4HoMIHlMAkGA1UdEwQCMAAwRAYDVR0gBD0wOzA5BgtghkgBhvhFAQcXATAqMCgGCCsGAQUF
BwIBFhxodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhMAsGA1UdDwQEAwIFoDAdBgNVHSUE
FjAUBggrBgEFBQcDBAYIKwYBBQUHAwIwFAYKYIZIAYb4RQEGBwQGFgROb25lMFAGA1UdHwRJ
MEcwRaBDoEGGP2h0dHA6Ly9pbmRjMWRpZ2l0YWxpZC1nMy1jcmwudmVyaXNpZ24uY29tL0lu
ZEMxRGlnaXRhbElELUczLmNybDANBgkqhkiG9w0BAQUFAAOCAQEA5nI96tQkbCelTz4bLtnc
6uCIfbmE0slYOMLfmjwgXm0qJAMYCiBlhdBkBeROwP9JkqIRHMOnPAGB/i9nz/6KeIJQEBKT
ClJMeU9NZ4VvIsmaTnEmL86fuDQygCYJXf7+9PfIbK2BDQ9AsJtvLPfQXfMkATYEAP/dozXX
ZLiZ3p5sex3DzevIX8/TNjV4Vdt7S8rYXfLz+yZh5bJVliScankYwcScVh/0kn0DLdq47DxO
ZANPISNkOF0yvfT/cTFMnLykCwtZiGGfRGl5KAl6DSN0vn49B+M0QuvGAN/5itaGx4YCLMl1
0iganL8H2SHFW4a+BeKZ7t+1JG9l/YUGdTCCBV0wggRFoAMCAQICEBUPxTeUYVibM15V7SdI
4YcwDQYJKoZIhvcNAQEFBQAwgd0xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwg
SW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazE7MDkGA1UECxMyVGVybXMg
b2YgdXNlIGF0IGh0dHBzOi8vd3d3LnZlcmlzaWduLmNvbS9ycGEgKGMpMDkxHjAcBgNVBAsT
FVBlcnNvbmEgTm90IFZhbGlkYXRlZDE3MDUGA1UEAxMuVmVyaVNpZ24gQ2xhc3MgMSBJbmRp
dmlkdWFsIFN1YnNjcmliZXIgQ0EgLSBHMzAeFw0xMDExMTIwMDAwMDBaFw0xMTExMTIyMzU5
NTlaMIIBCjEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy
dXN0IE5ldHdvcmsxRjBEBgNVBAsTPXd3dy52ZXJpc2lnbi5jb20vcmVwb3NpdG9yeS9SUEEg
SW5jb3JwLiBieSBSZWYuLExJQUIuTFREKGMpOTgxHjAcBgNVBAsTFVBlcnNvbmEgTm90IFZh
bGlkYXRlZDEzMDEGA1UECxMqRGlnaXRhbCBJRCBDbGFzcyAxIC0gTmV0c2NhcGUgRnVsbCBT
ZXJ2aWNlMRMwEQYDVQQDFApKb3NlIEJhYXJzMRwwGgYJKoZIhvcNAQkBFg1wZXV0QHBldXQu
b3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr/QJrg4jLwhCrNdHOzbC5HFz
jE/FoklGXizIWpmW/bQOf6UQCVmJIPK7dsaJDz2zytkbrrre5s/qfPcNkSScKSOguxyBmnQ/
tW6Y0OnlYzv0ZrYyC0J8zzntDfZ5mLOzBTCYrGS0Pqy8n7vRScDT927/62dEfgHiA3ceWbc+
NCIJYdgupDjByypHgmi2H6JAiv6N16U2LRfM2ZNBu4RYgWHQp31Y9cX/a/CHEv1rG/5MPVDQ
P6t45saHKJN/gcH4oXeCfHINZ7iUJhIWpk9ipGEjwPLpgRAsGJFRHrZTBgOjrwrdzfrDgnKW
kB2RY+IAYQ7z+8+KJGHwfuWvsH2EbQIDAQABo4HoMIHlMAkGA1UdEwQCMAAwRAYDVR0gBD0w
OzA5BgtghkgBhvhFAQcXATAqMCgGCCsGAQUFBwIBFhxodHRwczovL3d3dy52ZXJpc2lnbi5j
b20vcnBhMAsGA1UdDwQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDBAYIKwYBBQUHAwIwFAYK
YIZIAYb4RQEGBwQGFgROb25lMFAGA1UdHwRJMEcwRaBDoEGGP2h0dHA6Ly9pbmRjMWRpZ2l0
YWxpZC1nMy1jcmwudmVyaXNpZ24uY29tL0luZEMxRGlnaXRhbElELUczLmNybDANBgkqhkiG
9w0BAQUFAAOCAQEA5nI96tQkbCelTz4bLtnc6uCIfbmE0slYOMLfmjwgXm0qJAMYCiBlhdBk
BeROwP9JkqIRHMOnPAGB/i9nz/6KeIJQEBKTClJMeU9NZ4VvIsmaTnEmL86fuDQygCYJXf7+
9PfIbK2BDQ9AsJtvLPfQXfMkATYEAP/dozXXZLiZ3p5sex3DzevIX8/TNjV4Vdt7S8rYXfLz
+yZh5bJVliScankYwcScVh/0kn0DLdq47DxOZANPISNkOF0yvfT/cTFMnLykCwtZiGGfRGl5
KAl6DSN0vn49B+M0QuvGAN/5itaGx4YCLMl10iganL8H2SHFW4a+BeKZ7t+1JG9l/YUGdTCC
Bu4wggXWoAMCAQICEHEVZgVK5JEhTem8RPms09wwDQYJKoZIhvcNAQEFBQAwgcoxCzAJBgNV
BAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1
c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0
aG9yaXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNpZ24gQ2xhc3MgMSBQdWJsaWMgUHJp
bWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA5MDUwMTAwMDAwMFoXDTE5
MDQzMDIzNTk1OVowgd0xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEf
MB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazE7MDkGA1UECxMyVGVybXMgb2YgdXNl
IGF0IGh0dHBzOi8vd3d3LnZlcmlzaWduLmNvbS9ycGEgKGMpMDkxHjAcBgNVBAsTFVBlcnNv
bmEgTm90IFZhbGlkYXRlZDE3MDUGA1UEAxMuVmVyaVNpZ24gQ2xhc3MgMSBJbmRpdmlkdWFs
IFN1YnNjcmliZXIgQ0EgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAO3E
R98qKB18Bmu71yEyyWwTj+mxjUFONPfaC+Nq+mWIIAsRE+mb4ElOi2/VAdBfDUeRilpMdD4/
xpEJu0w0no1uoYJRYvdpdliWB6+eFBgHT1q9n9IxslQZc0ZqGUIR7BJzIY313DDN5dlWCjHF
Nm0pFJe9LdqJRxmI2EsEPeu2PGcedAATDdCG2pNn+DMDrho8a2l49sAsjuGDP3f5mf/+n1Ja
wrSHCthsqUfBVCllQz5KwJYfwa33d69ssQRevsG2lC2XkC0n0rse6YNqhPbEsq4jBmUmpSdY
KwcitG+mYkgad/LVUCeaKdOW+yj1uiR2YuOMWev7btVCxL5Bx/UCAwEAAaOCArkwggK1MDQG
CCsGAQUFBwEBBCgwJjAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AudmVyaXNpZ24uY29tMBIG
A1UdEwEB/wQIMAYBAf8CAQAwcAYDVR0gBGkwZzBlBgtghkgBhvhFAQcXATBWMCgGCCsGAQUF
BwIBFhxodHRwczovL3d3dy52ZXJpc2lnbi5jb20vY3BzMCoGCCsGAQUFBwICMB4aHGh0dHBz
Oi8vd3d3LnZlcmlzaWduLmNvbS9ycGEwNAYDVR0fBC0wKzApoCegJYYjaHR0cDovL2NybC52
ZXJpc2lnbi5jb20vcGNhMS1nMy5jcmwwDgYDVR0PAQH/BAQDAgEGMG4GCCsGAQUFBwEMBGIw
YKFeoFwwWjBYMFYWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFEtruSiWBgy70FI4mymsSweL
IQUYMCYWJGh0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28xLmdpZjAuBgNVHREEJzAl
pCMwITEfMB0GA1UEAxMWUHJpdmF0ZUxhYmVsNC0yMDQ4LTExODAdBgNVHQ4EFgQUeUdhCEH9
OASiS+e1zPVD9kkrEfgwgfEGA1UdIwSB6TCB5qGB0KSBzTCByjELMAkGA1UEBhMCVVMxFzAV
BgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3Jr
MTowOAYDVQQLEzEoYykgMTk5OSBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz
ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcnRp
ZmljYXRpb24gQXV0aG9yaXR5IC0gRzOCEQCLW3VWhFSFCwDPrzhIzrGkMA0GCSqGSIb3DQEB
BQUAA4IBAQA5Tc9BmYG1qQW1UjjpOYSJbOQ0qFrn2GwJTCQaulmkhztzIfGTgc+/aGNaZ/41
hSuhw12jSsI6Gd0w1sxN7/HSgZfKVFpDvzeLeo4ZjQ9DqIzyr2CzFYqzlZw84J6zJ5ikNXIX
5fwqXYfTig3C0UUq+MD0rCqTOtWuEnAI6/s74nfs6CtkNXbNutrg0csU1nFYm77VPn222egk
xSRmTF2RH3azFz5/DcYhiS+zN7ih/1yybUneZVJC+w6I0u1KHb9L4/jMcvpIDmWOScjW+JmY
O7eUPjFxBof6bFlTLtffK+1fYwCsFe0DuFUWjMZoA+ciqHMLsbyg2lJY3QoOf8GCMYIE7DCC
BOgCAQEwgfIwgd0xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0G
A1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazE7MDkGA1UECxMyVGVybXMgb2YgdXNlIGF0
IGh0dHBzOi8vd3d3LnZlcmlzaWduLmNvbS9ycGEgKGMpMDkxHjAcBgNVBAsTFVBlcnNvbmEg
Tm90IFZhbGlkYXRlZDE3MDUGA1UEAxMuVmVyaVNpZ24gQ2xhc3MgMSBJbmRpdmlkdWFsIFN1
YnNjcmliZXIgQ0EgLSBHMwIQFQ/FN5RhWJszXlXtJ0jhhzAJBgUrDgMCGgUAoIICzjAYBgkq
hkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xMTAxMTQxNTQwMTBaMCMG
CSqGSIb3DQEJBDEWBBTwKoBcTeoiE7UHXkUnSekGfIZFvTBfBgkqhkiG9w0BCQ8xUjBQMAsG
CWCGSAFlAwQBAjAKBggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcNAwICAUAw
BwYFKw4DAgcwDQYIKoZIhvcNAwICASgwggEDBgkrBgEEAYI3EAQxgfUwgfIwgd0xCzAJBgNV
BAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1
c3QgTmV0d29yazE7MDkGA1UECxMyVGVybXMgb2YgdXNlIGF0IGh0dHBzOi8vd3d3LnZlcmlz
aWduLmNvbS9ycGEgKGMpMDkxHjAcBgNVBAsTFVBlcnNvbmEgTm90IFZhbGlkYXRlZDE3MDUG
A1UEAxMuVmVyaVNpZ24gQ2xhc3MgMSBJbmRpdmlkdWFsIFN1YnNjcmliZXIgQ0EgLSBHMwIQ
FQ/FN5RhWJszXlXtJ0jhhzCCAQUGCyqGSIb3DQEJEAILMYH1oIHyMIHdMQswCQYDVQQGEwJV
UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5l
dHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9mIHVzZSBhdCBodHRwczovL3d3dy52ZXJpc2lnbi5j
b20vcnBhIChjKTA5MR4wHAYDVQQLExVQZXJzb25hIE5vdCBWYWxpZGF0ZWQxNzA1BgNVBAMT
LlZlcmlTaWduIENsYXNzIDEgSW5kaXZpZHVhbCBTdWJzY3JpYmVyIENBIC0gRzMCEBUPxTeU
YVibM15V7SdI4YcwDQYJKoZIhvcNAQEBBQAEggEASBql9pgsEG9eHEwphVzc9TXnXBAP5izd
fc31MWcIFF8Qpzf/qXXbHtm2FjydEcMjJCHUVIuKecdLY2RchfXb9uYQjAmFCBjykHjmo5PV
0wwXx1wlXuYf/m1It57GSZrkujjxTemehd0jjp8pof0jNCfXMsorOCllm4jywPr8R6xUiPAq
NeFKlHCCGyqWD8fQtb6/HDmSZqpnmWZfLMgoWvtnofQI5tstJjz2ylDTJiaOjhEouYMaPbxa
KBmgtEX6FMGtTgfYe6erlrpo0fbv/3b/SE7F6c5T+3nSO4s04yoUCl3YhZqw5zledA+MLTrG
K5lTV8myFVQzxGg5Zm7HEwAAAAAAAA==
--------------ms000304060204080702040805--

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

--===============1933871327==--

From libssh2-devel-bounces@cool.haxx.se  Sun Jan 16 04:17:42 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0G3HLEN027045;
	Sun, 16 Jan 2011 04:17:38 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0G3HJ9k027025
	for <libssh2-devel@cool.haxx.se>; Sun, 16 Jan 2011 04:17:20 +0100
Received: (qmail 12944 invoked from network); 16 Jan 2011 03:17:19 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 16 Jan 2011 03:17:19 -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: Sun, 16 Jan 2011 03:17:19 -0000
X-URL: http://trac.libssh2.org/
Subject: [libssh2] #206: Calling libssh2_sftp_read multiple times with a
	reducing buffer size sends a large amount of outbound packets
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/206
Message-ID: <108.d2ac176feb9a7e6fc1d9503d194f4ed1@libssh2.stuge.se>
X-Trac-Ticket-ID: 206
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#206: Calling libssh2_sftp_read multiple times with a reducing buffer size sends
a large amount of outbound packets
---------------------------------------------------------------------------------------+
  Reporter:  www.google.com/accounts/o8/id?id=aitoawklaurjnhtim8cmypfnamil7ugv00-86qe  |       Owner:     
      Type:  defect                                                                    |      Status:  new
  Priority:  normal                                                                    |   Milestone:     
 Component:  SFTP                                                                      |     Version:     
  Keywords:                                                                            |      Blocks:     
Blocked By:                                                                            |  
---------------------------------------------------------------------------------------+
 When I call libssh2_sftp_read multiple times with a reducing buffer size,
 the 2nd call takes a long time/hangs and begins sending a large amount of
 data to the server. At this point it fills the network socket's send
 buffer and then call to libssh2_sftp_read finishes. When calling
 libssh2_sftp_close on the file handle, the return code is -7
 (LIBSSH2_ERROR_SOCKET_SEND).

 This only happens when subsequent calls to libssh2_sftp_read have a
 smaller buffer size than the previous call. If the buffer size is the same
 or larger there are no problems. A real world example of this is:
 1. Open a remote file with a size of 8000 bytes with libssh2_sftp_open
 2. First call to libssh2_sftp_read with a buffer size of 8000 returns just
 the first 2000 bytes
 3. Second call to libssh2_sftp_read with a buffer size of 6000 (8000-2000)
 returns 6000 bytes
 4. Inspect rate of outbound network traffic and return value of
 libssh2_sftp_close

 Client Environment:
 Source: daily snapshot libssh2-1.2.8-20110113
 Compiler: VC2010 (x86) on Windows 7 64-bit

 Server Environment:
 Ubuntu 10.10 64-bit with openssh-server
 Reproducable on:
 1. a remote Xen VPS host with 180ms ping
 2. VMWare virtualised local host running with < 1 ms ping

 Attachments:
 Modified example\sftp.c

-- 
Ticket URL: <http://trac.libssh2.org/ticket/206>
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 Jan 17 06:32:48 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0H5WM9G022928;
	Mon, 17 Jan 2011 06:32:44 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id p0H5WLbG022882
	for <libssh2-devel@cool.haxx.se>; Mon, 17 Jan 2011 06:32:21 +0100
Received: (qmail 27395 invoked by uid 501); 17 Jan 2011 05:32:20 -0000
Message-ID: <20110117053220.27394.qmail@stuge.se>
Date: Mon, 17 Jan 2011 06:32:20 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: need help on multiple direct tcpip channels
Mail-Followup-To: libssh2 development <libssh2-devel@cool.haxx.se>
References: <AANLkTinLiX16m_E74Yu0ioNUkbx8QC2fjKoOpNz1VTJL@mail.gmail.com>
	<alpine.DEB.2.00.1101111423320.2218@tvnag.unkk.fr>
	<AANLkTinLiX16m_E74Yu0ioNUkbx8QC2fjKoOpNz1VTJL@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.00.1101111423320.2218@tvnag.unkk.fr>
	<AANLkTinLiX16m_E74Yu0ioNUkbx8QC2fjKoOpNz1VTJL@mail.gmail.com>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Dmitry Teslenko wrote:
> Is libssh2 capable of creating mutiple direct tcpip channels on win32
> platform?

Yes.


> Is it capable of connect to one host and forward port to another host,
> i.e. -L<port>:<one host>:<port> <user>@<another host>?

This is just the above question repeated with an example. Still yes.


> I there's not so much open source software that uses libssh2 to
> look for example. I found medusa, ksftpgrabber and perl/php bindings
> only. Can you point to usable example or provide hint how to do it?

There is an example of how to use direct-tcpip channels with libssh2
in example/direct-tcpip.c which you may have seen.


> I guess channel init should be in blocking mode and
> data transfer should be in non-blocking mode.

Yes.


Daniel Stenberg wrote:
>> I guess channel init should be in blocking mode
>
> You never _need_ to use blocking mode, but you can most often opt
> to use it.

Whenever more than a single libssh2 channel is open it is absolutely
neccessary to use *non-blocking* mode, to have working communication.
This is also demonstrated in example/direct-tcpip.c and I know that
it is a really ugly construct but it is the only option until the
libssh2 API gets extended a bit. We've been talking about this for a
while.



>> data transfer should be in non-blocking mode.
>
> Yes, mostly due to the fact that you currently can't really figure out 
> which channel that has traffic when you know there's something to read
> from the socket so you need to check them all and then you don't want
> to block on any.

Exactly.


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

From libssh2-devel-bounces@cool.haxx.se  Mon Jan 17 21:09:52 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0HK9YYo006859;
	Mon, 17 Jan 2011 21:09:49 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0HK9XvO006848
	for <libssh2-devel@cool.haxx.se>; Mon, 17 Jan 2011 21:09:33 +0100
Date: Mon, 17 Jan 2011 21:09:33 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: libssh2-1.2.8-20110111 issue
In-Reply-To: <AANLkTins8uw3iwdrbWYof+6ak3x8hEN8aNgq_xXWmoKh@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1101172107430.13297@tvnag.unkk.fr>
References: <AANLkTins8uw3iwdrbWYof+6ak3x8hEN8aNgq_xXWmoKh@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-164630725-1295294873=:13297"
Content-ID: <alpine.DEB.2.00.1101172108000.13297@tvnag.unkk.fr>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: 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-164630725-1295294873=:13297
Content-Type: TEXT/PLAIN; CHARSET=ISO-2022-JP; FORMAT=flowed
Content-ID: <alpine.DEB.2.00.1101172108001.13297@tvnag.unkk.fr>

On Wed, 12 Jan 2011, zl liu wrote:

> the performance has increased 32%$B!'(J

First, you didn't say how large buffer you use, but if you use very large 
buffers you optimize the SFTP performance better.

Then, sftp_write_sliding.c shows an even better way to do SFTP uploads with 
libssh2 as it allows it to keep the send pipe full all the time.

-- 

  / daniel.haxx.se
--1129329158-164630725-1295294873=:13297
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-164630725-1295294873=:13297--

From libssh2-devel-bounces@cool.haxx.se  Mon Jan 17 22:44:22 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0HLi7J8028132;
	Mon, 17 Jan 2011 22:44:20 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0HLi5St028104
	for <libssh2-devel@cool.haxx.se>; Mon, 17 Jan 2011 22:44:05 +0100
Received: (qmail 20589 invoked from network); 17 Jan 2011 21:44:01 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 17 Jan 2011 21:44:01 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Mon, 17 Jan 2011 21:44:01 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #206: Calling libssh2_sftp_read multiple times with a
	reducing buffer size sends a large amount of outbound packets
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/206#comment:1
Message-ID: <123.454e14ee7bd8aa6a748007b0df42e70f@libssh2.stuge.se>
References: <108.d2ac176feb9a7e6fc1d9503d194f4ed1@libssh2.stuge.se>
X-Trac-Ticket-ID: 206
In-Reply-To: <108.d2ac176feb9a7e6fc1d9503d194f4ed1@libssh2.stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#206: Calling libssh2_sftp_read multiple times with a reducing buffer size sends
a large amount of outbound packets
---------------------------------------------------------------------------------------+
  Reporter:  www.google.com/accounts/o8/id?id=aitoawklaurjnhtim8cmypfnamil7ugv00-86qe  |        Owner:  bagder  
      Type:  defect                                                                    |       Status:  assigned
  Priority:  normal                                                                    |    Milestone:  1.2.8   
 Component:  SFTP                                                                      |      Version:          
Resolution:                                                                            |     Keywords:          
    Blocks:                                                                            |   Blocked By:          
---------------------------------------------------------------------------------------+
Changes (by bagder):

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


Comment:

 Thanks a lot, I've found a serious problem that I'm convinced caused the
 problem you've experienced. I've committed and pushed this to the git repo
 as commit 90b4b4073f34919aa72deff61a5c9bc188c47c95

 Please give this a try and see if the bug is gone or remains!

 (This bug did not exist in 1.2.7)

-- 
Ticket URL: <http://trac.libssh2.org/ticket/206#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 Jan 18 08:26:58 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0I7Qd73030099;
	Tue, 18 Jan 2011 08:26:54 +0100
Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com
	[209.85.214.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0I7Qbd4030083
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 18 Jan 2011 08:26:38 +0100
Received: by iwn39 with SMTP id 39so6032269iwn.41
	for <libssh2-devel@cool.haxx.se>; Mon, 17 Jan 2011 23:26:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:content-type;
	bh=x9ve4docY8EK9P9yT8Acm/PLwNOGT+xy30rFCjvn2QA=;
	b=TMr68TlxmS7OOcH2ihR69pTOs9Erl7hQpudtpTztFe77fUOw3m74PawSwhUKCvDi8C
	kA22fBi0yyyFTnEi8o40iBfJCiu2wd4iOFnBFMGsnxGpxGZhQpERLzK/ttX+QCXgRvYS
	ZRXk8A6g/Pm/qEk8G61bnzqgpaZX8MCLoMgAI=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type;
	b=TiIXcSwewUpNHG3Zak9iTdt9WTnZOMkBfwQxNp0FQkb7e6c9dg20pzBX/Tl7D1pJ0P
	H1mFq9xEXmO597/T4qphjtYbO+UuvJlp854ghyW2JXFxIbkIO/7lBm0XgYISGmoxI5/S
	VufGG1nMPf6rgf6kbJ03XD7qlAjYJoyNRdNcQ=
MIME-Version: 1.0
Received: by 10.231.19.201 with SMTP id c9mr5471500ibb.183.1295335595806; Mon,
	17 Jan 2011 23:26:35 -0800 (PST)
Received: by 10.231.145.201 with HTTP; Mon, 17 Jan 2011 23:26:35 -0800 (PST)
In-Reply-To: <alpine.DEB.2.00.1101172107430.13297@tvnag.unkk.fr>
References: <AANLkTins8uw3iwdrbWYof+6ak3x8hEN8aNgq_xXWmoKh@mail.gmail.com>
	<alpine.DEB.2.00.1101172107430.13297@tvnag.unkk.fr>
Date: Tue, 18 Jan 2011 15:26:35 +0800
Message-ID: <AANLkTin90Mh1FzuroKQoFtknp=gg9bPXYMSX_hs2rOa6@mail.gmail.com>
Subject: Re: libssh2-1.2.8-20110111 issue
From: zl liu <xieepp@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1507773083=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============1507773083==
Content-Type: multipart/alternative; boundary=0022150481170d901b049a19d287

--0022150481170d901b049a19d287
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: quoted-printable

2011/1/18 Daniel Stenberg <daniel@haxx.se>

> On Wed, 12 Jan 2011, zl liu wrote:
>
>  the performance has increased 32%=A3=BA
>>
>
> First, you didn't say how large buffer you use, but if you use very large
> buffers you optimize the SFTP performance better.
>
My test is up on the example sftp_write_nonblock.c,the buffer is defined as
follow in the file sftp_write_nonblock.c:
char mem[1024 * 100];
in the function sftp_write() have the code:
/* we limit this to just send a single SSH packet at a time */
    if(count > 32500)
        count =3D 32500;
So i think the buffer is big enough.

>
> Then, sftp_write_sliding.c shows an even better way to do SFTP uploads wi=
th
> libssh2 as it allows it to keep the send pipe full all the time.
>
sftp_write_sliding.c  is a better way of course. I just did a comparative
test.

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

--0022150481170d901b049a19d287
Content-Type: text/html; charset=GB2312
Content-Transfer-Encoding: quoted-printable

<br><div><div class=3D"gmail_quote">2011/1/18 Daniel Stenberg <span dir=3D"=
ltr">&lt;<a href=3D"mailto:daniel@haxx.se">daniel@haxx.se</a>&gt;</span><br=
><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1=
px #ccc solid;padding-left:1ex;">
<div class=3D"im">On Wed, 12 Jan 2011, zl liu wrote:<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
the performance has increased 32%=A3=BA<br>
</blockquote>
<br></div>
First, you didn&#39;t say how large buffer you use, but if you use very lar=
ge buffers you optimize the SFTP performance better.<br></blockquote><div>M=
y test is up on the example sftp_write_nonblock.c,the buffer is defined as =
follow in the file&nbsp;sftp_write_nonblock.c:</div>
<div>char mem[1024 * 100];</div><div>in the function sftp_write() have the =
code:<br><div>/* we limit this to just send a single SSH packet at a time *=
/</div><div>&nbsp;&nbsp; &nbsp;if(count &gt; 32500)</div>&nbsp;&nbsp; &nbsp=
; &nbsp; &nbsp;count =3D 32500;</div><div>
So i think the buffer is big enough.</div><blockquote class=3D"gmail_quote"=
 style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Then, sftp_write_sliding.c shows an even better way to do SFTP uploads with=
 libssh2 as it allows it to keep the send pipe full all the time.<br></bloc=
kquote><div>sftp_write_sliding.c&nbsp;&nbsp;is a better way of course. I ju=
st did a&nbsp;comparative test.</div>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;"><font color=3D"#888888">
<br>
-- <br>
<br>
&nbsp;/ <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></div>

--0022150481170d901b049a19d287--

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

--===============1507773083==--

From libssh2-devel-bounces@cool.haxx.se  Tue Jan 18 08:30:36 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0I7UYGt031704;
	Tue, 18 Jan 2011 08:30:35 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0I7UW6r031698
	for <libssh2-devel@cool.haxx.se>; Tue, 18 Jan 2011 08:30:32 +0100
Date: Tue, 18 Jan 2011 08:30:32 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: libssh2-1.2.8-20110111 issue
In-Reply-To: <AANLkTin90Mh1FzuroKQoFtknp=gg9bPXYMSX_hs2rOa6@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1101180828560.30695@tvnag.unkk.fr>
References: <AANLkTins8uw3iwdrbWYof+6ak3x8hEN8aNgq_xXWmoKh@mail.gmail.com>
	<alpine.DEB.2.00.1101172107430.13297@tvnag.unkk.fr>
	<AANLkTin90Mh1FzuroKQoFtknp=gg9bPXYMSX_hs2rOa6@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Tue, 18 Jan 2011, zl liu wrote:

> in the function sftp_write() have the code:
> /* we limit this to just send a single SSH packet at a time */
>    if(count > 32500)
>        count = 32500;
> So i think the buffer is big enough.

That's what libssh2 used to do. If you look in the current code you'll see 
that the sftp_write() has been rewritten and works quite differently now.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Tue Jan 18 11:04:29 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0IA4H4p000909;
	Tue, 18 Jan 2011 11:04:26 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0IA4GJ0000878
	for <libssh2-devel@cool.haxx.se>; Tue, 18 Jan 2011 11:04:16 +0100
Received: (qmail 14003 invoked from network); 18 Jan 2011 10:04:13 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 18 Jan 2011 10:04:13 -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, 18 Jan 2011 10:04:13 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #206: Calling libssh2_sftp_read multiple times with a
	reducing buffer size sends a large amount of outbound packets
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/206#comment:2
Message-ID: <123.be5b58802983ff12c8aadddb2563c038@libssh2.stuge.se>
References: <108.d2ac176feb9a7e6fc1d9503d194f4ed1@libssh2.stuge.se>
X-Trac-Ticket-ID: 206
In-Reply-To: <108.d2ac176feb9a7e6fc1d9503d194f4ed1@libssh2.stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#206: Calling libssh2_sftp_read multiple times with a reducing buffer size sends
a large amount of outbound packets
---------------------------------------------------------------------------------------+
  Reporter:  www.google.com/accounts/o8/id?id=aitoawklaurjnhtim8cmypfnamil7ugv00-86qe  |        Owner:  bagder  
      Type:  defect                                                                    |       Status:  assigned
  Priority:  normal                                                                    |    Milestone:  1.2.8   
 Component:  SFTP                                                                      |      Version:          
Resolution:                                                                            |     Keywords:          
    Blocks:                                                                            |   Blocked By:          
---------------------------------------------------------------------------------------+

Comment (by www.google.com/accounts/o8/id?id=aitoawklaurjnhtim8cmypfnamil7ugv00-86qe):

 Thanks, I've retested with your fix and the problem seems to be resolved
 now.

-- 
Ticket URL: <http://trac.libssh2.org/ticket/206#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  Thu Jan 20 08:14:47 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0K7Dxeh012164;
	Thu, 20 Jan 2011 08:14:45 +0100
Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com
	[209.85.214.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0K7BSL6011334
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 20 Jan 2011 08:11:29 +0100
Received: by iwn39 with SMTP id 39so315222iwn.41
	for <libssh2-devel@cool.haxx.se>; Wed, 19 Jan 2011 23:11:26 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:content-type;
	bh=nZZH5cfDtSHTAHh9Z2qyB2ZJPohBd+1sYILaaewtIp8=;
	b=kWZrYklemp8v/LAYVD8CpSAag1bTO0MpM2jJ6t5XJfqiiuOTBlXxPdOvtnw1j+VJ1B
	aS8jPYwkINyYhpnCk/fzt65viJqfQ5/6Kzb7CUZm0hdtZt+GVvkz612iPZgL+LigL8nw
	HK3EiHks1wvXo4RDG6ct7ICrtuviKk0zp9JiY=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type;
	b=ff/8oA9kCpXYCLChL7SVxPas57/0ouX9ROA32laR1W5oahQcqKIaQFE2rOb1o7wjb8
	xNuCtdIhb0nRVOujDpS9dmZViL9o5VFcFXpyfHGiB5HuXnJ0SVly2ZVYvAR/1XQNpueq
	IzYIG/YY1UF3w1w+idEKYeAo20KCzeS7VC0Vg=
MIME-Version: 1.0
Received: by 10.231.39.77 with SMTP id f13mr2048437ibe.133.1295507486138; Wed,
	19 Jan 2011 23:11:26 -0800 (PST)
Received: by 10.231.145.201 with HTTP; Wed, 19 Jan 2011 23:11:26 -0800 (PST)
In-Reply-To: <alpine.DEB.2.00.1101180828560.30695@tvnag.unkk.fr>
References: <AANLkTins8uw3iwdrbWYof+6ak3x8hEN8aNgq_xXWmoKh@mail.gmail.com>
	<alpine.DEB.2.00.1101172107430.13297@tvnag.unkk.fr>
	<AANLkTin90Mh1FzuroKQoFtknp=gg9bPXYMSX_hs2rOa6@mail.gmail.com>
	<alpine.DEB.2.00.1101180828560.30695@tvnag.unkk.fr>
Date: Thu, 20 Jan 2011 15:11:26 +0800
Message-ID: <AANLkTimqtwX7Fu6oCSRDPS6RiS5Pno8mJvryfL9+jFJu@mail.gmail.com>
Subject: Re: libssh2-1.2.8-20110111 issue
From: zl liu <xieepp@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1015538717=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============1015538717==
Content-Type: multipart/alternative; boundary=000325575c9283e177049a41d711

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

Thank you for reminding me! I read the new code of libssh2-1.2.8-20110118, I
am excited, But i have one question about the following note:
*- On following call, the 'buffer' is expected to have advanced TOTAL **
bytes.*
I can not send another buffer before the current buffer is totally sent off,
even i know it has been copied by sftp_write().
Can i reuse the buffer which has been copied by sftp_write()? if not why
have such a restriction. thank you!
2011/1/18 Daniel Stenberg <daniel@haxx.se>

> On Tue, 18 Jan 2011, zl liu wrote:
>
>  in the function sftp_write() have the code:
>> /* we limit this to just send a single SSH packet at a time */
>>   if(count > 32500)
>>       count = 32500;
>> So i think the buffer is big enough.
>>
>
> That's what libssh2 used to do. If you look in the current code you'll see
> that the sftp_write() has been rewritten and works quite differently now.
>
>
> --
>
>  / daniel.haxx.se
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>

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

Thank you for reminding me! I read the new code of libssh2-1.2.8-20110118, =
I am excited, But i have one question about the following note:<div><div><i=
>- On following call, the &#39;buffer&#39; is expected to have advanced TOT=
AL=A0</i><i>bytes.</i></div>
I can not send another buffer before the current buffer is totally sent off=
, even i know it has been copied by sftp_write().</div><div>Can i reuse the=
 buffer which has been copied by sftp_write()? if not why have=A0such a res=
triction. thank you!<br>
<div class=3D"gmail_quote">2011/1/18 Daniel Stenberg <span dir=3D"ltr">&lt;=
<a href=3D"mailto:daniel@haxx.se">daniel@haxx.se</a>&gt;</span><br><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc s=
olid;padding-left:1ex;">
<div class=3D"im">On Tue, 18 Jan 2011, zl liu wrote:<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
in the function sftp_write() have the code:<br>
/* we limit this to just send a single SSH packet at a time */<br>
 =A0 if(count &gt; 32500)<br>
 =A0 =A0 =A0 count =3D 32500;<br>
So i think the buffer is big enough.<br>
</blockquote>
<br></div>
That&#39;s what libssh2 used to do. If you look in the current code you&#39=
;ll see that the sftp_write() has been rewritten and works quite differentl=
y now.<div><div></div><div class=3D"h5"><br>
<br>
-- <br>
<br>
=A0/ <a href=3D"http://daniel.haxx.se" target=3D"_blank">daniel.haxx.se</a>=
<br>
_______________________________________________<br>
libssh2-devel <a href=3D"http://cool.haxx.se/cgi-bin/mailman/listinfo/libss=
h2-devel" target=3D"_blank">http://cool.haxx.se/cgi-bin/mailman/listinfo/li=
bssh2-devel</a><br>
</div></div></blockquote></div><br></div>

--000325575c9283e177049a41d711--

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

--===============1015538717==--

From libssh2-devel-bounces@cool.haxx.se  Thu Jan 20 09:16:35 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0K8GKp4020600;
	Thu, 20 Jan 2011 09:16:34 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0K8GJDe020593
	for <libssh2-devel@cool.haxx.se>; Thu, 20 Jan 2011 09:16:19 +0100
Date: Thu, 20 Jan 2011 09:16:19 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: libssh2-1.2.8-20110111 issue
In-Reply-To: <AANLkTimqtwX7Fu6oCSRDPS6RiS5Pno8mJvryfL9+jFJu@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1101200902250.12408@tvnag.unkk.fr>
References: <AANLkTins8uw3iwdrbWYof+6ak3x8hEN8aNgq_xXWmoKh@mail.gmail.com>
	<alpine.DEB.2.00.1101172107430.13297@tvnag.unkk.fr>
	<AANLkTin90Mh1FzuroKQoFtknp=gg9bPXYMSX_hs2rOa6@mail.gmail.com>
	<alpine.DEB.2.00.1101180828560.30695@tvnag.unkk.fr>
	<AANLkTimqtwX7Fu6oCSRDPS6RiS5Pno8mJvryfL9+jFJu@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Thu, 20 Jan 2011, zl liu wrote:

> Thank you for reminding me! I read the new code of libssh2-1.2.8-20110118, I 
> am excited, But i have one question about the following note: *- On 
> following call, the 'buffer' is expected to have advanced TOTAL ** bytes.* I 
> can not send another buffer before the current buffer is totally sent off, 
> even i know it has been copied by sftp_write(). Can i reuse the buffer which 
> has been copied by sftp_write()? if not why have such a restriction. thank 
> you!

Sorry, the description was a bit off and I've now updated it to be more on par 
with what the code actually does.

What it tried to explain is that a typical app does this:

   retcode = sftp_write(buffer, 10000); /* call A */

assuming a part of the buffer was sent off, 'retcode' is positive number and 
the app will call the function again with buffer advanced. Perhaps like this:

   buffer += retcode;
   retcode = sftp_write(buffer, 10000 - retcode); /* call B */

In this case, libssh2 has already copied 10000 bytes in call A, so when the 
app does call B the lib will skip the amount of bytes from the start of the 
buffer that it already has copied. In this exact example, libssh2 won't copy a 
single byte in call B as it doesn't provide any new data.

This also illustrates a performance bottle-neck because if you loop like this 
until the buffer is completely sent off, you don't allow libssh2 to pre-send 
data beyond this single buffer. The sliding example code shows a way to make 
the app provide a full buffer as much as possible which allows libssh2 to 
better "keep the pipe full".

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Fri Jan 21 02:38:24 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0L1c5Cl012087;
	Fri, 21 Jan 2011 02:38:21 +0100
Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com
	[209.85.214.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0L1c2X1012056
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 21 Jan 2011 02:38:03 +0100
Received: by iwn39 with SMTP id 39so1317640iwn.41
	for <libssh2-devel@cool.haxx.se>; Thu, 20 Jan 2011 17:37:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:content-type;
	bh=cjdevVfrQvum2Hw/pahJv25ixnYsOQRWwz+hN/z4Vac=;
	b=Ao79ZXHw18EJ08FXxzMFboatgzDpAwv2JYzlxkl5BEOGqbiVNmadNB9ybZOLWzptG9
	OrPBoLea/jVHOHFAtLRzjsAIMXXgrgw14Lj4BCZvDf2GRxqGbAtASI6QHsZg2LfXpZWV
	zOemtDllnTFwTvTDAnLbkiBaUM+ZyAUjxnytg=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type;
	b=ALGKi6EnBbeRHMatIJskEwwFIXrvaziMBhRCX0JFTfNVrvo3NYjseMfmQj51LsX3on
	1RJ2KaF9YAUuB8IJ2wp2Sq53gbDcXsPinomgFyPqmgl+l1Uoi+8SvQd6zEv2QvFCKkAC
	VWYwHZhHsV5IU0k6tSNxuTNeuVBk18orTsfHc=
MIME-Version: 1.0
Received: by 10.231.166.205 with SMTP id n13mr27471iby.58.1295573877748; Thu,
	20 Jan 2011 17:37:57 -0800 (PST)
Received: by 10.231.145.201 with HTTP; Thu, 20 Jan 2011 17:37:57 -0800 (PST)
In-Reply-To: <alpine.DEB.2.00.1101200902250.12408@tvnag.unkk.fr>
References: <AANLkTins8uw3iwdrbWYof+6ak3x8hEN8aNgq_xXWmoKh@mail.gmail.com>
	<alpine.DEB.2.00.1101172107430.13297@tvnag.unkk.fr>
	<AANLkTin90Mh1FzuroKQoFtknp=gg9bPXYMSX_hs2rOa6@mail.gmail.com>
	<alpine.DEB.2.00.1101180828560.30695@tvnag.unkk.fr>
	<AANLkTimqtwX7Fu6oCSRDPS6RiS5Pno8mJvryfL9+jFJu@mail.gmail.com>
	<alpine.DEB.2.00.1101200902250.12408@tvnag.unkk.fr>
Date: Fri, 21 Jan 2011 09:37:57 +0800
Message-ID: <AANLkTimohjti2hHSXcXFZW7EE9MV_tbSVNsNzaBsQXfb@mail.gmail.com>
Subject: Re: libssh2-1.2.8-20110111 issue
From: zl liu <xieepp@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1279163998=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============1279163998==
Content-Type: multipart/alternative; boundary=005045015a63c376e0049a514ce0

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

2011/1/20 Daniel Stenberg <daniel@haxx.se>

> On Thu, 20 Jan 2011, zl liu wrote:
>
>  Thank you for reminding me! I read the new code of libssh2-1.2.8-20110118,
>> I am excited, But i have one question about the following note: *- On
>> following call, the 'buffer' is expected to have advanced TOTAL ** bytes.* I
>> can not send another buffer before the current buffer is totally sent off,
>> even i know it has been copied by sftp_write(). Can i reuse the buffer which
>> has been copied by sftp_write()? if not why have such a restriction. thank
>> you!
>>
>
> Sorry, the description was a bit off and I've now updated it to be more on
> par with what the code actually does.
>
> What it tried to explain is that a typical app does this:
>
>  retcode = sftp_write(buffer, 10000); /* call A */
>
> assuming a part of the buffer was sent off, 'retcode' is positive number
> and the app will call the function again with buffer advanced. Perhaps like
> this:
>
>  buffer += retcode;
>  retcode = sftp_write(buffer, 10000 - retcode); /* call B */
>
> In this case, libssh2 has already copied 10000 bytes in call A, so when the
> app does call B the lib will skip the amount of bytes from the start of the
> buffer that it already has copied. In this exact example, libssh2 won't copy
> a single byte in call B as it doesn't provide any new data.
>
> This also illustrates a performance bottle-neck because if you loop like
> this until the buffer is completely sent off, you don't allow libssh2 to
> pre-send data beyond this single buffer. The sliding example code shows a
> way to make the app provide a full buffer as much as possible which allows
> libssh2 to better "keep the pipe full".
>
>       If i change the code in sftp_write_sliding.c like this:

        if(memuse - rc) {
          /* make room for more data at the end of the buffer */
          /* the mem has been copied by sftp_write() in the previous call,
just move the count not really memory*/
          // memmove(&mem[0], &mem[rc], memuse - rc);
          memuse -= rc;
        }
        else
          /* 'mem' was consumed fully */
          memuse = 0;

        does it work normally? even like this, i think the memory from 0
to memuse  has been waste.

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

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

<br><br><div class=3D"gmail_quote">2011/1/20 Daniel Stenberg <span dir=3D"l=
tr">&lt;<a href=3D"mailto:daniel@haxx.se">daniel@haxx.se</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;">
<div class=3D"im">On Thu, 20 Jan 2011, zl liu wrote:<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
Thank you for reminding me! I read the new code of libssh2-1.2.8-20110118, =
I am excited, But i have one question about the following note: *- On follo=
wing call, the &#39;buffer&#39; is expected to have advanced TOTAL ** bytes=
.* I can not send another buffer before the current buffer is totally sent =
off, even i know it has been copied by sftp_write(). Can i reuse the buffer=
 which has been copied by sftp_write()? if not why have such a restriction.=
 thank you!<br>

</blockquote>
<br></div>
Sorry, the description was a bit off and I&#39;ve now updated it to be more=
 on par with what the code actually does.<br>
<br>
What it tried to explain is that a typical app does this:<br>
<br>
 =A0retcode =3D sftp_write(buffer, 10000); /* call A */<br>
<br>
assuming a part of the buffer was sent off, &#39;retcode&#39; is positive n=
umber and the app will call the function again with buffer advanced. Perhap=
s like this:<br>
<br>
 =A0buffer +=3D retcode;<br>
 =A0retcode =3D sftp_write(buffer, 10000 - retcode); /* call B */<br>
<br>
In this case, libssh2 has already copied 10000 bytes in call A, so when the=
 app does call B the lib will skip the amount of bytes from the start of th=
e buffer that it already has copied. In this exact example, libssh2 won&#39=
;t copy a single byte in call B as it doesn&#39;t provide any new data.<br>

<br>
This also illustrates a performance bottle-neck because if you loop like th=
is until the buffer is completely sent off, you don&#39;t allow libssh2 to =
pre-send data beyond this single buffer. The sliding example code shows a w=
ay to make the app provide a full buffer as much as possible which allows l=
ibssh2 to better &quot;keep the pipe full&quot;.<div>
<div></div><div class=3D"h5"><br></div></div></blockquote><div>=A0=A0 =A0 =
=A0If i change the code=A0in=A0sftp_write_sliding.c=A0like this:</div><div>=
<br></div><div>=A0=A0 =A0 =A0 =A0if(memuse - rc) {</div><div>=A0=A0 =A0 =A0=
 =A0 =A0/* make room for more data at the end of the buffer */=A0</div>
<div>=A0=A0 =A0 =A0 =A0 =A0/* the mem has been copied by sftp_write() in th=
e previous call, just move the count not really memory*/</div><div>=A0=A0 =
=A0 =A0 =A0 =A0// memmove(&amp;mem[0], &amp;mem[rc], memuse - rc);</div><di=
v>=A0=A0 =A0 =A0 =A0 =A0memuse -=3D rc;</div>
<div>=A0=A0 =A0 =A0 =A0}</div><div>=A0=A0 =A0 =A0 =A0else</div><div>=A0=A0 =
=A0 =A0 =A0 =A0/* &#39;mem&#39; was consumed fully */=A0</div><div>=A0=A0 =
=A0 =A0 =A0 =A0memuse =3D 0;=A0</div><div>=A0=A0</div><div>=A0=A0 =A0 =A0 =
=A0does it work normally? even like this, i think the=A0memory from 0 to=A0=
memuse=A0=A0has been waste.=A0</div>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;"><div><div class=3D"h5">
-- <br>
<br>
=A0/ <a href=3D"http://daniel.haxx.se" target=3D"_blank">daniel.haxx.se</a>=
<br>
_______________________________________________<br>
libssh2-devel <a href=3D"http://cool.haxx.se/cgi-bin/mailman/listinfo/libss=
h2-devel" target=3D"_blank">http://cool.haxx.se/cgi-bin/mailman/listinfo/li=
bssh2-devel</a><br>
</div></div></blockquote></div><br>

--005045015a63c376e0049a514ce0--

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

--===============1279163998==--

From libssh2-devel-bounces@cool.haxx.se  Fri Jan 21 09:25:40 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0L8PJSb002029;
	Fri, 21 Jan 2011 09:25:37 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0L8PIKY002023
	for <libssh2-devel@cool.haxx.se>; Fri, 21 Jan 2011 09:25:18 +0100
Date: Fri, 21 Jan 2011 09:25:18 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: libssh2-1.2.8-20110111 issue
In-Reply-To: <AANLkTimohjti2hHSXcXFZW7EE9MV_tbSVNsNzaBsQXfb@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1101210911100.11894@tvnag.unkk.fr>
References: <AANLkTins8uw3iwdrbWYof+6ak3x8hEN8aNgq_xXWmoKh@mail.gmail.com>
	<alpine.DEB.2.00.1101172107430.13297@tvnag.unkk.fr>
	<AANLkTin90Mh1FzuroKQoFtknp=gg9bPXYMSX_hs2rOa6@mail.gmail.com>
	<alpine.DEB.2.00.1101180828560.30695@tvnag.unkk.fr>
	<AANLkTimqtwX7Fu6oCSRDPS6RiS5Pno8mJvryfL9+jFJu@mail.gmail.com>
	<alpine.DEB.2.00.1101200902250.12408@tvnag.unkk.fr>
	<AANLkTimohjti2hHSXcXFZW7EE9MV_tbSVNsNzaBsQXfb@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Fri, 21 Jan 2011, zl liu wrote:

>       If i change the code in sftp_write_sliding.c like this:
>
>        if(memuse - rc) {
>          /* make room for more data at the end of the buffer */
>          /* the mem has been copied by sftp_write() in the previous call,
> just move the count not really memory*/
>          // memmove(&mem[0], &mem[rc], memuse - rc);
>          memuse -= rc;
>        }
>        else
>          /* 'mem' was consumed fully */
>          memuse = 0;
>
>        does it work normally? even like this, i think the memory from 0
> to memuse  has been waste.

Great question. It certainly shows you understand the internal logic now! I'll 
take this opportunity to answer in a long version to sum up the situation.

My answer:

Yes but no. The ABI for this function is still the same as libssh2 has 
provided for years[1], and we do not break it now[2]. Thus, even if we may 
guess that the library has copied the data since we have read its current 
source code, it returned how much data it had handled and everything apart 
from that specific amount MUST be passed back to the library again. You MUST 
not rely on any other behavior by the library.

We will keep the right to modify the internal behaviors as long as the ABI is 
kept, and I can very well suspect that we may alter these algorithms slightly 
in the future when we get more data and more reports from users that try this 
out in the real world, and then it might not for example copy all the data 
but may have a max value that gets calculated dynamically based on the ongoing 
performance - or whatever.

[1] = one can argue that it is a slight deviation in the fact that if you send 
a buffer with a length A, libssh2 returns length B, and then modify the buffer 
beyond position A before you call libssh2 again and libssh2 will not notice 
the change but send the original data anyway. I've made a guess that this kind 
of usage is very rare and should not be a concern for the vast majority of 
users.

[2] = we work really hard on maintaining a stable API and ABI so that 
applications and surroundings keep working even when we improve libssh2. This 
is a sometimes ungrateful work involving pain, but it pays out in the long 
run. In this particular case with SFTP transfers, we've discussed introducing 
new functions that better offer the pipelined transfer we need to get really 
good transfer speeds, but nothing has yet happened on that front.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Fri Jan 21 10:04:08 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0L941Vd030896;
	Fri, 21 Jan 2011 10:04:07 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id p0L93xMZ030848
	for <libssh2-devel@cool.haxx.se>; Fri, 21 Jan 2011 10:03:59 +0100
Received: (qmail 31582 invoked by uid 501); 21 Jan 2011 09:03:59 -0000
Message-ID: <20110121090359.31581.qmail@stuge.se>
Date: Fri, 21 Jan 2011 10:03:59 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: libssh2-1.2.8-20110111 issue
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <AANLkTins8uw3iwdrbWYof+6ak3x8hEN8aNgq_xXWmoKh@mail.gmail.com>
	<alpine.DEB.2.00.1101172107430.13297@tvnag.unkk.fr>
	<AANLkTin90Mh1FzuroKQoFtknp=gg9bPXYMSX_hs2rOa6@mail.gmail.com>
	<alpine.DEB.2.00.1101180828560.30695@tvnag.unkk.fr>
	<AANLkTimqtwX7Fu6oCSRDPS6RiS5Pno8mJvryfL9+jFJu@mail.gmail.com>
	<alpine.DEB.2.00.1101200902250.12408@tvnag.unkk.fr>
	<AANLkTimohjti2hHSXcXFZW7EE9MV_tbSVNsNzaBsQXfb@mail.gmail.com>
	<alpine.DEB.2.00.1101210911100.11894@tvnag.unkk.fr>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.00.1101210911100.11894@tvnag.unkk.fr>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Daniel Stenberg wrote:
> [1] = one can argue that it is a slight deviation
..

> [2] = we work really hard on maintaining a stable API and ABI so
> that applications and surroundings keep working even when we
> improve libssh2. This is a sometimes ungrateful work involving
> pain, but it pays out in the long run. In this particular case with
> SFTP transfers, we've discussed introducing new functions that
> better offer the pipelined transfer we need to get really good
> transfer speeds, but nothing has yet happened on that front.

Making subtle changes to the library behavior, ie. "slight
deviations", is a slippery slope that quickly goes downhill.

I think many if not most users would be thrilled to start using a new
API in order to gain performance, even to the point that it would
quickly become the de-facto standard way of using the library.

I think it's important that we not change semantics, even if it's
only slightly. I expect it will come back to bite.


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

From libssh2-devel-bounces@cool.haxx.se  Fri Jan 21 20:37:31 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0LJbAqd024271;
	Fri, 21 Jan 2011 20:37:28 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0LJb8NN024254
	for <libssh2-devel@cool.haxx.se>; Fri, 21 Jan 2011 20:37:08 +0100
Received: (qmail 20499 invoked from network); 21 Jan 2011 19:37:04 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 21 Jan 2011 19:37:04 -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, 21 Jan 2011 19:37:04 -0000
X-URL: http://trac.libssh2.org/
Subject: [libssh2] #207: libssh2 (v1.2.1) crashes in libssh2_channel_read_ex
	due to invalid memory write
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/207
Message-ID: <108.1565998d459f8da1e1ca60375af1e978@libssh2.stuge.se>
X-Trac-Ticket-ID: 207
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#207: libssh2 (v1.2.1) crashes in libssh2_channel_read_ex due to invalid memory
write
---------------------------------------------------------------------------------------+
  Reporter:  www.google.com/accounts/o8/id?id=aitoawmdz8rvnouurvo7z17gt8ll4pj4-xvsgja  |       Owner:       
      Type:  defect                                                                    |      Status:  new  
  Priority:  normal                                                                    |   Milestone:  1.2.8
 Component:  crypto                                                                    |     Version:  1.2.1
  Keywords:                                                                            |      Blocks:       
Blocked By:                                                                            |  
---------------------------------------------------------------------------------------+
 Under certain circumstances libssh2  crashes in libssh2_channel_read_ex
 due to invalid memory write at transport.c:124 which  is 12 bytes after a
 block of size 63 alloc'd at transport.c:454. Here is valgrind's report
 with line numbers:

 ==6833== Invalid write of size 1
 ==6833==    at 0x4A20F57: memcpy (mc_replace_strmem.c:402)
 ==6833==    by 0x7FA6EAD: decrypt (transport.c:124)
 ==6833==    by 0x7FA70E0: _libssh2_transport_read (transport.c:520)
 ==6833==    by 0x7F9105B: libssh2_channel_read_ex (channel.c:1781)
 ............... application calls ...........
 ==6833==  Address 0x3fa3f463 is 12 bytes after a block of size 63 alloc'd
 ==6833==    at 0x4A1EDEB: malloc (vg_replace_malloc.c:207)
 ==6833==    by 0x7FA741F: _libssh2_transport_read (transport.c:454)
 ==6833==    by 0x7F9105B: libssh2_channel_read_ex (channel.c:1781)
 ............... application calls ...........

 --6833-- VALGRIND INTERNAL ERROR: Valgrind received a signal 11 (SIGSEGV)
 -
 exiting

 If helpful here is debug stack trace of core file which seems to be the
 same issue:
 #0  _libssh2_ntohu32 (buf=0xcb37402deaf43587 <Address 0xcb37402deaf43587
 out of
 bounds>) at misc.c:115
 115    misc.c: No such file or directory.
     in misc.c
 (gdb) where
 #0  _libssh2_ntohu32 (buf=0xcb37402deaf43587 <Address 0xcb37402deaf43587
 out of
 bounds>) at misc.c:115
 #1  0x00007f6cc06ce0f0 in libssh2_channel_read_ex (channel=0x706d290,
 stream_id=0,
     buf=0x712b520
 ">\r\n<snmp-index>\r\n6\r\n</snmp-index>\r\n<if-type>\r\nLoopback\r\n</if-
 type>\r\n<mtu>\r\nUnlimited\r\n</mtu>\r\n<if-device-flags>\r\n<ifdf-
 present/>\r\n<ifdf-running/>\r\n<ifdf-loopback/>\r\n</if-device-flags>\r\n
 <if-config-flag"...,
     buflen=<value optimized out>) at channel.c:1813

 This happens when interacting with a Juniper router. Unfortunately the
 trigger conditions are unknown ...

 Let me know if I can help with tracking down the issue.

 Thanks!

-- 
Ticket URL: <http://trac.libssh2.org/ticket/207>
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 Jan 21 20:54:48 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0LJshnf001042;
	Fri, 21 Jan 2011 20:54:48 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0LJsggb001034
	for <libssh2-devel@cool.haxx.se>; Fri, 21 Jan 2011 20:54:42 +0100
Received: (qmail 23902 invoked from network); 21 Jan 2011 19:54:39 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 21 Jan 2011 19:54:39 -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, 21 Jan 2011 19:54:39 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #207: libssh2 (v1.2.1) crashes in
	libssh2_channel_read_ex due to invalid memory write
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/207#comment:1
Message-ID: <123.03fbf7e176fc097793375b33af978652@libssh2.stuge.se>
References: <108.1565998d459f8da1e1ca60375af1e978@libssh2.stuge.se>
X-Trac-Ticket-ID: 207
In-Reply-To: <108.1565998d459f8da1e1ca60375af1e978@libssh2.stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

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

 I made a typo in the bug description.

 "Under certain circumstances libssh2 crashes in libssh2_channel_read_ex
 due to invalid memory write at transport.c:124 which is 12 bytes after a
 block of size 63 alloc'd at transport.c:454."

 should read:
 "Under certain circumstances libssh2 crashes in libssh2_channel_read_ex
 due to invalid memory write at transport.c:540 which is 12 bytes after a
 block of size 63 alloc'd at transport.c:454."

 Thanks!

-- 
Ticket URL: <http://trac.libssh2.org/ticket/207#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 Jan 21 22:03:07 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0LL2wCG012270;
	Fri, 21 Jan 2011 22:03:06 +0100
Received: from ponderosa.fch.wimsey.bc.ca (zz20920564179.cipherkey.net
	[209.205.64.179])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0LL2usj012208
	for <libssh2-devel@cool.haxx.se>; Fri, 21 Jan 2011 22:02:56 +0100
Received: by coneharvesters.com
	via sendmail with stdio id <m1PgO88-000l6IC@ponderosa.fch.wimsey.bc.ca>
	for libssh2-devel@cool.haxx.se; Fri, 21 Jan 2011 13:02:48 -0800 (PST)
Date: Fri, 21 Jan 2011 13:02:47 -0800
From: Dan Fandrich <dan@coneharvesters.com>
To: libssh2-devel@cool.haxx.se
Subject: Re: libssh2-1.2.8-20110111 issue
Message-ID: <20110121210246.GA32073@coneharvesters.com>
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <AANLkTins8uw3iwdrbWYof+6ak3x8hEN8aNgq_xXWmoKh@mail.gmail.com>
	<alpine.DEB.2.00.1101172107430.13297@tvnag.unkk.fr>
	<AANLkTin90Mh1FzuroKQoFtknp=gg9bPXYMSX_hs2rOa6@mail.gmail.com>
	<alpine.DEB.2.00.1101180828560.30695@tvnag.unkk.fr>
	<AANLkTimqtwX7Fu6oCSRDPS6RiS5Pno8mJvryfL9+jFJu@mail.gmail.com>
	<alpine.DEB.2.00.1101200902250.12408@tvnag.unkk.fr>
	<AANLkTimohjti2hHSXcXFZW7EE9MV_tbSVNsNzaBsQXfb@mail.gmail.com>
	<alpine.DEB.2.00.1101210911100.11894@tvnag.unkk.fr>
	<20110121090359.31581.qmail@stuge.se>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20110121090359.31581.qmail@stuge.se>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Fri, Jan 21, 2011 at 10:03:59AM +0100, Peter Stuge wrote:
> I think it's important that we not change semantics, even if it's
> only slightly. I expect it will come back to bite.

But this is a slippery slope in itself. Fixing bugs also usually involves
some slight change to semantics, and those sometimes do come back to bite.
But to avoid bumping the SONAME on each release or freezing development
altogether, it's an acceptable risk.

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

From libssh2-devel-bounces@cool.haxx.se  Fri Jan 21 22:38:48 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0LLcf6S031310;
	Fri, 21 Jan 2011 22:38:48 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0LLceHg031300
	for <libssh2-devel@cool.haxx.se>; Fri, 21 Jan 2011 22:38:40 +0100
Date: Fri, 21 Jan 2011 22:38:40 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: libssh2-1.2.8-20110111 issue
In-Reply-To: <20110121090359.31581.qmail@stuge.se>
Message-ID: <alpine.DEB.2.00.1101212234320.29228@tvnag.unkk.fr>
References: <AANLkTins8uw3iwdrbWYof+6ak3x8hEN8aNgq_xXWmoKh@mail.gmail.com>
	<alpine.DEB.2.00.1101172107430.13297@tvnag.unkk.fr>
	<AANLkTin90Mh1FzuroKQoFtknp=gg9bPXYMSX_hs2rOa6@mail.gmail.com>
	<alpine.DEB.2.00.1101180828560.30695@tvnag.unkk.fr>
	<AANLkTimqtwX7Fu6oCSRDPS6RiS5Pno8mJvryfL9+jFJu@mail.gmail.com>
	<alpine.DEB.2.00.1101200902250.12408@tvnag.unkk.fr>
	<AANLkTimohjti2hHSXcXFZW7EE9MV_tbSVNsNzaBsQXfb@mail.gmail.com>
	<alpine.DEB.2.00.1101210911100.11894@tvnag.unkk.fr>
	<20110121090359.31581.qmail@stuge.se>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Fri, 21 Jan 2011, Peter Stuge wrote:

> Making subtle changes to the library behavior, ie. "slight deviations", is a 
> slippery slope that quickly goes downhill.
>
> I think many if not most users would be thrilled to start using a new API in 
> order to gain performance, even to the point that it would quickly become 
> the de-facto standard way of using the library.
>
> I think it's important that we not change semantics, even if it's only 
> slightly. I expect it will come back to bite.

Well, yes some apps are likely to want to switch API to get a speed boost but 
I also assume that there's a bunch of apps that will appreciate a performance 
boost without changing any code at all...

In this case I just put my money on sticking with the existing API, fully 
knowing that there's small risk someone will get hurt.

It also happened to be less work for me! =)

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Fri Jan 21 23:18:50 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0LMIaWE021006;
	Fri, 21 Jan 2011 23:18:48 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0LMIZ93020981
	for <libssh2-devel@cool.haxx.se>; Fri, 21 Jan 2011 23:18:35 +0100
Received: (qmail 22338 invoked from network); 21 Jan 2011 22:18:31 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 21 Jan 2011 22:18:31 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Fri, 21 Jan 2011 22:18:31 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #206: Calling libssh2_sftp_read multiple times with a
	reducing buffer size sends a large amount of outbound packets
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/206#comment:3
Message-ID: <123.fc942aef2e7c2218d3b0d3d62d2bb8f6@libssh2.stuge.se>
References: <108.d2ac176feb9a7e6fc1d9503d194f4ed1@libssh2.stuge.se>
X-Trac-Ticket-ID: 206
In-Reply-To: <108.d2ac176feb9a7e6fc1d9503d194f4ed1@libssh2.stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#206: Calling libssh2_sftp_read multiple times with a reducing buffer size sends
a large amount of outbound packets
---------------------------------------------------------------------------------------+
  Reporter:  www.google.com/accounts/o8/id?id=aitoawklaurjnhtim8cmypfnamil7ugv00-86qe  |        Owner:  bagder
      Type:  defect                                                                    |       Status:  closed
  Priority:  normal                                                                    |    Milestone:  1.2.8 
 Component:  SFTP                                                                      |      Version:        
Resolution:  fixed                                                                     |     Keywords:        
    Blocks:                                                                            |   Blocked By:        
---------------------------------------------------------------------------------------+
Changes (by bagder):

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


-- 
Ticket URL: <http://trac.libssh2.org/ticket/206#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  Fri Jan 21 23:20:13 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0LMKBcf022089;
	Fri, 21 Jan 2011 23:20:12 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0LMKAri022065
	for <libssh2-devel@cool.haxx.se>; Fri, 21 Jan 2011 23:20:10 +0100
Received: (qmail 22802 invoked from network); 21 Jan 2011 22:20:06 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 21 Jan 2011 22:20:06 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Fri, 21 Jan 2011 22:20:06 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #207: libssh2 (v1.2.1) crashes in
	libssh2_channel_read_ex due to invalid memory write
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/207#comment:2
Message-ID: <123.fa2db88bb4481228884b7ce08086e3f2@libssh2.stuge.se>
References: <108.1565998d459f8da1e1ca60375af1e978@libssh2.stuge.se>
X-Trac-Ticket-ID: 207
In-Reply-To: <108.1565998d459f8da1e1ca60375af1e978@libssh2.stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

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


Comment:

 Can you please try with a modern version, preferably with a git version
 but at least 1.2.7 and see if it happens again?

 We've done many fixes since 1.2.1 so nobody will bother trying to search
 for problems in that old release.

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

From libssh2-devel-bounces@cool.haxx.se  Tue Jan 25 09:21:56 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0P8LY22000499;
	Tue, 25 Jan 2011 09:21:51 +0100
Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com
	[209.85.214.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0P8LUPd000448
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 25 Jan 2011 09:21:31 +0100
Received: by iwn39 with SMTP id 39so5323006iwn.41
	for <libssh2-devel@cool.haxx.se>; Tue, 25 Jan 2011 00:21:29 -0800 (PST)
Received: by 10.42.176.134 with SMTP id be6mr6136726icb.342.1295943689567;
	Tue, 25 Jan 2011 00:21:29 -0800 (PST)
Received: from [10.0.1.18] (75-25-142-10.lightspeed.okldca.sbcglobal.net
	[75.25.142.10])
	by mx.google.com with ESMTPS id 34sm11737333ibi.14.2011.01.25.00.21.28
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Tue, 25 Jan 2011 00:21:29 -0800 (PST)
From: "mini@loopqoob.net" <mini@loopqoob.net>
Subject: build libssh2 on Mac OS X 10.6 to run on Mac OS X 10.5?
Date: Tue, 25 Jan 2011 00:21:27 -0800
Message-Id: <2E0C4D54-DDD2-4815-AF7F-8234F24B9D6C@loopqoob.net>
To: libssh2-devel@cool.haxx.se
Mime-Version: 1.0 (Apple Message framework v1082)
X-Mailer: Apple Mail (2.1082)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

I am having a devil of a time building libssh2 so that it will load on both Mac OS X 10.5 an 10.6. Has anyone been able to do this successfully?

Right now, I can build a library that works on 10.6, but when I try to run an app that links to it on 10.5, I get the following error:

Dyld Error Message:
  Library not loaded: @executable_path/../Frameworks/libssh2.1.dylib
  Referenced from: /Users/test/Desktop/sftp.app/Contents/MacOS/sftp
  Reason: no suitable image found.  Did find:
	/Users/test/Desktop/sftp.app/Contents/MacOS/../Frameworks/libssh2.1.dylib: unknown required load command 0x80000022
	/Users/test/Desktop/sftp.app/Contents/MacOS/../Frameworks/libssh2.1.dylib: unknown required load command 0x80000022


Here is what I'm doing to build libssh2:

cd ~/Downloads/libssh2-1.2.7
export PKG_CONFIG_PATH=/Developer/SDKs/MacOSX10.5.sdk/usr/lib/pkgconfig
export CFLAGS="-arch x86_64"
export CXXFLAGS=$CFLAGS
export LDFLAGS=$CFLAGS

./configure --build=x86_64-apple-darwin9.0 --with-libssl-prefix=/Developer/SDKs/MacOSX10.5.sdk/usr --with-libcrypt-prefix=/Developer/SDKs/MacOSX10.5.sdk/usr 
make


Any help appreciated.

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

From libssh2-devel-bounces@cool.haxx.se  Wed Jan 26 17:57:16 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0QGusNQ030218;
	Wed, 26 Jan 2011 17:57:11 +0100
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0QGuqKj030204
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 26 Jan 2011 17:56:53 +0100
Received: by qwj9 with SMTP id 9so1130937qwj.41
	for <libssh2-devel@cool.haxx.se>; Wed, 26 Jan 2011 08:56:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:date:message-id:subject:from:to
	:content-type; bh=z3FDg4cTnJhs2mBTW9Z9sD0WGhzcmNuK2sb3Up/NEbw=;
	b=v5ChTnL/m1GNYCaf5oB7wY9htZGQ2TI2AspPnWLr7x13A7b19yLPZNuOx7iay5bRel
	nFzrInSnwa711X9SuwSmgnXnATGd9RJvHCnyH4yhi6teJhfkZo7BmemOiyeqjNxyeGHd
	g9+ImJjGqmarysyUOCb5T5ZiivveycU1r+UUc=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=U5c1hLgIfLSOcsJvjJtuFFM8WmWos0wPesY444u9FIiEFpNIlZkUblL8h+2V+T8QxX
	7hVVftKwlfNB0WlOo+GABZM5a5sODxGLbnQKuqaO0pFE0PjxL+RM9AtPxPV1AHQwsRjd
	EnxGdr6KWQTd/H4JcT5IPY0JEW1cFxiMfbsoQ=
MIME-Version: 1.0
Received: by 10.229.186.75 with SMTP id cr11mr588868qcb.113.1296061002638;
	Wed, 26 Jan 2011 08:56:42 -0800 (PST)
Received: by 10.229.238.204 with HTTP; Wed, 26 Jan 2011 08:56:42 -0800 (PST)
Date: Wed, 26 Jan 2011 17:56:42 +0100
Message-ID: <AANLkTinDo9qRGyXzQSOhDSf+7jGHFvEv683X_v4gFzF1@mail.gmail.com>
Subject: [PATCH] do decompression only if needed
From: Alfred Gebert <alfred.gebert@gmail.com>
To: libssh2-devel@cool.haxx.se
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

The buffer for the decompression (remote.comp_abstract) is
initialised in time when it is needed.
With this fix decompression is disabled when the buffer
(remote.comp_abstract) is not initialised.

Bug: http://trac.libssh2.org/ticket/200
---
 src/transport.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

This patch fixes bug #200 for me. Tested with JSCAPE sftp server.

diff --git a/src/transport.c b/src/transport.c
index 38e005a..c519f0a 100644
--- a/src/transport.c
+++ b/src/transport.c
@@ -199,7 +199,10 @@ fullpacket(LIBSSH2_SESSION * session, int
encrypted /* 1 or 0 */ )
         session->fullpacket_payload_len -= p->padding_length;

         /* Check for and deal with decompression */
-        if (session->remote.comp && session->remote.comp->compress) {
+        if (session->remote.comp &&
+            session->remote.comp->compress &&
+            session->remote.comp_abstract)
+        {
             unsigned char *data;
             size_t data_len;
             rc = session->remote.comp->decomp(session,
@@ -215,7 +218,6 @@ fullpacket(LIBSSH2_SESSION * session, int
encrypted /* 1 or 0 */ )
             p->payload = data;
             session->fullpacket_payload_len = data_len;
         }
-
         session->fullpacket_packet_type = p->payload[0];

         debugdump(session, "libssh2_transport_read() plain",
-- 
1.7.3.1.msysgit.0
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Thu Jan 27 19:21:39 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0RILIwQ012473;
	Thu, 27 Jan 2011 19:21:34 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0RILGJW012431
	for <libssh2-devel@cool.haxx.se>; Thu, 27 Jan 2011 19:21:16 +0100
Received: (qmail 23912 invoked from network); 27 Jan 2011 18:21:12 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 27 Jan 2011 18:21:12 -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, 27 Jan 2011 18:21:12 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #207: libssh2 (v1.2.1) crashes in
	libssh2_channel_read_ex due to invalid memory write
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/207#comment:3
Message-ID: <123.31846f994db80243ad7a46aa48100122@libssh2.stuge.se>
References: <108.1565998d459f8da1e1ca60375af1e978@libssh2.stuge.se>
X-Trac-Ticket-ID: 207
In-Reply-To: <108.1565998d459f8da1e1ca60375af1e978@libssh2.stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

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

 We upgraded libssh2 to 1.2.7 as suggested. Will report back with the
 findings once we have it.

 Thanks!

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

From libssh2-devel-bounces@cool.haxx.se  Mon Jan 31 15:51:01 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0VEocsI003999;
	Mon, 31 Jan 2011 15:50:57 +0100
Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com
	[209.85.212.54])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0VEoZd9003940
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Mon, 31 Jan 2011 15:50:36 +0100
Received: by vws9 with SMTP id 9so1925411vws.41
	for <libssh2-devel@cool.haxx.se>; Mon, 31 Jan 2011 06:50:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:date:message-id:subject:from:to
	:content-type; bh=y0KXjl1/qnIzOaowRAeHobRzvo8ISF413S/hj/uoovI=;
	b=OkbhZ+q8PSOuIB+9Gisu0LW5lPPPitFdWMPm4/wEohczG7LTJEaTmAWiAtIhu2vifx
	lL1b2Ca4ZeJ3gBv+mxJpZTj9xKuVaWvsyE+qBL2OZ3mGmWCuDUjPX4LzBpzdEQTyYz7m
	Zhu0gWsKBouuKk3quoM3WzEzbRilsQw2jijHw=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=eQGo5k7cgiPVRxg8ixXVv+0g9wPyTPLC3g1jpubKPlseeLmS1oQI1Vsg8pd+GWpWrn
	gGU717/9dVQ18qSBYqUDBta0MyMU1l8fO1dFxbkWxEjJiwivlxullePR2oo7AY+2n/A+
	G5SPUohcoWGXtWvk8Fx2lgyKXreLEPPeEBCww=
MIME-Version: 1.0
Received: by 10.229.75.21 with SMTP id w21mr5907484qcj.228.1296485427443; Mon,
	31 Jan 2011 06:50:27 -0800 (PST)
Received: by 10.229.238.204 with HTTP; Mon, 31 Jan 2011 06:50:27 -0800 (PST)
Date: Mon, 31 Jan 2011 15:50:27 +0100
Message-ID: <AANLkTimz+=qHCd6AWFz=8D2=d5khaGwyeWeiVW_py+0D@mail.gmail.com>
Subject: [PATCH] session_startup: manage server data before server
	identification
From: Alfred Gebert <alfred.gebert@gmail.com>
To: libssh2-devel@cool.haxx.se
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Fix the bug that libssh2 could not connect if the sftp server
sends data before sending the version string.

http://tools.ietf.org/html/rfc4253#section-4.2

"The server MAY send other lines of data before sending the version
string.  Each line SHOULD be terminated by a Carriage Return and Line
Feed.  Such lines MUST NOT begin with "SSH-", and SHOULD be encoded
in ISO-10646 UTF-8 [RFC3629] (language is not specified).  Clients
MUST be able to process such lines."
---
 src/session.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

Perhaps a nicer fix is to move the do loop inside banner_receive().

diff --git a/src/session.c b/src/session.c
index 0b05843..c8d21fe 100644
--- a/src/session.c
+++ b/src/session.c
@@ -659,11 +659,15 @@ session_startup(LIBSSH2_SESSION *session,
libssh2_socket_t sock)
     }

     if (session->startup_state == libssh2_NB_state_sent) {
-        rc = banner_receive(session);
-        if (rc) {
-            return _libssh2_error(session, rc,
-                                  "Failed getting banner");
-        }
+        do {
+            session->banner_TxRx_state = libssh2_NB_state_idle;
+
+            rc = banner_receive(session);
+            if (rc) {
+                return _libssh2_error(session, rc,
+                                      "Failed getting banner");
+            }
+        } while( strncmp( "SSH-", session->remote.banner, 4));

         session->startup_state = libssh2_NB_state_sent1;
     }
-- 
1.7.3.1.msysgit.0
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Mon Jan 31 16:30:20 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id p0VFUAWJ000310;
	Mon, 31 Jan 2011 16:30:18 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	p0VFU9AC000305
	for <libssh2-devel@cool.haxx.se>; Mon, 31 Jan 2011 16:30:09 +0100
Date: Mon, 31 Jan 2011 16:30:09 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: [PATCH] session_startup: manage server data before server
	identification
In-Reply-To: <AANLkTimz+=qHCd6AWFz=8D2=d5khaGwyeWeiVW_py+0D@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1101311628360.31693@tvnag.unkk.fr>
References: <AANLkTimz+=qHCd6AWFz=8D2=d5khaGwyeWeiVW_py+0D@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Mon, 31 Jan 2011, Alfred Gebert wrote:

> Fix the bug that libssh2 could not connect if the sftp server sends data 
> before sending the version string.
>
> http://tools.ietf.org/html/rfc4253#section-4.2

Nice! Thanks a lot.

It struck me that this method will overwrite remote.banner for subsequent 
"lines". I'm not sure it really matters, but then it also makes it a valid 
question why keeping the remote.banner around is done to start with?

-- 

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

