From libssh2-devel-bounces@cool.haxx.se  Wed Jun  1 06:06:45 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5146HWf020166;
	Wed, 1 Jun 2011 06:06:40 +0200
Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com
	[74.125.83.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5146DfH019750
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 1 Jun 2011 06:06:14 +0200
Received: by pvg11 with SMTP id 11so2963453pvg.41
	for <libssh2-devel@cool.haxx.se>; Tue, 31 May 2011 21:06:06 -0700 (PDT)
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=rFDuJqImwq4h1JR0fXduStke9MJMBJv3pRUpUuNIuGY=;
	b=g2yGbaN5noHuv3GvLFk1zNCBWUVqKx+2bAqvA2oBvTMsoRkRsQiz80EaMn+DDPvh+4
	6jih2iSICHPfxxqm6gzImOYQq1ZfT1Q0WNPu0DHVuZsEK2Jyxtjj8yYnebBpayPpVyhv
	CvxHqbbN+iFHu3dSbdmnC/cJxciaYuzPX8ygc=
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=C1Tw1lIwaW0igYnt8/7qAKPK5oCBa2wwjY8kDyAYuS9JtXy+/DI/pBovnB2+fKuw0G
	rs+SnQTbdYinmjaZWSEgIhjd8N8aGyPUoxA8XG7nJrmdFlUygW+WabAkiuQS0cGXLD02
	93qdDolOe2tNwz4EG9mT/DZZGZNECxUPn3r0w=
MIME-Version: 1.0
Received: by 10.68.23.99 with SMTP id l3mr887949pbf.302.1306901166802; Tue, 31
	May 2011 21:06:06 -0700 (PDT)
Received: by 10.68.58.137 with HTTP; Tue, 31 May 2011 21:06:06 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1105312351510.26627@tvnag.unkk.fr>
References: <BANLkTinWNhuCs-DJ7+b4V_=nA5hOqyD6xA@mail.gmail.com>
	<alpine.DEB.2.00.1105301027580.31551@tvnag.unkk.fr>
	<alpine.DEB.2.00.1105312338170.26627@tvnag.unkk.fr>
	<BANLkTi=v0Ew4nuNAUChuGGdin1Nv3oyQhA@mail.gmail.com>
	<alpine.DEB.2.00.1105312351510.26627@tvnag.unkk.fr>
Date: Wed, 1 Jun 2011 00:06:06 -0400
Message-ID: <BANLkTi=vOJQoSrmDR99GDPYc+U+1tgH+hQ@mail.gmail.com>
Subject: Re: Core dump when authentication fails?
From: Saqib Ali <saqib.ali.75@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 01 Jun 2011 06:06:45 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 01 Jun 2011 06:06:15 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1299644755=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1299644755==
Content-Type: multipart/alternative; boundary=bcaec5215677cdc5a604a49ea31a

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

>
>
>  I'll still test your changes. But can I get them from the daily snapshot
>> for June 1, 2011?
>>
>
> Sure! I've pushed them so they'll be included in upcoming snapshots.
>
>
>
It works great. Thanks!

% myProg
Enter File Name: myFile
Enter IP Addr: myIPAddr
Enter User Name: myUser
Enter Password: badpassword
* About to connect() to myIPAddr port 22 (#0)
*   Trying XX.XX.XXX.XXX... * Connected to myIPAddr (XX.XX.XXX.XXX) port 22
(#0)
* SSH authentication methods available:
gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
* Using ssh public key file /home/me/.ssg/id_dsa.pub
* Using ssh private key file /home/me/.ssh/id_dsa
* SSH public key authentication failed: Unable to open public key file
* Authentication failure
* Closing connection #0
Elapsed Time: 17 seconds | Xfer Stopped! stillRunning = 0
curl_multi_remove_handle() was successfull!

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

<div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class=3D"im=
"><br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
I&#39;ll still test your changes. But can I get them from the daily snapsho=
t for June 1, 2011?<br>
</blockquote>
<br></div>
Sure! I&#39;ve pushed them so they&#39;ll be included in upcoming snapshots=
.<div><div></div><div class=3D"h5"><br><br></div></div></blockquote></div><=
div><br></div><div>It works great. Thanks!</div><div><br></div><div><div>
% myProg</div><div>Enter File Name: myFile</div><div>Enter IP Addr: myIPAdd=
r</div><div>Enter User Name: myUser</div><div>Enter Password: badpassword</=
div><div>* About to connect() to=A0myIPAddr=A0port 22 (#0)</div><div>* =A0 =
Trying XX.XX.XXX.XXX... * Connected to=A0myIPAddr=A0(XX.XX.XXX.XXX) port 22=
 (#0)</div>
<div>* SSH authentication methods available: gssapi-keyex,gssapi-with-mic,p=
ublickey,password,keyboard-interactive</div><div>* Using ssh public key fil=
e /home/me/.ssg/id_dsa.pub</div><div>* Using ssh private key file /home/me/=
.ssh/id_dsa</div>
<div>* SSH public key authentication failed: Unable to open public key file=
</div><div>* Authentication failure</div><div>* Closing connection #0</div>=
<div>Elapsed Time: 17 seconds | Xfer Stopped! stillRunning =3D 0</div><div>
curl_multi_remove_handle() was successfull!</div></div><div><br></div>

--bcaec5215677cdc5a604a49ea31a--

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

--===============1299644755==--

From libssh2-devel-bounces@cool.haxx.se  Wed Jun  1 08:54:20 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p516s41R008322;
	Wed, 1 Jun 2011 08:54:18 +0200
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p516s3L8008316
	for <libssh2-devel@cool.haxx.se>; Wed, 1 Jun 2011 08:54:03 +0200
Date: Wed, 1 Jun 2011 08:54:03 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Core dump when authentication fails?
In-Reply-To: <BANLkTi=vOJQoSrmDR99GDPYc+U+1tgH+hQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1106010853290.30978@tvnag.unkk.fr>
References: <BANLkTinWNhuCs-DJ7+b4V_=nA5hOqyD6xA@mail.gmail.com>
	<alpine.DEB.2.00.1105301027580.31551@tvnag.unkk.fr>
	<alpine.DEB.2.00.1105312338170.26627@tvnag.unkk.fr>
	<BANLkTi=v0Ew4nuNAUChuGGdin1Nv3oyQhA@mail.gmail.com>
	<alpine.DEB.2.00.1105312351510.26627@tvnag.unkk.fr>
	<BANLkTi=vOJQoSrmDR99GDPYc+U+1tgH+hQ@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 01 Jun 2011 08:54:20 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 01 Jun 2011 08:54:04 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Wed, 1 Jun 2011, Saqib Ali wrote:

>> Sure! I've pushed them so they'll be included in upcoming snapshots.

> It works great. Thanks!

Great! Thanks for verifying and getting back to us.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Wed Jun  1 09:42:30 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p517gFgb003621;
	Wed, 1 Jun 2011 09:42:27 +0200
Received: from mail.dn-systems.net (amalthea.dnx.de [193.108.181.146])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p517gCFe003570
	(version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 1 Jun 2011 09:42:13 +0200
Received: from aktaia.intevation.org ([212.95.126.10]:44337 helo=intevation.de)
	by mail.dn-systems.net with esmtpsa
	(TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69)
	(envelope-from <michael.wiegand@greenbone.net>) id 1QRg3q-0003Ei-KQ
	for libssh2-devel@cool.haxx.se; Wed, 01 Jun 2011 09:41:52 +0200
Date: Wed, 1 Jun 2011 09:41:43 +0200
From: Michael Wiegand <michael.wiegand@greenbone.net>
To: Libssh2 Development Mailing List <libssh2-devel@cool.haxx.se>
Subject: Trouble with public key authentication
Message-ID: <20110601074143.GA14703@intevation.de>
Mail-Followup-To: Libssh2 Development Mailing List <libssh2-devel@cool.haxx.se>
MIME-Version: 1.0
Content-Disposition: inline
User-Agent: Mutt/1.5.18 (2008-05-17)
X-Spam-Score: -3.3 (---)
X-Scan-Signature: ab0350d27fe8f4004cbddefacd92c07f
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 01 Jun 2011 09:42:30 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 01 Jun 2011 09:42:13 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p517gFgb003621

Hello,

I am currently trying to implement ssh authentication through libssh2 in
order to execute a command on the remote system and return its result.

While libssh2 is working flawlessly with password authentication, I am
struggling to get it to work with public key authentication.

I have modeled my code for this part after the example in ssh2_exec.c --
however, when I call libssh2_userauth_publickey_fromfile() it returns
the -18, which means "Username/PublicKey combination invalid" as far as
I can tell.

I have built libssh2 with enable-debug, enabled the trace and set the
log level for the sshd on the remote system to DEBUG3. From what I can
tell from the logs, libssh2 sends the public key and then receives the
list of authentication methods, upon which the error is triggered:

=> libssh2_transport_read() plain (45 bytes)
0000: 33 00 00 00 27 70 75 62  6C 69 63 6B 65 79 2C 70 : 3...'publickey,p
0010: 61 73 73 77 6F 72 64 2C  6B 65 79 62 6F 61 72 64 : assword,keyboard
0020: 2D 69 6E 74 65 72 61 63  74 69 76 65 00          : -interactive.
[libssh2] 0.640831 Transport: Packet type 51 received, length=45
[libssh2] 0.640836 Transport: Looking for packet of type: 52
[libssh2] 0.640839 Transport: Looking for packet of type: 51
[libssh2] 0.640842 Failure Event: -18 - Username/PublicKey combination invalid

The sshd logs on the remote system do not show any failed login attempt,
it seems that the client simply disconnects.

The keypair in question works without any issues when used with "ssh -i"
and with the ssh functionality I'm trying to replace.

I've observed this behavior in both libssh2 1.2.7 and 1.2.8; it does not
seem to make a difference whether openssl or libgcrypt is used. The
private key in question is using a passphrase, if it matters.

Are there any obvious mistakes I'm making which would explain this
behavior? I've observed that libssh2_userauth_list() returns null if
executed in a non-blocking session, so I have tried setting the session
to non-blocking either after or before calling
libssh2_userauth_publickey_fromfile(), but that did not change anything.

If there is any other information you need, feel free to ask. I'm
looking forward to hearing from you.

Regards,

Michael

-- 
Michael Wiegand |  Greenbone Networks GmbH  |  http://www.greenbone.net/
Neuer Graben 17, 49074 OsnabrÃ¼ck, Germany | AG OsnabrÃ¼ck, HR B 202460
Executive Directors: Lukas Grunwald, Dr. Jan-Oliver Wagner

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

From libssh2-devel-bounces@cool.haxx.se  Thu Jun  2 04:33:55 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p522XTlH002991;
	Thu, 2 Jun 2011 04:33:50 +0200
Received: from mail102.csoft.net (postfix@mail102.csoft.net [205.205.219.4])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p522XR74002984
	for <libssh2-devel@cool.haxx.se>; Thu, 2 Jun 2011 04:33:27 +0200
Received: from mail102.csoft.net (localhost [127.0.0.1])
	by mail102.csoft.net (Postfix) with ESMTP id 44A033EF1787;
	Wed,  1 Jun 2011 22:33:26 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=message-id
	:date:from:mime-version:to:cc:subject:content-type
	:content-transfer-encoding; s=sel1; bh=+Y7eiKuhI6joAIQYQGkpdCK/s
	CM=; b=ID5ZGsQ8/SdBH68yNcyeVWdhnI11a8JAQIoXu2yNaVRNi7+05gtAAEinR
	7TU7sreuJMf3QOlHZ/1AWn5qhMR4BIr1AILCnvemlQYC2bVGJe85Xpe961yfYBYX
	fjuAhhQCGp5g3iT8I/0NK0/t2xcCVyODPSk/E+3+pLnSY8Q1Dg=
Received: from [172.16.8.69] (c-24-34-109-241.hsd1.ma.comcast.net
	[24.34.109.241])
	(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by mail102.csoft.net (Postfix) with ESMTPSA id 100613EF1770;
	Wed,  1 Jun 2011 22:33:25 -0400 (EDT)
Message-ID: <4DE6F675.5070702@fid4.com>
Date: Wed, 01 Jun 2011 22:33:25 -0400
From: "Michael C. Cambria" <mcc@fid4.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10
MIME-Version: 1.0
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Concurrent Channels on a Session
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 02 Jun 2011 04:33:55 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 02 Jun 2011 04:33:28 +0200 (CEST)
Cc: "Michael C. Cambria" <mcc@fid4.com>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se


Hi,

Is it possible to have more than one channel on a session?  (I might not 
have the terminology down just yet.)

What I'm interested in doing is have one ssh connection, and using it, 
invoke more than one subsystems on the server with several calls to 
libssh2_channel_subsystem()

I started looking at what sftp.c did to get one subsystem going.  That 
helped, but since I don't know the sftp protocol, I'm not sure how much 
is subsystem vs sftp.  I have one subsystem active.  I (think I) have a 
second going.  When I tried a third, I hit an error.  Before continuing, 
I thought I'd ask first, just to see if such a thing is possible.  It's 
also time now to go watch the hockey game. ;-)

Thanks,
MikeC


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

From libssh2-devel-bounces@cool.haxx.se  Thu Jun  2 05:06:06 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p52360pU016213;
	Thu, 2 Jun 2011 05:06:05 +0200
Received: from foo.stuge.se (qmailr@foo.stuge.se [212.181.44.140])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with SMTP id p5235wPu016208
	for <libssh2-devel@cool.haxx.se>; Thu, 2 Jun 2011 05:05:58 +0200
Received: (qmail 27889 invoked by uid 501); 2 Jun 2011 03:05:58 -0000
Message-ID: <20110602030558.27888.qmail@stuge.se>
Date: Thu, 2 Jun 2011 05:05:58 +0200
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: Concurrent Channels on a Session
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <4DE6F675.5070702@fid4.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <4DE6F675.5070702@fid4.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 02 Jun 2011 05:06:06 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 02 Jun 2011 05:05:59 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

Michael C. Cambria wrote:
> Is it possible to have more than one channel on a session?

Yes.


> What I'm interested in doing is have one ssh connection, and using it, 
> invoke more than one subsystems on the server with several calls to 
> libssh2_channel_subsystem()

It'll work fine.


> I'm not sure how much is subsystem vs sftp.

All is sftp. A subsystem is just an 8-bit clean encrypted
authenticated named communications channel.


> I have one subsystem active.  I (think I) have a second going. 
> When I tried a third, I hit an error.

What error? Please don't just post and say there's an error. Please
post detailed information about how you did what and *what* error you
got.


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

From libssh2-devel-bounces@cool.haxx.se  Thu Jun  2 12:52:48 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p52AqQUt017645;
	Thu, 2 Jun 2011 12:52:42 +0200
Received: from mail102.csoft.net (postfix@mail102.csoft.net [205.205.219.4])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p52AqNc2017588
	for <libssh2-devel@cool.haxx.se>; Thu, 2 Jun 2011 12:52:24 +0200
Received: from mail102.csoft.net (localhost [127.0.0.1])
	by mail102.csoft.net (Postfix) with ESMTP id 13B993EF168A
	for <libssh2-devel@cool.haxx.se>; Thu,  2 Jun 2011 06:52:23 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=csoft.net; h=message-id
	:date:from:mime-version:to:subject:references:in-reply-to
	:content-type:content-transfer-encoding; s=sel1; bh=ToW9mYa6uX+B
	EkjLPXMOYgpYpIk=; b=E20tyeeEIvFja6kkSBXKLaZtPDUHVVsjEE2RgeHLcRY4
	mZZ0Oyh/SH0GmC72CuOsAtMHFtCjv6UCDeo5RcWAhR2VrT2AQQTSccYSmPBdLrHP
	AkOCxCeO/Qs9MG9/hKY/lvKB3pZPu9FLd2lYgxVuyWsZTuZI8Px0EvAMM7ggtdY=
Received: from [172.16.8.69] (c-24-34-109-241.hsd1.ma.comcast.net
	[24.34.109.241])
	(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by mail102.csoft.net (Postfix) with ESMTPSA id E850A3EF166A
	for <libssh2-devel@cool.haxx.se>; Thu,  2 Jun 2011 06:52:22 -0400 (EDT)
Message-ID: <4DE76B64.6070300@fid4.com>
Date: Thu, 02 Jun 2011 06:52:20 -0400
From: "Michael C. Cambria" <mcc@fid4.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10
MIME-Version: 1.0
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Concurrent Channels on a Session
References: <4DE6F675.5070702@fid4.com> <20110602030558.27888.qmail@stuge.se>
In-Reply-To: <20110602030558.27888.qmail@stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 02 Jun 2011 12:52:48 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 02 Jun 2011 12:52:24 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On 6/1/2011 11:05 PM, Peter Stuge wrote:
> Michael C. Cambria wrote:
>> Is it possible to have more than one channel on a session?
> Yes.
>
> What error? Please don't just post and say there's an error. Please
> post detailed information about how you did what and *what* error you
> got.

Thanks.  Allocating a channel structure returned NULL the 3rd time.  I'm 
not looking for help (yet) on this, which is why I didn't post details.  
Before spending time trying to use multiple channels, I wanted to make 
sure it was possible.

Thanks,
MikeC



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

From libssh2-devel-bounces@cool.haxx.se  Thu Jun  2 15:34:24 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p52DY3jg006370;
	Thu, 2 Jun 2011 15:34:22 +0200
Received: from foo.stuge.se (qmailr@foo.stuge.se [212.181.44.140])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with SMTP id p52DY2Qv006315
	for <libssh2-devel@cool.haxx.se>; Thu, 2 Jun 2011 15:34:02 +0200
Received: (qmail 30805 invoked by uid 501); 2 Jun 2011 13:34:00 -0000
Message-ID: <20110602133400.30804.qmail@stuge.se>
Date: Thu, 2 Jun 2011 15:33:59 +0200
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: Concurrent Channels on a Session
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <4DE6F675.5070702@fid4.com> <20110602030558.27888.qmail@stuge.se>
	<4DE76B64.6070300@fid4.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <4DE76B64.6070300@fid4.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 02 Jun 2011 15:34:24 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 02 Jun 2011 15:34:02 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

Michael C. Cambria wrote:
>> What error?
>
> Allocating a channel structure returned NULL the 3rd time.

Call libssh2_session_last_error() to find out why?

And/or enable protocol tracing.

Keep in mind that the max number of channels per session is a
serverside policy.


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

From libssh2-devel-bounces@cool.haxx.se  Sat Jun  4 23:15:05 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p54LEa8S014268;
	Sat, 4 Jun 2011 23:15:00 +0200
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p54LDU8k013980
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Sat, 4 Jun 2011 23:13:31 +0200
Received: by qwc9 with SMTP id 9so1563978qwc.41
	for <libssh2-devel@cool.haxx.se>; Sat, 04 Jun 2011 14:13:26 -0700 (PDT)
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=MxWYVZQnanOHoM7H9dbqc0r8MROPLUIXoYZsG/M0Sjo=;
	b=PKHzWW9Mhz0qfC9anHxMPhZnf9l03fl9/T4W5n1oGFixbgDrf5WdfaQKNtRwGdxx51
	XxzVKAhmafd5oclm8yW2KDWnv8QUrfVhYZke+Dmq5ZFSNTV/5iDKnkTHwfDjthtPeuTT
	4ALvSdq7HwaslZ0E7dpgQV/S90dqMhlvH+rGc=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=WojMhCdxRByfv/aH8/BlT1gLTGjnoAZI+h9qRhw/WrdbIW5yfqaF5Up84JMis0W6VY
	gKDCw194grFrCzDBkZmq0gZPHeHQAg5cnrCJljktyeSHpGwpumxVL0VAxcSI58sDGEG0
	IQFHreVgMj0r/wQ2Bkv2gIogLEGH5hDb+U3Is=
MIME-Version: 1.0
Received: by 10.229.200.105 with SMTP id ev41mr2504107qcb.0.1307222006741;
	Sat, 04 Jun 2011 14:13:26 -0700 (PDT)
Received: by 10.229.248.200 with HTTP; Sat, 4 Jun 2011 14:13:26 -0700 (PDT)
Date: Sat, 4 Jun 2011 23:13:26 +0200
Message-ID: <BANLkTimHN2T7v5_=Y1xVLhjcQX+CB3nK6g@mail.gmail.com>
Subject: libssh2 does not compile with MSYS/MinGW
From: Vincent Torri <vincent.torri@gmail.com>
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Sat, 04 Jun 2011 23:15:05 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Sat, 04 Jun 2011 23:13:31 +0200 (CEST)
X-Mailman-Approved-At: Sat, 04 Jun 2011 23:14:35 +0200
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0317134822=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0317134822==
Content-Type: multipart/alternative; boundary=001636ef04375ab9dd04a4e957b4

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

Hey

I've downloaded the latest stable release and compiled it with MSYS/MinGW
and the examples failed to build because SOCKET is not defined (and any
program/lib trying to use libssh2 with MSYS/MninGW will fail to compile)

Indeed, WinSock2.h is included only with vc++. To fix that, line 90 must be
replaced by

#ifdef _WIN32

regards

Vincent Torri

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

Hey<br><br>I&#39;ve downloaded the latest stable release and compiled it with MSYS/MinGW and the examples failed to build because SOCKET is not defined (and any program/lib trying to use libssh2 with MSYS/MninGW will fail to compile)<br>
<br>Indeed, WinSock2.h is included only with vc++. To fix that, line 90 must be replaced by<br><br>#ifdef _WIN32<br><br>regards<br><br>Vincent Torri<br>

--001636ef04375ab9dd04a4e957b4--

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

--===============0317134822==--

From libssh2-devel-bounces@cool.haxx.se  Sat Jun  4 23:18:10 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p54LI80u015842;
	Sat, 4 Jun 2011 23:18:10 +0200
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p54LI7BR015835
	for <libssh2-devel@cool.haxx.se>; Sat, 4 Jun 2011 23:18:07 +0200
Date: Sat, 4 Jun 2011 23:18:07 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: libssh2 does not compile with MSYS/MinGW
In-Reply-To: <BANLkTimHN2T7v5_=Y1xVLhjcQX+CB3nK6g@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1106042317320.21634@tvnag.unkk.fr>
References: <BANLkTimHN2T7v5_=Y1xVLhjcQX+CB3nK6g@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Sat, 04 Jun 2011 23:18:10 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Sat, 04 Jun 2011 23:18:07 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Sat, 4 Jun 2011, Vincent Torri wrote:

> Indeed, WinSock2.h is included only with vc++. To fix that, line 90 must be 
> replaced by
>
> #ifdef _WIN32

Line 90 of what? And is that working for cygwin as well?

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Sat Jun  4 23:22:13 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p54LMAtu019621;
	Sat, 4 Jun 2011 23:22:13 +0200
Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com
	[209.85.216.175])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p54LM8cv019487
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Sat, 4 Jun 2011 23:22:09 +0200
Received: by qyk35 with SMTP id 35so251055qyk.20
	for <libssh2-devel@cool.haxx.se>; Sat, 04 Jun 2011 14:22:03 -0700 (PDT)
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=MABOrXinJFPQu7kaSYlvAjkwcgUU/WsasM3OtFhQhzo=;
	b=jnxKM9nUiriQDuzcCk6bGLStTSTNzNs1ROMFgtCARWpkCIi45rR9b8EedKH2U640tn
	av0BIpQASI75DQH3jbKyVuDIKXImh413oSvx+qlNcHIMka3qjt2RNal/ElrhpFF+wDkB
	o6M3hi6P1PYndNZPn9OE0GZA3tdr96vp94Oro=
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=sedPV6+IYRarc93frcTJ4+RNY+N8ys5jrULnSgIxeqxxd/fh+404jH9DtcHjK6hQXU
	ccfUuhOKQpPJhsFADr6AYZQIG3HaBS2GN0n8a+gSFhg4tX8Bqi8K5k4sYKc8n6QwnBhF
	nj6+mOHzky9CMNWKFACx3N1b7G8/2Xu6H4xUI=
MIME-Version: 1.0
Received: by 10.229.18.134 with SMTP id w6mr2654596qca.114.1307222523366; Sat,
	04 Jun 2011 14:22:03 -0700 (PDT)
Received: by 10.229.248.200 with HTTP; Sat, 4 Jun 2011 14:22:03 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1106042317320.21634@tvnag.unkk.fr>
References: <BANLkTimHN2T7v5_=Y1xVLhjcQX+CB3nK6g@mail.gmail.com>
	<alpine.DEB.2.00.1106042317320.21634@tvnag.unkk.fr>
Date: Sat, 4 Jun 2011 23:22:03 +0200
Message-ID: <BANLkTimafQwk=0ZcEpy4q8E=SpQRQTjnUQ@mail.gmail.com>
Subject: Re: libssh2 does not compile with MSYS/MinGW
From: Vincent Torri <vincent.torri@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Sat, 04 Jun 2011 23:22:13 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Sat, 04 Jun 2011 23:22:09 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1477389375=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1477389375==
Content-Type: multipart/alternative; boundary=0016e64f51e225cda404a4e97614

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

On Sat, Jun 4, 2011 at 11:18 PM, Daniel Stenberg <daniel@haxx.se> wrote:

> On Sat, 4 Jun 2011, Vincent Torri wrote:
>
>  Indeed, WinSock2.h is included only with vc++. To fix that, line 90 must
>> be replaced by
>>
>> #ifdef _WIN32
>>
>
> Line 90 of what? And is that working for cygwin as well?
>

oups, sorry, i forgot it : libssh2.h

and it will work for cygwin.

line 90 of libssh2.h is

#ifdef _MSC_VER

which mean that it's only for vc++

with

#ifdef _WIN32, it will include the windows headers for all Windows compiler

Vincent Torri

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

<br><br><div class=3D"gmail_quote">On Sat, Jun 4, 2011 at 11:18 PM, Daniel =
Stenberg <span dir=3D"ltr">&lt;<a href=3D"mailto:daniel@haxx.se">daniel@hax=
x.se</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class=3D"im">On Sat, 4 Jun 2011, Vincent Torri wrote:<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
Indeed, WinSock2.h is included only with vc++. To fix that, line 90 must be=
 replaced by<br>
<br>
#ifdef _WIN32<br>
</blockquote>
<br></div>
Line 90 of what? And is that working for cygwin as well?<br></blockquote><d=
iv><br>oups, sorry, i forgot it : libssh2.h<br><br>and it will work for cyg=
win.<br><br>line 90 of libssh2.h is<br><br>#ifdef _MSC_VER<br><br>which mea=
n that it&#39;s only for vc++<br>
<br>with<br><br>#ifdef _WIN32, it will include the windows headers for all =
Windows compiler<br><br>Vincent Torri <br></div></div>

--0016e64f51e225cda404a4e97614--

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

--===============1477389375==--

From libssh2-devel-bounces@cool.haxx.se  Sat Jun  4 23:25:33 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p54LPTlx024144;
	Sat, 4 Jun 2011 23:25:33 +0200
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p54LPSQg024127
	for <libssh2-devel@cool.haxx.se>; Sat, 4 Jun 2011 23:25:28 +0200
Date: Sat, 4 Jun 2011 23:25:28 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: libssh2 does not compile with MSYS/MinGW
In-Reply-To: <BANLkTimafQwk=0ZcEpy4q8E=SpQRQTjnUQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1106042325100.21634@tvnag.unkk.fr>
References: <BANLkTimHN2T7v5_=Y1xVLhjcQX+CB3nK6g@mail.gmail.com>
	<alpine.DEB.2.00.1106042317320.21634@tvnag.unkk.fr>
	<BANLkTimafQwk=0ZcEpy4q8E=SpQRQTjnUQ@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Sat, 04 Jun 2011 23:25:33 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Sat, 04 Jun 2011 23:25:28 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Sat, 4 Jun 2011, Vincent Torri wrote:

> oups, sorry, i forgot it : libssh2.h
>
> and it will work for cygwin.

Thanks, pushed the fix now!

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Sat Jun  4 23:32:15 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p54LWBBo026406;
	Sat, 4 Jun 2011 23:32:14 +0200
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p54LW8GV026382
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Sat, 4 Jun 2011 23:32:09 +0200
Received: by qwc9 with SMTP id 9so1567089qwc.41
	for <libssh2-devel@cool.haxx.se>; Sat, 04 Jun 2011 14:32:05 -0700 (PDT)
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=+A9Fmc/wUIrypUIVk74crMphg/VUwUwg1h6Qh95ZTqM=;
	b=mYG91jbqV3A1UK77hFjalBkRVhPdxq4xknsyhudPREvpiyrhkXPS1BsbxtlOEFEjV2
	fecvBhB29rswsdigBkcUd10sfVNS0tI9Joa6zmzeMoCgvoH4y1eqtCP4hdt2T7+fzCKt
	nEdJ1NilDut+oENWj5ppKUXg0eSeRo98PuXFU=
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=r2jTqx+UeISwA/dSmq/x7VZNvsMFdgS0xG/vHuNcpu6CwfLDzeVxS59QZxDAQw8V3U
	33FPU9YRdL2YU5ufdaIN6Z5J283y0imZAEKbGtFMoeI/BD2vmy1B4RNSkac1bgwhqz7x
	7AQQhUk24S2B7qqmd/gM9+Hmuo2/g1FeFdLck=
MIME-Version: 1.0
Received: by 10.229.52.34 with SMTP id f34mr2424637qcg.275.1307223125164; Sat,
	04 Jun 2011 14:32:05 -0700 (PDT)
Received: by 10.229.248.200 with HTTP; Sat, 4 Jun 2011 14:32:05 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1106042325100.21634@tvnag.unkk.fr>
References: <BANLkTimHN2T7v5_=Y1xVLhjcQX+CB3nK6g@mail.gmail.com>
	<alpine.DEB.2.00.1106042317320.21634@tvnag.unkk.fr>
	<BANLkTimafQwk=0ZcEpy4q8E=SpQRQTjnUQ@mail.gmail.com>
	<alpine.DEB.2.00.1106042325100.21634@tvnag.unkk.fr>
Date: Sat, 4 Jun 2011 23:32:05 +0200
Message-ID: <BANLkTinNa66x25zBKmViPHzCyM3P8RJExg@mail.gmail.com>
Subject: Re: libssh2 does not compile with MSYS/MinGW
From: Vincent Torri <vincent.torri@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Sat, 04 Jun 2011 23:32:15 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Sat, 04 Jun 2011 23:32:09 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0052116568=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0052116568==
Content-Type: multipart/alternative; boundary=0016367d53000484dd04a4e99acc

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

On Sat, Jun 4, 2011 at 11:25 PM, Daniel Stenberg <daniel@haxx.se> wrote:

> On Sat, 4 Jun 2011, Vincent Torri wrote:
>
>  oups, sorry, i forgot it : libssh2.h
>>
>> and it will work for cygwin.
>>
>
> Thanks, pushed the fix now!


When will the next release be available ? Because in the tuto I'm written, I
have to mention that modification, which is not really nice

thank you

Vincent Torri

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

<br><br><div class=3D"gmail_quote">On Sat, Jun 4, 2011 at 11:25 PM, Daniel =
Stenberg <span dir=3D"ltr">&lt;<a href=3D"mailto:daniel@haxx.se">daniel@hax=
x.se</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class=3D"im">On Sat, 4 Jun 2011, Vincent Torri wrote:<br>
<br>
</div><div class=3D"im"><blockquote class=3D"gmail_quote" style=3D"margin:0=
 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
oups, sorry, i forgot it : libssh2.h<br>
<br>
and it will work for cygwin.<br>
</blockquote>
<br></div>
Thanks, pushed the fix now!</blockquote><div><br>When will the next release=
 be available ? Because in the tuto I&#39;m written, I have to mention that=
 modification, which is not really nice<br><br>thank you<br><br>Vincent Tor=
ri <br>
</div></div><br>

--0016367d53000484dd04a4e99acc--

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

--===============0052116568==--

From libssh2-devel-bounces@cool.haxx.se  Sat Jun  4 23:41:26 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p54LfK7N030113;
	Sat, 4 Jun 2011 23:41:25 +0200
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p54LfJlx030106
	for <libssh2-devel@cool.haxx.se>; Sat, 4 Jun 2011 23:41:19 +0200
Date: Sat, 4 Jun 2011 23:41:19 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: libssh2 does not compile with MSYS/MinGW
In-Reply-To: <BANLkTinNa66x25zBKmViPHzCyM3P8RJExg@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1106042340080.21634@tvnag.unkk.fr>
References: <BANLkTimHN2T7v5_=Y1xVLhjcQX+CB3nK6g@mail.gmail.com>
	<alpine.DEB.2.00.1106042317320.21634@tvnag.unkk.fr>
	<BANLkTimafQwk=0ZcEpy4q8E=SpQRQTjnUQ@mail.gmail.com>
	<alpine.DEB.2.00.1106042325100.21634@tvnag.unkk.fr>
	<BANLkTinNa66x25zBKmViPHzCyM3P8RJExg@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Sat, 04 Jun 2011 23:41:26 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Sat, 04 Jun 2011 23:41:19 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Sat, 4 Jun 2011, Vincent Torri wrote:

> When will the next release be available ?

There's no release planned yet and this tiny change really seems like not big 
enough to trigger a new one.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Sat Jun  4 23:55:58 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p54LtrKX002798;
	Sat, 4 Jun 2011 23:55:57 +0200
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p54LtpcG002788
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Sat, 4 Jun 2011 23:55:51 +0200
Received: by qwc9 with SMTP id 9so1571077qwc.41
	for <libssh2-devel@cool.haxx.se>; Sat, 04 Jun 2011 14:55:47 -0700 (PDT)
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=jc2Mnhv94DHOCx6v5q+fZd4mlOhtG/HEC9Qncq2AqSw=;
	b=Q/D/YV/0B3zgUHoe2DdwCh7o5AKEv+ZcqdBTLZjBnCpqSYB4YmcR4Girg4/aRdGX2/
	jYE4mvp8u5stJeOVpxu427BcCutJ5HPlXcbyT+p9IHvJXk6JSmahkshV8S42dgQANB9R
	P2lf2zpon1iu0unbkd1ytrCTT0OdnJkiNVr2s=
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=trpgMLLC5HgpKGa1E5izfUL9Z8e6CWrRt+U2uj5Qubm5wm5+YFrThDqyT0YDO1Dd67
	jGc5ooJvSdb+AmASOJKX+cd5PGTxjXz6JAJAHOfHGbIx5WGaR/1eKIMwXmBBTV5OKpSR
	JQm191nEdHaqjTLK4Fq6Y8+mz1XwbDCeZnt+A=
MIME-Version: 1.0
Received: by 10.229.227.3 with SMTP id iy3mr2745210qcb.38.1307224547801; Sat,
	04 Jun 2011 14:55:47 -0700 (PDT)
Received: by 10.229.248.200 with HTTP; Sat, 4 Jun 2011 14:55:47 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1106042340080.21634@tvnag.unkk.fr>
References: <BANLkTimHN2T7v5_=Y1xVLhjcQX+CB3nK6g@mail.gmail.com>
	<alpine.DEB.2.00.1106042317320.21634@tvnag.unkk.fr>
	<BANLkTimafQwk=0ZcEpy4q8E=SpQRQTjnUQ@mail.gmail.com>
	<alpine.DEB.2.00.1106042325100.21634@tvnag.unkk.fr>
	<BANLkTinNa66x25zBKmViPHzCyM3P8RJExg@mail.gmail.com>
	<alpine.DEB.2.00.1106042340080.21634@tvnag.unkk.fr>
Date: Sat, 4 Jun 2011 23:55:47 +0200
Message-ID: <BANLkTikHybxQ=+D_9A9Chp6DwkXv1=g5jA@mail.gmail.com>
Subject: Re: libssh2 does not compile with MSYS/MinGW
From: Vincent Torri <vincent.torri@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Sat, 04 Jun 2011 23:55:58 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Sat, 04 Jun 2011 23:55:52 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0294182320=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0294182320==
Content-Type: multipart/alternative; boundary=00163646dad8d03aa104a4e9ee6d

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

On Sat, Jun 4, 2011 at 11:41 PM, Daniel Stenberg <daniel@haxx.se> wrote:

> On Sat, 4 Jun 2011, Vincent Torri wrote:
>
>  When will the next release be available ?
>>
>
> There's no release planned yet and this tiny change really seems like not
> big enough to trigger a new one.
>

the fact that it fixes compilation seems important to me, whatever its size
is, but you're the maintainer.

Vincent Torri

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

<br><br><div class=3D"gmail_quote">On Sat, Jun 4, 2011 at 11:41 PM, Daniel =
Stenberg <span dir=3D"ltr">&lt;<a href=3D"mailto:daniel@haxx.se">daniel@hax=
x.se</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class=3D"im">On Sat, 4 Jun 2011, Vincent Torri wrote:<br>
<br>
</div><div class=3D"im"><blockquote class=3D"gmail_quote" style=3D"margin:0=
 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
When will the next release be available ?<br>
</blockquote>
<br></div>
There&#39;s no release planned yet and this tiny change really seems like n=
ot big enough to trigger a new one.<br></blockquote><div><br>the fact that =
it fixes compilation seems important to me, whatever its size is, but you&#=
39;re the maintainer.<br>
<br>Vincent Torri <br></div></div>

--00163646dad8d03aa104a4e9ee6d--

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

--===============0294182320==--

From libssh2-devel-bounces@cool.haxx.se  Sun Jun  5 04:54:07 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p552ri0l012882;
	Sun, 5 Jun 2011 04:54:04 +0200
Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au
	[211.29.132.190])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p552rdxH012876
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Sun, 5 Jun 2011 04:53:42 +0200
Received: from desktop2 ([203.202.164.190]) (authenticated sender sisyphus1)
	by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	p552rOG3003595
	for <libssh2-devel@cool.haxx.se>; Sun, 5 Jun 2011 12:53:34 +1000
Message-ID: <A55195F4305149A3BA6A756D6DF509E7@desktop2>
From: "Sisyphus" <sisyphus1@optusnet.com.au>
To: "libssh2 development" <libssh2-devel@cool.haxx.se>
References: <BANLkTimHN2T7v5_=Y1xVLhjcQX+CB3nK6g@mail.gmail.com>
In-Reply-To: <BANLkTimHN2T7v5_=Y1xVLhjcQX+CB3nK6g@mail.gmail.com>
Subject: Re: libssh2 does not compile with MSYS/MinGW
Date: Sun, 5 Jun 2011 12:52:33 +1000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Windows Mail 6.0.6001.18416
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18612
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Sun, 05 Jun 2011 04:54:07 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Sun, 05 Jun 2011 04:53:43 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se


----- Original Message ----- 
From: "Vincent Torri"

> Indeed, WinSock2.h is included only with vc++.

No - winsock2.h is included with mingw, too.

> To fix that, line 90 must be
> replaced by
>
> #ifdef _WIN32

That would be line 90 of include/libssh2.h which I also had to similarly 
alter ? (I #ifdef'd WIN32 rather than _WIN32, but I don't think that 
matters.)

Cheers,
Rob

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

From libssh2-devel-bounces@cool.haxx.se  Wed Jun 15 07:15:30 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5F5Eus6024767;
	Wed, 15 Jun 2011 07:15:22 +0200
Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com
	[209.85.218.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5F5ErRv024742
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 15 Jun 2011 07:14:54 +0200
Received: by yic13 with SMTP id 13so38324yic.41
	for <libssh2-devel@cool.haxx.se>; Tue, 14 Jun 2011 22:14:48 -0700 (PDT)
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=A6icyXegkd597dLhLCu/v0BDAVJ/8FyMeBhvlGoYtOI=;
	b=qSaMndUQat9adf47+xXkk/7u5Ab5bYsEnF0rsYiFgZtp7/6XzpL3VTIt6QlE+afTjV
	z1TzcUf4yS02s9V6VXHhDmrwqbroVtO1gHNDBVVZjkZ7Cslh0D4r3D/izDw8sba4GpMI
	WmzdFKntlqpqvJotpAb+iV4f9xUeMy/5gA7fs=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=vpR9djwtdGpaD/iV2cRy6vx/NkGKUfwtRZwu1ZzBW7C8bL9TnYXFgX74KTKXET+qbu
	CZr6vC2pLxaifH1rG87Mi9/GYZIPfjbUIDLQx+tZRzLEADWesfRxZbfYcwXgiYx6ItgK
	JXHirgGlx0Nfx9BDwiBQVKXL9dRCVFJ/n+tnY=
MIME-Version: 1.0
Received: by 10.91.10.15 with SMTP id n15mr324829agi.77.1308114888119; Tue, 14
	Jun 2011 22:14:48 -0700 (PDT)
Received: by 10.90.73.7 with HTTP; Tue, 14 Jun 2011 22:14:47 -0700 (PDT)
Date: Wed, 15 Jun 2011 13:14:47 +0800
Message-ID: <BANLkTin4B1O6TN9KO76=dDntYQpMHoCzsg@mail.gmail.com>
Subject: proper buffer size for libssh2_sftp_read()
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.8 (giant.haxx.se [127.0.0.1]); Wed, 15 Jun 2011 07:15:30 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 15 Jun 2011 07:14:54 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1426594607=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1426594607==
Content-Type: multipart/alternative; boundary=0016362853ba3b57b404a5b93b34

--0016362853ba3b57b404a5b93b34
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: quoted-printable

Hi!

I get a problem when i download a file about 20M bytes via non-blocking
mode.

the main code:
    do {
        /* loop until we fail */
        while ((rc =3D libssh2_sftp_read(sftp_handle, mem,
            sizeof(mem))) =3D=3D LIBSSH2_ERROR_EAGAIN) {
                spin++;
                waitsocket(sock, session); /* now we wait */
        }
        if (rc > 0) {
            total +=3D rc;
        } else {
            fprintf(stderr, "rc=3D%d\n", rc);
            break;
        }
    } while (1);

if the mem size if 1024 or 1024 * 10. it will success.
if the mem size is char mem[1024 * 100] or bigger, it is failed,the errno i=
s
-9 or -25.

after enable debug trace=A3=ACit print many error messages:
[libssh2] 6.535906 Failure Event: -7 - Unable to send transfer-window
adjustment
packet, deferring
....
[libssh2] 6.515906 Failure Event: -24 - Remote sent more data than current
windo
w allows, truncating
....

finally ,it print=A3=BA
[libssh2] 6.546907 Failure Event: -25 - SFTP packet too large
[libssh2] 6.546907 Failure Event: -25 - Error waiting for FXP_READ ACK
rc=3D-25
11718000 bytes in 7 seconds makes 1674000.0 bytes/sec,spin: 9
[libssh2] 6.549907 Failure Event: -7 - Unable to send FXP_CLOSE command

what is the reason=A3=BF

another question , why not define the MACRO :LIBSSH2DEBUG in the debug mode=
.
when i want to enable trace=A3=ACi must define the macro LIBSSH2DEBUG manua=
lly
and compile it again.

best regards

zlliu

--0016362853ba3b57b404a5b93b34
Content-Type: text/html; charset=GB2312
Content-Transfer-Encoding: quoted-printable

<div>Hi!</div><div><br></div><div>I get a problem when i download a file ab=
out 20M bytes via non-blocking mode.</div><div><br></div><div>the main code=
:</div><div>&nbsp;&nbsp; &nbsp;do {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &n=
bsp;/* loop until we fail */&nbsp;</div><div>
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;while ((rc =3D libssh2_sftp_read(sftp_hand=
le, mem,</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sizeof(me=
m))) =3D=3D LIBSSH2_ERROR_EAGAIN) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp;spin++;</div><div>&nbsp;&nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;waitsocket(sock, session); /* now we wa=
it */&nbsp;</div>
<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp=
; &nbsp;if (rc &gt; 0) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp;total +=3D rc;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;} else {</=
div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fprintf(stderr, &qu=
ot;rc=3D%d\n&quot;, rc);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp;break;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;}</div>
<div>&nbsp;&nbsp; &nbsp;} while (1);</div><div><br></div><div>if the mem si=
ze if 1024 or 1024 * 10. it will success.</div><div>if the mem size is char=
 mem[1024 * 100] or bigger, it is failed,the errno is -9 or -25.</div><div>=
<br></div><div>
after enable debug trace=A3=ACit print many error messages:</div><div>[libs=
sh2] 6.535906 Failure Event: -7 - Unable to send transfer-window adjustment=
</div><div>packet, deferring</div><div>....</div><div>[libssh2] 6.515906 Fa=
ilure Event: -24 - Remote sent more data than current windo</div>
<div>w allows, truncating</div><div>....</div><div><br></div><div>finally ,=
it print=A3=BA</div><div>[libssh2] 6.546907 Failure Event: -25 - SFTP packe=
t too large</div><div>[libssh2] 6.546907 Failure Event: -25 - Error waiting=
 for FXP_READ ACK</div>
<div>rc=3D-25</div><div>11718000 bytes in 7 seconds makes 1674000.0 bytes/s=
ec,spin: 9</div><div>[libssh2] 6.549907 Failure Event: -7 - Unable to send =
FXP_CLOSE command</div><div><br></div><div>what is the reason=A3=BF</div><d=
iv>
<br></div><div>another question , why not define the MACRO :LIBSSH2DEBUG in=
 the debug mode.</div><div>when i want to enable trace=A3=ACi must define t=
he macro LIBSSH2DEBUG manually and compile it again.</div><div><br></div><d=
iv>
best regards&nbsp;</div><div><br></div><div>zlliu</div>

--0016362853ba3b57b404a5b93b34--

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

--===============1426594607==--

From libssh2-devel-bounces@cool.haxx.se  Wed Jun 15 09:23:52 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5F7NZuD032559;
	Wed, 15 Jun 2011 09:23:49 +0200
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5F7NYMQ032536
	for <libssh2-devel@cool.haxx.se>; Wed, 15 Jun 2011 09:23:34 +0200
Date: Wed, 15 Jun 2011 09:23:34 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: proper buffer size for libssh2_sftp_read()
In-Reply-To: <BANLkTin4B1O6TN9KO76=dDntYQpMHoCzsg@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1106150912360.21319@tvnag.unkk.fr>
References: <BANLkTin4B1O6TN9KO76=dDntYQpMHoCzsg@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-1790633430-1308122211=:21319"
Content-ID: <alpine.DEB.2.00.1106150916540.21319@tvnag.unkk.fr>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 15 Jun 2011 09:23:52 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 15 Jun 2011 09:23:34 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

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

--1129329158-1790633430-1308122211=:21319
Content-Type: TEXT/PLAIN; CHARSET=ISO-2022-JP; format=flowed
Content-ID: <alpine.DEB.2.00.1106150916541.21319@tvnag.unkk.fr>

On Wed, 15 Jun 2011, zl liu wrote:

> I get a problem when i download a file about 20M bytes via non-blocking 
> mode.

We need more details. I've successfully transfered much larger downloads than 
20M over SFTP - many times.

Is this with 1.2.8? On what operating system? What server software is on the 
other end?

> if the mem size if 1024 or 1024 * 10. it will success.

But the downside will of course be that transfers will never be very fast with 
such a small buffer...

> [libssh2] 6.535906 Failure Event: -7 - Unable to send transfer-window 
> adjustment packet, deferring

Interesting. -7 is LIBSSH2_ERROR_SOCKET_SEND returned from 
_libssh2_transport_send, which afaics only can occur if send() really returns 
an error that isn't EAGAIN. Is the problem repeatable? Can you add some 
logging of exactly what is stored in errno when the LIBSSH2_ERROR_SOCKET_SEND 
is returned?

Is that -7 line the first error you can spot in the trace output?

> [libssh2] 6.515906 Failure Event: -24 - Remote sent more data than current 
> window allows, truncating

That seems like a side-effect from the previous failure. When this happens I 
think it all goes downhill and badness is all over.

> another question , why not define the MACRO :LIBSSH2DEBUG in the debug mode. 
> when i want to enable trace$B!$(Ji must define the macro LIBSSH2DEBUG manually 
> and compile it again.

That's what we have "./configure --enable-debug" for!

-- 

  / daniel.haxx.se
--1129329158-1790633430-1308122211=:21319
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-1790633430-1308122211=:21319--

From libssh2-devel-bounces@cool.haxx.se  Wed Jun 15 11:15:09 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5F9EkQC030852;
	Wed, 15 Jun 2011 11:15:06 +0200
Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com
	[209.85.215.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5F9EjOY030793
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 15 Jun 2011 11:14:45 +0200
Received: by eyg7 with SMTP id 7so89690eyg.41
	for <libssh2-devel@cool.haxx.se>; Wed, 15 Jun 2011 02:14:36 -0700 (PDT)
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=ztL6PdrDWkB1rJkkCdmHGg+OiRAljDSBz5EYycZv3L0=;
	b=ilq08oEd+WoFMsNyIwI5WNLEq9WqchiXtUGbAd7d9bnvBg1Fse3q6cLMnqoKM3WIMF
	Ich9C0jvIukMhWfY2ZRxkPVDsZhUOCbNyJ5VoUtvNZYVuvZAVH0VejM5JoOJHqugZ+jw
	UOZB6645RE82c3dcU7QSqMgdgceWEzQLSJ2OY=
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=Fg9uCYWZ557sLOOuENXwD+106VzpkrGSvUUNNJpIOw7+xeQB/YqLzKV6lbAwLgfyNU
	Zb5kvyNRrXUYERmAn2KB884yXMIBezn3z8SF8Z8v57BhO2QG8m5l60OxuexT7d11Q9gj
	feJhaMZtO9ESvmVBqDx0BNDLU93XXZK1Zx1+w=
MIME-Version: 1.0
Received: by 10.14.96.199 with SMTP id r47mr130504eef.109.1308129276464; Wed,
	15 Jun 2011 02:14:36 -0700 (PDT)
Received: by 10.14.99.208 with HTTP; Wed, 15 Jun 2011 02:14:36 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1106150912360.21319@tvnag.unkk.fr>
References: <BANLkTin4B1O6TN9KO76=dDntYQpMHoCzsg@mail.gmail.com>
	<alpine.DEB.2.00.1106150912360.21319@tvnag.unkk.fr>
Date: Wed, 15 Jun 2011 17:14:36 +0800
Message-ID: <BANLkTiksN7Br93dvgcyPCtzsUTMEC7btsw@mail.gmail.com>
Subject: Re: proper buffer size for libssh2_sftp_read()
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.8 (giant.haxx.se [127.0.0.1]); Wed, 15 Jun 2011 11:15:09 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 15 Jun 2011 11:14:45 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0622816012=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============0622816012==
Content-Type: multipart/alternative; boundary=bcaec52be405d80e6e04a5bc94be

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

2011/6/15 Daniel Stenberg <daniel@haxx.se>

> On Wed, 15 Jun 2011, zl liu wrote:
>
>  I get a problem when i download a file about 20M bytes via non-blocking
>> mode.
>>
>
> We need more details. I've successfully transfered much larger downloads
> than 20M over SFTP - many times.
>
> Is this with 1.2.8? On what operating system? What server software is on
> the other end?

 yes,1.2.8. the test is running  on windows 7 .
the other end is Red Hat Enterprise Linux AS release 4 (Nahant Update 5)
sshd version is OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003

>
>
>  if the mem size if 1024 or 1024 * 10. it will success.
>>
>
> But the downside will of course be that transfers will never be very fast
> with such a small buffer...
>
>
>  [libssh2] 6.535906 Failure Event: -7 - Unable to send transfer-window
>> adjustment packet, deferring
>>
>
> Interesting. -7 is LIBSSH2_ERROR_SOCKET_SEND returned from
> _libssh2_transport_send, which afaics only can occur if send() really
> returns an error that isn't EAGAIN. Is the problem repeatable? Can you ad=
d
> some logging of exactly what is stored in errno when the
> LIBSSH2_ERROR_SOCKET_SEND is returned?
>
> yes  the problem  repeat too many times.
after i modify the misc.c::445 like : fprintf(stderr, "%s, %d\n", buffer,
GetLastError());
when -7, the system errno is 10035.
when -24 the system errno is 0.
when -25 the system errno is 10035.

the followingis is parts of the message=A3=BA
[libssh2] 14.483347 Failure Event: -24 - Remote sent more data than current
wind
ow allows, truncating, 0
[libssh2] 14.488347 Failure Event: -25 - SFTP packet too large, 10035
[libssh2] 14.488347 Failure Event: -25 - Error waiting for FXP_READ ACK,
10035

Is that -7 line the first error you can spot in the trace output?
>
> yes

>  [libssh2] 6.515906 Failure Event: -24 - Remote sent more data than curre=
nt
>> window allows, truncating
>>
>
> That seems like a side-effect from the previous failure. When this happen=
s
> I think it all goes downhill and badness is all over.
>
> yes, even i reconnect ,it doesn't work.

>  another question , why not define the MACRO :LIBSSH2DEBUG in the debug
>> mode. when i want to enable trace=A3=ACi must define the macro LIBSSH2DE=
BUG
>> manually and compile it again.
>>
>
> That's what we have "./configure --enable-debug" for!
>
> i compile on win32 .it can not execute ./configure.

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

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

<br><br><div class=3D"gmail_quote">2011/6/15 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 Wed, 15 Jun 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">
I get a problem when i download a file about 20M bytes via non-blocking mod=
e.<br>
</blockquote>
<br></div>
We need more details. I&#39;ve successfully transfered much larger download=
s than 20M over SFTP - many times.<br>
<br>
Is this with 1.2.8? On what operating system? What server software is on th=
e other end?</blockquote><div>&nbsp;yes,1.2.8. the test is running &nbsp;on=
 windows 7 .</div><div>the other end is Red Hat Enterprise Linux AS release=
 4 (Nahant Update 5)&nbsp;</div>
<div>sshd version is OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003</div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc =
solid;padding-left:1ex;"><div class=3D"im"><br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
if the mem size if 1024 or 1024 * 10. it will success.<br>
</blockquote>
<br></div>
But the downside will of course be that transfers will never be very fast w=
ith such a small buffer...<div class=3D"im"><br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
[libssh2] 6.535906 Failure Event: -7 - Unable to send transfer-window adjus=
tment packet, deferring<br>
</blockquote>
<br></div>
Interesting. -7 is LIBSSH2_ERROR_SOCKET_SEND returned from _libssh2_transpo=
rt_send, which afaics only can occur if send() really returns an error that=
 isn&#39;t EAGAIN. Is the problem repeatable? Can you add some logging of e=
xactly what is stored in errno when the LIBSSH2_ERROR_SOCKET_SEND is return=
ed?<br>

<br></blockquote><div>yes &nbsp;the problem&nbsp;&nbsp;repeat too many time=
s.&nbsp;</div><div>after i modify the misc.c::445 like :&nbsp;fprintf(stder=
r, &quot;%s, %d\n&quot;, buffer, GetLastError());</div><div>when -7, the sy=
stem errno is 10035.</div>
<div>when -24 the system errno is 0.</div><div>when -25 the system errno is=
 10035.</div><div><br></div><div>the followingis is parts of the message=A3=
=BA</div><div>[libssh2] 14.483347 Failure Event: -24 - Remote sent more dat=
a than current wind</div>
<div>ow allows, truncating, 0</div><div>[libssh2] 14.488347 Failure Event: =
-25 - SFTP packet too large, 10035</div><div>[libssh2] 14.488347 Failure Ev=
ent: -25 - Error waiting for FXP_READ ACK, 10035</div><div><br></div><block=
quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc=
 solid;padding-left:1ex;">

Is that -7 line the first error you can spot in the trace output?<div class=
=3D"im"><br></div></blockquote><div>yes&nbsp;</div><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex;">
<div class=3D"im">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
[libssh2] 6.515906 Failure Event: -24 - Remote sent more data than current =
window allows, truncating<br>
</blockquote>
<br></div>
That seems like a side-effect from the previous failure. When this happens =
I think it all goes downhill and badness is all over.<div class=3D"im"><br>=
</div></blockquote><div>yes, even i reconnect ,it doesn&#39;t work.&nbsp;</=
div>
<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">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
another question , why not define the MACRO :LIBSSH2DEBUG in the debug mode=
. when i want to enable trace=A3=ACi must define the macro LIBSSH2DEBUG man=
ually and compile it again.<br>
</blockquote>
<br></div>
That&#39;s what we have &quot;./configure --enable-debug&quot; for!<br><fon=
t color=3D"#888888">
<br></font></blockquote><div>i compile on win32 .it can not execute ./confi=
gure.</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bor=
der-left:1px #ccc solid;padding-left:1ex;"><font color=3D"#888888">
-- <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>

--bcaec52be405d80e6e04a5bc94be--

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

--===============0622816012==--

From libssh2-devel-bounces@cool.haxx.se  Wed Jun 15 13:56:42 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5FBuO2S027436;
	Wed, 15 Jun 2011 13:56:40 +0200
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5FBuNk0027428
	for <libssh2-devel@cool.haxx.se>; Wed, 15 Jun 2011 13:56:23 +0200
Date: Wed, 15 Jun 2011 13:56:23 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: proper buffer size for libssh2_sftp_read()
In-Reply-To: <BANLkTiksN7Br93dvgcyPCtzsUTMEC7btsw@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1106151339140.17838@tvnag.unkk.fr>
References: <BANLkTin4B1O6TN9KO76=dDntYQpMHoCzsg@mail.gmail.com>
	<alpine.DEB.2.00.1106150912360.21319@tvnag.unkk.fr>
	<BANLkTiksN7Br93dvgcyPCtzsUTMEC7btsw@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-1454072769-1308138983=:17838"
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 15 Jun 2011 13:56:42 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 15 Jun 2011 13:56:23 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

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

--1129329158-1454072769-1308138983=:17838
Content-Type: TEXT/PLAIN; charset=GB2312; format=flowed
Content-Transfer-Encoding: 8BIT

On Wed, 15 Jun 2011, zl liu wrote:

> yes,1.2.8. the test is running  on windows 7 .

Ok. We have received bug reports previously on Windows that we haven't been 
able to repeat elsewhere and afaik nobody has fixed.

> after i modify the misc.c::445 like : fprintf(stderr, "%s, %d\n", buffer, 
> GetLastError()); when -7, the system errno is 10035.

Can you see if you can figure out how that can happen?

10035 is WSAEWOULDBLOCK from what I understand, and src/misc.c:_libssh2_send() 
is written so that it converts such an error to return -EAGAIN. The code in 
src/transport.c that use _libssh2_send() then checks the return code for 
-EAGAIN and should not return anoter error than LIBSSH2_ERROR_EAGAIN (-37) for 
that case.

I think we should focus on the first error that happens as I suspect the ones 
following may be results of the first problem.

>>> another question , why not define the MACRO :LIBSSH2DEBUG in the debug
>>> mode. when i want to enable trace£¬i must define the macro LIBSSH2DEBUG
>>> manually and compile it again.
>>>
>> That's what we have "./configure --enable-debug" for!
>>
> i compile on win32 .it can not execute ./configure.

Ok. But how is defining LIBSSH2DEBUG somewhere not roughly the equivalent? 
What can we do to make it even simpler?

-- 

  / daniel.haxx.se
--1129329158-1454072769-1308138983=:17838
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-1454072769-1308138983=:17838--

From libssh2-devel-bounces@cool.haxx.se  Wed Jun 15 14:50:50 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5FCocnU030833;
	Wed, 15 Jun 2011 14:50:47 +0200
Received: from mx2-app.tibco.com (mx2-app.tibco.com [63.100.100.143])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5FCoYOd030822
	for <libssh2-devel@cool.haxx.se>; Wed, 15 Jun 2011 14:50:36 +0200
X-IronPort-AV: E=Sophos;i="4.65,370,1304319600"; d="scan'208";a="23341973"
Received: from tibco-5.tibco.com (HELO PA-CASHUB01.na.tibco.com)
	([63.100.100.5])
	by mx2-app.tibco.com with ESMTP; 15 Jun 2011 05:50:28 -0700
Received: from [10.98.32.13] (10.98.32.13) by PA-CASHUB01.na.tibco.com
	(10.106.137.46) with Microsoft SMTP Server (TLS) id 14.1.270.1;
	Wed, 15 Jun 2011 05:50:26 -0700
Message-ID: <4DF8AA91.3060806@tibco.com>
Date: Wed, 15 Jun 2011 14:50:25 +0200
From: Rodolphe Rocca <rodolphe.rocca@tibco.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10
MIME-Version: 1.0
To: <libssh2-devel@cool.haxx.se>
Subject: Which events to poll in session_startup when non-blocking ?
X-Originating-IP: [10.98.32.13]
X-TM-AS-Product-Ver: SMEX-10.0.0.1459-6.500.1024-18200.005
X-TM-AS-Result: No--0.646800-8.000000-31
X-TM-AS-User-Approved-Sender: No
X-TM-AS-User-Blocked-Sender: No
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 15 Jun 2011 14:50:50 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 15 Jun 2011 14:50:37 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

Hi,

first of all, thank you for this good SSH library. That's a pretty good 
piece of software :-)

Now I have a question.

In the libssh2 examples I can see this :

while ((rc = libssh2_session_startup(session, sock)) ==
            LIBSSH2_ERROR_EAGAIN);
if (rc) {
      fprintf(stderr, "Failure establishing SSH session: %d\n", rc);
      return -1;
}

That's fine for an example, but in some real cases it's going to consume 
lots of CPU cycles for nothing.

So what I want to do is to poll for new data in the loop instead of 
immediately returning, something like :

while ((rc = libssh2_session_startup(session, sock)) ==
            LIBSSH2_ERROR_EAGAIN)
{	
	ps = poll(&fds, 1, timeout);

	if (ps == -1)
	{
		// handle error
	}
	else if (ps == 0)
	{
		// handle timeout
	}
}

The problem with this is that I do not know if I have to POLLIN or POLLOUT.

What should I do ? Poll for both ?

NB : OpenSSL solved this by having two return codes : 
SSL_ERROR_WANT_READ and SSL_ERROR_WANT_WRITE

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

From libssh2-devel-bounces@cool.haxx.se  Wed Jun 15 15:10:25 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5FDAB4B010851;
	Wed, 15 Jun 2011 15:10:23 +0200
Received: from mail0.avcosystems.co.uk (mail0.avcosystems.co.uk
	[195.224.236.86])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5FDA9Lr010505
	(version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 15 Jun 2011 15:10:09 +0200
Received: from lexx.avco ([192.168.0.1] helo=lyta)
	by mail0.avcosystems.co.uk with esmtp (Exim 4.69 #1 (Debian))
	(envelope-from <mts-filtered@avcosystems.co.uk>) id 1QWprB-0005lb-EE
	for <libssh2-devel@cool.haxx.se>; Wed, 15 Jun 2011 14:10:05 +0100
From: "Mark Smith" <mts-filtered@avcosystems.co.uk>
To: "'libssh2 development'" <libssh2-devel@cool.haxx.se>
References: <BANLkTin4B1O6TN9KO76=dDntYQpMHoCzsg@mail.gmail.com><alpine.DEB.2.00.1106150912360.21319@tvnag.unkk.fr><BANLkTiksN7Br93dvgcyPCtzsUTMEC7btsw@mail.gmail.com>
	<alpine.DEB.2.00.1106151339140.17838@tvnag.unkk.fr>
Subject: RE: proper buffer size for libssh2_sftp_read()
Date: Wed, 15 Jun 2011 14:10:05 +0100
Keywords: Not filed
Message-ID: <69BCF844D39B4D079B8BB4A82A3189BE@internal.avcosystems.com>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 11
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6090
In-Reply-To: <alpine.DEB.2.00.1106151339140.17838@tvnag.unkk.fr>
Thread-Index: AcwrU1Z5VJqjWg/wRCOvZM44YzAuDwACV9Sw
X-AVCO-Scan-Signature: b18fef579cf44940ab882beec452e1ab
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 15 Jun 2011 15:10:24 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 15 Jun 2011 15:10:09 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

Daniel wrote:

> Ok. But how is defining LIBSSH2DEBUG somewhere not roughly the equivalent?

> What can we do to make it even simpler?

Did I forget to submit my patch to the MSVC head to include this in the
debug build?

-- 
Mark Smith

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

From libssh2-devel-bounces@cool.haxx.se  Wed Jun 15 22:58:34 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5FKw8nE021298;
	Wed, 15 Jun 2011 22:58:28 +0200
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5FKw6UQ021283
	for <libssh2-devel@cool.haxx.se>; Wed, 15 Jun 2011 22:58:06 +0200
Date: Wed, 15 Jun 2011 22:58:06 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Which events to poll in session_startup when non-blocking ?
In-Reply-To: <4DF8AA91.3060806@tibco.com>
Message-ID: <alpine.DEB.2.00.1106152252570.30811@tvnag.unkk.fr>
References: <4DF8AA91.3060806@tibco.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 15 Jun 2011 22:58:34 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 15 Jun 2011 22:58:06 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Wed, 15 Jun 2011, Rodolphe Rocca wrote:

> first of all, thank you for this good SSH library. That's a pretty good 
> piece of software :-)

Thanks, it is truly a team effort and we do our best in making it good!

> while ((rc = libssh2_session_startup(session, sock)) ==

Let me first gently point out that we offer libssh2_session_handshake() now as 
a replacement...

>           LIBSSH2_ERROR_EAGAIN)
> {
> 	ps = poll(&fds, 1, timeout);
>
> 	if (ps == -1)
> 	{
> 		// handle error
> 	}
> 	else if (ps == 0)
> 	{
> 		// handle timeout
> 	}
> }
>
> The problem with this is that I do not know if I have to POLLIN or POLLOUT.
>
> What should I do ? Poll for both ?

Call libssh2_session_block_directions() and it'll tell you!

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Thu Jun 16 05:05:55 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5G35TCw013729;
	Thu, 16 Jun 2011 05:05:50 +0200
Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com
	[209.85.215.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5G35RDc013717
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 16 Jun 2011 05:05:27 +0200
Received: by eyg7 with SMTP id 7so515935eyg.41
	for <libssh2-devel@cool.haxx.se>; Wed, 15 Jun 2011 20:05:22 -0700 (PDT)
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=RQHwsepWCcxewXyv/WoCJ+zdcgrXE92SucfuCbNXl38=;
	b=neH8yiiTGI8Bus2DE5mUKWjjzlrKpzWCJuGEh6opkOYTRWVCya/Qhk5r6xAj1ht203
	XbZyNbyA9jKn5a+Ddqjj4UjahrpaS+ozr1KoGzp4yrWNEI77LEKmpa+9yiVB/uRE+rdt
	tT0l8jDZY6wFpfeU5OYXYMeYPZkX4p8SInjCo=
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=sEjUTLfi/1GsLeMFswtmNQ1i0LNH56Rm4NpkgJ035GQu9K7SzjRVsuXITzyoKmq9C5
	jodI9y2kJANc1Gvm21D2IqzjtQdWulTtcEysopsOfNE9FaBacFMx5Sj5SRIqf261EHNu
	b38naY0ikwjOPjfqUsYhwfZToxyaLNsTkpxR4=
MIME-Version: 1.0
Received: by 10.14.95.202 with SMTP id p50mr176847eef.13.1308193522031; Wed,
	15 Jun 2011 20:05:22 -0700 (PDT)
Received: by 10.14.99.208 with HTTP; Wed, 15 Jun 2011 20:05:21 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1106151339140.17838@tvnag.unkk.fr>
References: <BANLkTin4B1O6TN9KO76=dDntYQpMHoCzsg@mail.gmail.com>
	<alpine.DEB.2.00.1106150912360.21319@tvnag.unkk.fr>
	<BANLkTiksN7Br93dvgcyPCtzsUTMEC7btsw@mail.gmail.com>
	<alpine.DEB.2.00.1106151339140.17838@tvnag.unkk.fr>
Date: Thu, 16 Jun 2011 11:05:21 +0800
Message-ID: <BANLkTim2ZSGqyMDN_Y3e=wbRSAwXtsox0g@mail.gmail.com>
Subject: Re: proper buffer size for libssh2_sftp_read()
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.8 (giant.haxx.se [127.0.0.1]); Thu, 16 Jun 2011 05:05:55 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 16 Jun 2011 05:05:28 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1224574766=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1224574766==
Content-Type: multipart/alternative; boundary=bcaec52be6b32d9d5304a5cb8a61

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

=D4=DA 2011=C4=EA6=D4=C215=C8=D5 =CF=C2=CE=E77:56=A3=ACDaniel Stenberg <dan=
iel@haxx.se>=D0=B4=B5=C0=A3=BA

> On Wed, 15 Jun 2011, zl liu wrote:
>
>  yes,1.2.8. the test is running  on windows 7 .
>>
>
> Ok. We have received bug reports previously on Windows that we haven't be=
en
> able to repeat elsewhere and afaik nobody has fixed.
>
>
>  after i modify the misc.c::445 like : fprintf(stderr, "%s, %d\n", buffer=
,
>> GetLastError()); when -7, the system errno is 10035.
>>
>
> Can you see if you can figure out how that can happen?
>
-7 haven't return to the caller. just the internal errno.

>
> 10035 is WSAEWOULDBLOCK from what I understand, and
> src/misc.c:_libssh2_send() is written so that it converts such an error t=
o
> return -EAGAIN. The code in src/transport.c that use _libssh2_send() then
> checks the return code for -EAGAIN and should not return anoter error tha=
n
> LIBSSH2_ERROR_EAGAIN (-37) for that case.
>
> I think we should focus on the first error that happens as I suspect the
> ones following may be results of the first problem.

after debug the libssh2,i get the following information:
the function call stack:
> libssh2.dll!send_existing(_LIBSSH2_SESSION * session=3D0x017d0068, const
unsigned char * data=3D0x014f1e00, unsigned int data_len=3D9, long *
ret=3D0x00035410)  =D0=D0605 C
  libssh2.dll!_libssh2_transport_send(_LIBSSH2_SESSION * session=3D0x017d00=
68,
const unsigned char * data=3D0x014f1e00, unsigned int data_len=3D9, const
unsigned char * data2=3D0x00000000, unsigned int data2_len=3D0)  =D0=D0696 =
+ 0x15 =D7=D6=BD=DA
C
  libssh2.dll!_libssh2_channel_receive_window_adjust(_LIBSSH2_CHANNEL *
channel=3D0x014f1c10, unsigned int adjustment=3D3932160, unsigned char forc=
e=3D0,
unsigned int * store=3D0x00000000)  =D0=D01581 + 0x1b =D7=D6=BD=DA C
  libssh2.dll!_libssh2_channel_read(_LIBSSH2_CHANNEL * channel=3D0x014f1c10=
,
int stream_id=3D0, char * buf=3D0x017dda08, unsigned int buflen=3D4)  =D0=
=D01882 + 0x12
=D7=D6=BD=DA C
  libssh2.dll!sftp_packet_read(_LIBSSH2_SFTP * sftp=3D0x017dd9e8)  =D0=D019=
3 + 0x25
=D7=D6=BD=DA C
  libssh2.dll!sftp_packet_requirev(_LIBSSH2_SFTP * sftp=3D0x017dd9e8, int
num_valid_responses=3D2, const unsigned char * valid_responses=3D0x1002c03c=
,
unsigned int request_id=3D1, unsigned char * * data=3D0x000359ec, unsigned =
int *
data_len=3D0x000359e0)  =D0=D0404 + 0x9 =D7=D6=BD=DA C
  libssh2.dll!sftp_read(_LIBSSH2_SFTP_HANDLE * handle=3D0x017dd3c0, char *
buffer=3D0x00035e68, unsigned int buffer_size=3D1024000)  =D0=D01204 + 0x25=
 =D7=D6=BD=DA C
  libssh2.dll!libssh2_sftp_read(_LIBSSH2_SFTP_HANDLE * hnd=3D0x017dd3c0, ch=
ar
* buffer=3D0x00035e68, unsigned int buffer_maxlen=3D1024000)  =D0=D01311 + =
0x11 =D7=D6=BD=DA C

the value in this point:
data:
0x01391E00  5d 00 00 00 00 00 3c 00  ].....<.
0x01391E08  00 00 00 00 0b 00 00 00  ........

p->odata:
0x01391E18  5e 00 00 00 00 00 00 00  ^.......
0x01391E20  1d 00 00 00 00 00 00 00  ........

data_len =3D p->olen =3D 9

i  haven't send anything, it is a internal mistake?


>  another question , why not define the MACRO :LIBSSH2DEBUG in the debug
>>>> mode. when i want to enable trace=A3=ACi must define the macro LIBSSH2=
DEBUG
>>>> manually and compile it again.
>>>>
>>>>  That's what we have "./configure --enable-debug" for!
>>>
>>>  i compile on win32 .it can not execute ./configure.
>>
>
> Ok. But how is defining LIBSSH2DEBUG somewhere not roughly the equivalent=
?
> What can we do to make it even simpler?
>
> --
>
thanks!

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

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

<br><br><div class=3D"gmail_quote">=D4=DA 2011=C4=EA6=D4=C215=C8=D5 =CF=C2=
=CE=E77:56=A3=ACDaniel Stenberg <span dir=3D"ltr">&lt;<a href=3D"mailto:dan=
iel@haxx.se">daniel@haxx.se</a>&gt;</span>=D0=B4=B5=C0=A3=BA<br><blockquote=
 class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc soli=
d;padding-left:1ex;">
<div class=3D"im">On Wed, 15 Jun 2011, zl liu wrote:<br>
<br>
</div><div class=3D"im"><blockquote class=3D"gmail_quote" style=3D"margin:0=
 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
yes,1.2.8. the test is running &nbsp;on windows 7 .<br>
</blockquote>
<br></div>
Ok. We have received bug reports previously on Windows that we haven&#39;t =
been able to repeat elsewhere and afaik nobody has fixed.<div class=3D"im">=
<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
after i modify the misc.c::445 like : fprintf(stderr, &quot;%s, %d\n&quot;,=
 buffer, GetLastError()); when -7, the system errno is 10035.<br>
</blockquote>
<br></div>
Can you see if you can figure out how that can happen?<br></blockquote><div=
>-7 haven&#39;t return to the caller. just the internal errno. &nbsp;</div>=
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;">

<br>
10035 is WSAEWOULDBLOCK from what I understand, and src/misc.c:_libssh2_sen=
d() is written so that it converts such an error to return -EAGAIN. The cod=
e in src/transport.c that use _libssh2_send() then checks the return code f=
or -EAGAIN and should not return anoter error than LIBSSH2_ERROR_EAGAIN (-3=
7) for that case.<br>

<br>
I think we should focus on the first error that happens as I suspect the on=
es following may be results of the first problem.</blockquote><div>after de=
bug the libssh2,i get the following information:</div><div>the function cal=
l stack:</div>
<div><div>&gt;<span class=3D"Apple-tab-span" style=3D"white-space:pre">	</s=
pan>libssh2.dll!send_existing(_LIBSSH2_SESSION * session=3D0x017d0068, cons=
t unsigned char * data=3D0x014f1e00, unsigned int data_len=3D9, long * ret=
=3D0x00035410) &nbsp;=D0=D0605<span class=3D"Apple-tab-span" style=3D"white=
-space:pre">	</span>C</div>
<div>&nbsp;<span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span=
>libssh2.dll!_libssh2_transport_send(_LIBSSH2_SESSION * session=3D0x017d006=
8, const unsigned char * data=3D0x014f1e00, unsigned int data_len=3D9, cons=
t unsigned char * data2=3D0x00000000, unsigned int data2_len=3D0) &nbsp;=D0=
=D0696 + 0x15 =D7=D6=BD=DA<span class=3D"Apple-tab-span" style=3D"white-spa=
ce:pre">	</span>C</div>
<div>&nbsp;<span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span=
>libssh2.dll!_libssh2_channel_receive_window_adjust(_LIBSSH2_CHANNEL * chan=
nel=3D0x014f1c10, unsigned int adjustment=3D3932160, unsigned char force=3D=
0, unsigned int * store=3D0x00000000) &nbsp;=D0=D01581 + 0x1b =D7=D6=BD=DA<=
span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>C</div>
<div>&nbsp;<span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span=
>libssh2.dll!_libssh2_channel_read(_LIBSSH2_CHANNEL * channel=3D0x014f1c10,=
 int stream_id=3D0, char * buf=3D0x017dda08, unsigned int buflen=3D4) &nbsp=
;=D0=D01882 + 0x12 =D7=D6=BD=DA<span class=3D"Apple-tab-span" style=3D"whit=
e-space:pre">	</span>C</div>
<div>&nbsp;<span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span=
>libssh2.dll!sftp_packet_read(_LIBSSH2_SFTP * sftp=3D0x017dd9e8) &nbsp;=D0=
=D0193 + 0x25 =D7=D6=BD=DA<span class=3D"Apple-tab-span" style=3D"white-spa=
ce:pre">	</span>C</div><div>&nbsp;<span class=3D"Apple-tab-span" style=3D"w=
hite-space:pre">	</span>libssh2.dll!sftp_packet_requirev(_LIBSSH2_SFTP * sf=
tp=3D0x017dd9e8, int num_valid_responses=3D2, const unsigned char * valid_r=
esponses=3D0x1002c03c, unsigned int request_id=3D1, unsigned char * * data=
=3D0x000359ec, unsigned int * data_len=3D0x000359e0) &nbsp;=D0=D0404 + 0x9 =
=D7=D6=BD=DA<span class=3D"Apple-tab-span" style=3D"white-space:pre">	</spa=
n>C</div>
<div>&nbsp;<span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span=
>libssh2.dll!sftp_read(_LIBSSH2_SFTP_HANDLE * handle=3D0x017dd3c0, char * b=
uffer=3D0x00035e68, unsigned int buffer_size=3D1024000) &nbsp;=D0=D01204 + =
0x25 =D7=D6=BD=DA<span class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span>C</div>
<div>&nbsp;<span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span=
>libssh2.dll!libssh2_sftp_read(_LIBSSH2_SFTP_HANDLE * hnd=3D0x017dd3c0, cha=
r * buffer=3D0x00035e68, unsigned int buffer_maxlen=3D1024000) &nbsp;=D0=D0=
1311 + 0x11 =D7=D6=BD=DA<span class=3D"Apple-tab-span" style=3D"white-space=
:pre">	</span>C</div>
</div><div><br></div><div>the value in this point:</div><div><div>data:</di=
v><div>0x01391E00 &nbsp;5d 00 00 00 00 00 3c 00 &nbsp;].....&lt;.</div><div=
>0x01391E08 &nbsp;00 00 00 00 0b 00 00 00 &nbsp;........</div><div><br></di=
v><div>p-&gt;odata:</div>
<div>0x01391E18 &nbsp;5e 00 00 00 00 00 00 00 &nbsp;^.......</div><div>0x01=
391E20 &nbsp;1d 00 00 00 00 00 00 00 &nbsp;........</div><div><br></div><di=
v>data_len =3D p-&gt;olen =3D 9</div></div><div><br></div><div>i &nbsp;have=
n&#39;t send anything, it is a&nbsp;internal&nbsp;mistake?</div>
<div>&nbsp;</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex;"><div class=3D"im">
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><blockquote class=3D"gmail_quote" style=3D"m=
argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;=
padding-left:1ex">

another question , why not define the MACRO :LIBSSH2DEBUG in the debug<br>
mode. when i want to enable trace=A3=ACi must define the macro LIBSSH2DEBUG=
<br>
manually and compile it again.<br>
<br>
</blockquote>
That&#39;s what we have &quot;./configure --enable-debug&quot; for!<br>
<br>
</blockquote>
i compile on win32 .it can not execute ./configure.<br>
</blockquote>
<br></div>
Ok. But how is defining LIBSSH2DEBUG somewhere not roughly the equivalent? =
What can we do to make it even simpler?<br><font class=3D"Apple-style-span"=
 color=3D"#888888"><br></font></blockquote><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<font color=3D"#888888">
-- <br></font></blockquote><div>thanks!&nbsp;</div><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex;"><font color=3D"#888888">
<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>

--bcaec52be6b32d9d5304a5cb8a61--

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

--===============1224574766==--

From libssh2-devel-bounces@cool.haxx.se  Thu Jun 16 05:07:26 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5G37OwN014083;
	Thu, 16 Jun 2011 05:07:26 +0200
Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com
	[209.85.215.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5G37N7s014078
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 16 Jun 2011 05:07:23 +0200
Received: by eyg7 with SMTP id 7so516407eyg.41
	for <libssh2-devel@cool.haxx.se>; Wed, 15 Jun 2011 20:07:18 -0700 (PDT)
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=ZIMW8ZxmzS3/+hU32o4Uz1gkLkZrdqaS9qEyLJYre8o=;
	b=i+ehgtotrnQIobYIgmcu2NzlZHTUXYLBSDX1K2PyUwUFqo3XWhjxFqS5Mj9KdAY/qb
	qLAdtqD5tjIWaRkHR55N+toF3iTr8uqoEEGTsLQgYvgBaiw9whiJHheNz/hppyYqs8Hq
	aERZi5Nvz+I/YnzisziAdehFfzJ0T4e2T7BUw=
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=fe6ybX7JDTWaKvgprYjOmxOo/RxfyEtoKUDrYVPbS06/wHGuHxITSn9FezP8U8Tj4i
	kyVBZS3+sBTwmksA2zDcHnCyJOE+Lli/F1GjlrtONrxzM6SuvHWzbM3BF6qiWZngDbbG
	2DMlYcn6EA1IAwz7D6kA33NSrkb7S6zTT/M50=
MIME-Version: 1.0
Received: by 10.14.11.132 with SMTP id 4mr172722eex.45.1308193638691; Wed, 15
	Jun 2011 20:07:18 -0700 (PDT)
Received: by 10.14.99.208 with HTTP; Wed, 15 Jun 2011 20:07:18 -0700 (PDT)
In-Reply-To: <69BCF844D39B4D079B8BB4A82A3189BE@internal.avcosystems.com>
References: <BANLkTin4B1O6TN9KO76=dDntYQpMHoCzsg@mail.gmail.com>
	<alpine.DEB.2.00.1106150912360.21319@tvnag.unkk.fr>
	<BANLkTiksN7Br93dvgcyPCtzsUTMEC7btsw@mail.gmail.com>
	<alpine.DEB.2.00.1106151339140.17838@tvnag.unkk.fr>
	<69BCF844D39B4D079B8BB4A82A3189BE@internal.avcosystems.com>
Date: Thu, 16 Jun 2011 11:07:18 +0800
Message-ID: <BANLkTimt+2CFT5xRchfxMBXckdJYfKM62w@mail.gmail.com>
Subject: Re: proper buffer size for libssh2_sftp_read()
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.8 (giant.haxx.se [127.0.0.1]); Thu, 16 Jun 2011 05:07:26 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 16 Jun 2011 05:07:23 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1621874047=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1621874047==
Content-Type: multipart/alternative; boundary=0016364c7b0921b4d904a5cb9176

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

2011/6/15 Mark Smith <mts-filtered@avcosystems.co.uk>

> Daniel wrote:
>
> > Ok. But how is defining LIBSSH2DEBUG somewhere not roughly the
> equivalent?
>
> > What can we do to make it even simpler?
>
> Did I forget to submit my patch to the MSVC head to include this in the
> debug build?
>
the libssh2.dsp  is in the win32/.gitignore.
can you tell me how to use msvcproj.head ? i work with visual studio 2005.

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

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

<br><br><div class=3D"gmail_quote">2011/6/15 Mark Smith <span dir=3D"ltr">&=
lt;<a href=3D"mailto:mts-filtered@avcosystems.co.uk">mts-filtered@avcosyste=
ms.co.uk</a>&gt;</span><br><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class=3D"im">Daniel wrote:<br>
<br>
&gt; Ok. But how is defining LIBSSH2DEBUG somewhere not roughly the equival=
ent?<br>
<br>
&gt; What can we do to make it even simpler?<br>
<br>
</div>Did I forget to submit my patch to the MSVC head to include this in t=
he<br>
debug build?<br></blockquote><div>the libssh2.dsp =A0is in the win32/.gitig=
nore.=A0</div><div>can you tell me how to use=A0msvcproj.head=A0? i work wi=
th visual studio 2005.=A0</div><blockquote class=3D"gmail_quote" style=3D"m=
argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
--<br>
<font color=3D"#888888">Mark Smith<br>
</font><div><div></div><div class=3D"h5"><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>

--0016364c7b0921b4d904a5cb9176--

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

--===============1621874047==--

From libssh2-devel-bounces@cool.haxx.se  Thu Jun 16 07:21:08 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5G5KpVf024492;
	Thu, 16 Jun 2011 07:21:04 +0200
Received: from parmail05.sgcib.com (parmail05.sgcib.com [207.45.249.176])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5G5KnbE024391
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 16 Jun 2011 07:20:50 +0200
X-IronPort-AV: E=Sophos;i="4.65,373,1304287200"; d="scan'208";a="130872828"
To: libssh2-devel@cool.haxx.se
Subject: Authentication Using Public Key / Private keys returns
	LIBSSH2_ERROR_FILE [NC]
MIME-Version: 1.0
Message-ID: <OF326DC84C.F27A15C4-ON652578B1.001BAA43-652578B1.001D503F@fr.world.socgen>
From: Suresh MUNUGOTI <suresh.munugoti@socgen.com>
Date: Thu, 16 Jun 2011 10:50:39 +0530
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 16 Jun 2011 07:21:08 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 16 Jun 2011 07:20:50 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0349280061=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

This is a multipart message in MIME format.
--===============0349280061==
Content-Type: multipart/alternative; boundary="=_alternative 001D503C652578B1_="

This is a multipart message in MIME format.
--=_alternative 001D503C652578B1_=
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"

Hi,

I am trying to authenticate into SFTP server by using the following 
function call.

LIBSSH2_API int libssh2_userauth_publickey_fromfile_ex(LIBSSH2_SESSION 
*session,
                                       const char *username,
                                       unsigned int username_len,
                                       const char *publickey,
                                       const char *privatekey,
                                       const char *passphrase);

The function is returning LIBSSH2_ERROR_FILE .

I cross checked by using the File Zilla client by adding the Private key. 
I am successfully authenticated.

The Public/Private key pairs are generated by PuttyGen.

Could you please help me whether i need to change the public and private 
files format compatible to LibSSH2.


Regards,
Suresh
*************************************************************************
This message and any attachments (the "message") are confidential, intended solely for the addressee(s), and may contain legally privileged information.
Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration.   
Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or
falsified.
                              ************
Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et susceptibles de contenir des informations couvertes 
par le secret professionnel. 
Ce message est etabli a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite.
Tout message electronique est susceptible d'alteration. 
La SOCIETE GENERALE et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie.
*************************************************************************

--=_alternative 001D503C652578B1_=
Content-Transfer-Encoding: 7bit
Content-Type: text/html; charset="us-ascii"


<br><font size=2 face="sans-serif">Hi,</font>
<br>
<br><font size=2 face="sans-serif">I am trying to authenticate into SFTP
server by using the following function call.</font>
<br>
<br><font size=2>LIBSSH2_API </font><font size=2 color=blue>int </font><font size=2>libssh2_userauth_publickey_fromfile_ex(LIBSSH2_SESSION
*session,</font>
<br><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=2 color=blue>const</font><font size=2> </font><font size=2 color=blue>char</font><font size=2>
*username,</font>
<br><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=2 color=blue>unsigned</font><font size=2> </font><font size=2 color=blue>int</font><font size=2>
username_len,</font>
<br><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=2 color=blue>const</font><font size=2> </font><font size=2 color=blue>char</font><font size=2>
*publickey,</font>
<br><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=2 color=blue>const</font><font size=2> </font><font size=2 color=blue>char</font><font size=2>
*privatekey,</font>
<br><font size=2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=2 color=blue>const</font><font size=2> </font><font size=2 color=blue>char</font><font size=2>
*passphrase);</font>
<br>
<br><font size=2 face="sans-serif">The function is returning<b> </b></font><font size=2><b>LIBSSH2_ERROR_FILE
</b></font><font size=2 face="sans-serif"><b>.</b></font>
<br>
<br><font size=2 face="sans-serif">I cross checked by using the File Zilla
client by adding the Private key. I am successfully authenticated.</font>
<br>
<br><font size=2 face="sans-serif">The Public/Private key pairs are generated
by PuttyGen.</font>
<br>
<br><font size=2 face="sans-serif">Could you please help me whether i need
to change the public and private files format compatible to LibSSH2.</font>
<br>
<br>
<br><font size=2 face="sans-serif">Regards,</font>
<br><font size=2 face="sans-serif">Suresh</font>
<br><font face="monospace">*************************************************************************<br>
This message and any attachments (the "message") are confidential, intended solely for the addressee(s), and may contain legally privileged information.<br>
Any unauthorised use or dissemination is prohibited. E-mails are susceptible to alteration.&nbsp;  <br>
Neither SOCIETE GENERALE nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or<br>
falsified.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ************<br>
Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et susceptibles de contenir des informations couvertes <br>
par le secret professionnel. <br>
Ce message est etabli a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite.<br>
Tout message electronique est susceptible d'alteration. <br>
La SOCIETE GENERALE et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie.<br>
*************************************************************************</font>
--=_alternative 001D503C652578B1_=--


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

--===============0349280061==--

From libssh2-devel-bounces@cool.haxx.se  Thu Jun 16 11:27:54 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5G9RYCx005086;
	Thu, 16 Jun 2011 11:27:50 +0200
Received: from mx1-app.tibco.com (mx1-app.tibco.com [63.100.100.142])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5G9RTJr005070
	for <libssh2-devel@cool.haxx.se>; Thu, 16 Jun 2011 11:27:32 +0200
X-IronPort-AV: E=Sophos;i="4.65,374,1304319600"; d="scan'208";a="25415148"
Received: from tibco-5.tibco.com (HELO PA-CASHUB01.na.tibco.com)
	([63.100.100.5])
	by mx1-app.tibco.com with ESMTP; 16 Jun 2011 02:27:19 -0700
Received: from [10.98.32.32] (10.98.32.32) by PA-CASHUB01.na.tibco.com
	(10.106.137.46) with Microsoft SMTP Server (TLS) id 14.1.270.1;
	Thu, 16 Jun 2011 02:27:18 -0700
Message-ID: <4DF9CC74.8080503@tibco.com>
Date: Thu, 16 Jun 2011 11:27:16 +0200
From: Rodolphe Rocca <rodolphe.rocca@tibco.com>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10
MIME-Version: 1.0
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Which events to poll in session_startup when non-blocking ?
References: <4DF8AA91.3060806@tibco.com>
	<alpine.DEB.2.00.1106152252570.30811@tvnag.unkk.fr>
In-Reply-To: <alpine.DEB.2.00.1106152252570.30811@tvnag.unkk.fr>
X-Originating-IP: [10.98.32.32]
X-TM-AS-Product-Ver: SMEX-10.0.0.1459-6.500.1024-18202.004
X-TM-AS-Result: No--9.248800-8.000000-31
X-TM-AS-User-Approved-Sender: No
X-TM-AS-User-Blocked-Sender: No
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 16 Jun 2011 11:27:54 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 16 Jun 2011 11:27:33 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On 06/15/2011 10:58 PM, Daniel Stenberg wrote:
> On Wed, 15 Jun 2011, Rodolphe Rocca wrote:
>
>> first of all, thank you for this good SSH library. That's a pretty
>> good piece of software :-)
>
> Thanks, it is truly a team effort and we do our best in making it good!
>
>> while ((rc = libssh2_session_startup(session, sock)) ==
>
> Let me first gently point out that we offer libssh2_session_handshake()
> now as a replacement...

Thank you, your suggestion is very welcome :-)

>> LIBSSH2_ERROR_EAGAIN)
>> {
>> ps = poll(&fds, 1, timeout);
>>
>> if (ps == -1)
>> {
>> // handle error
>> }
>> else if (ps == 0)
>> {
>> // handle timeout
>> }
>> }
>>
>> The problem with this is that I do not know if I have to POLLIN or
>> POLLOUT.
>>
>> What should I do ? Poll for both ?
>
> Call libssh2_session_block_directions() and it'll tell you!

That is exactly what I was looking for.

I would suggest two things to make libssh2 even easier to use by newbies 
than it is today :

  - use libssh2_session_handshake and libssh2_session_block_directions 
in the examples

  - deprecate libssh2_session_startup in favor of libssh2_session_handshake

Thanks a lot.

--
Rodolphe



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

From libssh2-devel-bounces@cool.haxx.se  Thu Jun 16 12:04:10 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5GA42p7024881;
	Thu, 16 Jun 2011 12:04:10 +0200
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5GA41W3024848
	for <libssh2-devel@cool.haxx.se>; Thu, 16 Jun 2011 12:04:01 +0200
Date: Thu, 16 Jun 2011 12:04:01 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Which events to poll in session_startup when non-blocking ?
In-Reply-To: <4DF9CC74.8080503@tibco.com>
Message-ID: <alpine.DEB.2.00.1106161202220.18105@tvnag.unkk.fr>
References: <4DF8AA91.3060806@tibco.com>
	<alpine.DEB.2.00.1106152252570.30811@tvnag.unkk.fr>
	<4DF9CC74.8080503@tibco.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 16 Jun 2011 12:04:10 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 16 Jun 2011 12:04:01 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Thu, 16 Jun 2011, Rodolphe Rocca wrote:

> I would suggest two things to make libssh2 even easier to use by newbies 
> than it is today :
>
> - use libssh2_session_handshake and libssh2_session_block_directions in the 
> examples
>
> - deprecate libssh2_session_startup in favor of libssh2_session_handshake

We welcome patches that clean up and improve the examples or even add new 
ones!

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Thu Jun 16 23:58:26 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5GLw5fm021053;
	Thu, 16 Jun 2011 23:58:21 +0200
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5GLw33v021046
	for <libssh2-devel@cool.haxx.se>; Thu, 16 Jun 2011 23:58:03 +0200
Date: Thu, 16 Jun 2011 23:58:03 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: proper buffer size for libssh2_sftp_read()
In-Reply-To: <BANLkTim2ZSGqyMDN_Y3e=wbRSAwXtsox0g@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1106162354440.27179@tvnag.unkk.fr>
References: <BANLkTin4B1O6TN9KO76=dDntYQpMHoCzsg@mail.gmail.com>
	<alpine.DEB.2.00.1106150912360.21319@tvnag.unkk.fr>
	<BANLkTiksN7Br93dvgcyPCtzsUTMEC7btsw@mail.gmail.com>
	<alpine.DEB.2.00.1106151339140.17838@tvnag.unkk.fr>
	<BANLkTim2ZSGqyMDN_Y3e=wbRSAwXtsox0g@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-682545814-1308261483=:27179"
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 16 Jun 2011 23:58:26 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 16 Jun 2011 23:58:03 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

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

--1129329158-682545814-1308261483=:27179
Content-Type: TEXT/PLAIN; charset=GB2312; format=flowed
Content-Transfer-Encoding: 8BIT

On Thu, 16 Jun 2011, zl liu wrote:

>> Can you see if you can figure out how that can happen?

> -7 haven't return to the caller. just the internal errno.

I'm confused. So which line of code logged the -7 you showed originally?

> after debug the libssh2,i get the following information:
> the function call stack:
>> libssh2.dll!send_existing(_LIBSSH2_SESSION * session=0x017d0068, const
> unsigned char * data=0x014f1e00, unsigned int data_len=9, long *
> ret=0x00035410)  ÐÐ605 C
>  libssh2.dll!_libssh2_transport_send(_LIBSSH2_SESSION * session=0x017d0068,
> const unsigned char * data=0x014f1e00, unsigned int data_len=9, const
> unsigned char * data2=0x00000000, unsigned int data2_len=0)  ÐÐ696 + 0x15 ×Ö½Ú
> C
>
> i haven't send anything, it is a internal mistake?

I don't understand. Are you saying this was the first call to 
_libssh2_transport_send() ? What do you mean with you haven't send anything?

-- 

  / daniel.haxx.se
--1129329158-682545814-1308261483=:27179
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-682545814-1308261483=:27179--

From libssh2-devel-bounces@cool.haxx.se  Fri Jun 17 04:01:42 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5H21I0E003042;
	Fri, 17 Jun 2011 04:01:38 +0200
Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com
	[209.85.215.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5H21Fpg002516
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Fri, 17 Jun 2011 04:01:15 +0200
Received: by eyg7 with SMTP id 7so1001332eyg.41
	for <libssh2-devel@cool.haxx.se>; Thu, 16 Jun 2011 19:01:11 -0700 (PDT)
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=fyO6ZSevg+K/TWUokFV/MlghixWY87+flGiVSfvDfDw=;
	b=FYdaa2Du3K2N2xRIzGwPTDHigGiqgwWkF1M00L1Z3T8DwVBYD1Brro4uOZIutU6Ai7
	UVETcIHLGM+A/86wZnCy48TEOBY/o3FnJ7qn1hNMj1dVqpRHRSQ87SE8aL+BOk48whjT
	JX4DPzCQjeSZ5i/dZ2q/MassviU6gif55l6RQ=
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=qeOPf2kogsVizUuyK8FMW4sEwZjqNbYyTiTvYdy6zlqPeRsZRsser9N2bgYpoQ5njF
	VzYHndmL0Ei1gzo5AEAiWu+GKXoe8amvzoTWfx0RT/JGqCNrOQ8gg9dHsC5eT33zAF97
	/P5/pyo41Zjo85VZd5gRyzzlXogS0jHxi2tnw=
MIME-Version: 1.0
Received: by 10.14.11.132 with SMTP id 4mr656153eex.45.1308276070842; Thu, 16
	Jun 2011 19:01:10 -0700 (PDT)
Received: by 10.14.99.208 with HTTP; Thu, 16 Jun 2011 19:01:10 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1106162354440.27179@tvnag.unkk.fr>
References: <BANLkTin4B1O6TN9KO76=dDntYQpMHoCzsg@mail.gmail.com>
	<alpine.DEB.2.00.1106150912360.21319@tvnag.unkk.fr>
	<BANLkTiksN7Br93dvgcyPCtzsUTMEC7btsw@mail.gmail.com>
	<alpine.DEB.2.00.1106151339140.17838@tvnag.unkk.fr>
	<BANLkTim2ZSGqyMDN_Y3e=wbRSAwXtsox0g@mail.gmail.com>
	<alpine.DEB.2.00.1106162354440.27179@tvnag.unkk.fr>
Date: Fri, 17 Jun 2011 10:01:10 +0800
Message-ID: <BANLkTikJyWvQVqM23YgSdfwbCggh1hmKWw@mail.gmail.com>
Subject: Re: proper buffer size for libssh2_sftp_read()
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.8 (giant.haxx.se [127.0.0.1]); Fri, 17 Jun 2011 04:01:42 +0200 (CEST)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Fri, 17 Jun 2011 04:01:16 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1988725173=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

--===============1988725173==
Content-Type: multipart/alternative; boundary=0016364c7b0978835a04a5dec2b9

--0016364c7b0978835a04a5dec2b9
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: quoted-printable

=D4=DA 2011=C4=EA6=D4=C217=C8=D5 =C9=CF=CE=E75:58=A3=ACDaniel Stenberg <dan=
iel@haxx.se>=D0=B4=B5=C0=A3=BA

> On Thu, 16 Jun 2011, zl liu wrote:
>
>  Can you see if you can figure out how that can happen?
>>>
>>
>  -7 haven't return to the caller. just the internal errno.
>>
>
> I'm confused. So which line of code logged the -7 you showed originally?


That's my fault.
I mean before the first  -7 error message is print, the function call stack
is:

 libssh2.dll!send_existing(_LIBSSH2_SESSION * session=3D0x017d0068, const
unsigned char * data=3D0x014f1e00, unsigned int data_len=3D9, long *
ret=3D0x00035410)  =D0=D0605 C
  libssh2.dll!_libssh2_transport_send(_LIBSSH2_SESSION * session=3D0x017d00=
68,
const unsigned char * data=3D0x014f1e00, unsigned int data_len=3D9, const
unsigned char * data2=3D0x00000000, unsigned int data2_len=3D0)  =D0=D0696 =
+ 0x15 =D7=D6=BD=DA
C
  libssh2.dll!_libssh2_channel_receive_window_adjust(_LIBSSH2_CHANNEL *
channel=3D0x014f1c10, unsigned int adjustment=3D3932160, unsigned char forc=
e=3D0,
unsigned int * store=3D0x00000000)  =D0=D01581 + 0x1b =D7=D6=BD=DA C
  libssh2.dll!_libssh2_channel_read(_LIBSSH2_CHANNEL * channel=3D0x014f1c10=
,
int stream_id=3D0, char * buf=3D0x017dda08, unsigned int buflen=3D4)  =D0=
=D01882 + 0x12
=D7=D6=BD=DA C
  libssh2.dll!sftp_packet_read(_LIBSSH2_SFTP * sftp=3D0x017dd9e8)  =D0=D019=
3 + 0x25
=D7=D6=BD=DA C
  libssh2.dll!sftp_packet_requirev(_LIBSSH2_SFTP * sftp=3D0x017dd9e8, int
num_valid_responses=3D2, const unsigned char * valid_responses=3D0x1002c03c=
,
unsigned int request_id=3D1, unsigned char * * data=3D0x000359ec, unsigned =
int *
data_len=3D0x000359e0)  =D0=D0404 + 0x9 =D7=D6=BD=DA C
  libssh2.dll!sftp_read(_LIBSSH2_SFTP_HANDLE * handle=3D0x017dd3c0, char *
buffer=3D0x00035e68, unsigned int buffer_size=3D1024000)  =D0=D01204 + 0x25=
 =D7=D6=BD=DA C
  libssh2.dll!libssh2_sftp_read(_LIBSSH2_SFTP_HANDLE * hnd=3D0x017dd3c0, ch=
ar
* buffer=3D0x00035e68, unsigned int buffer_maxlen=3D1024000)  =D0=D01311 + =
0x11 =D7=D6=BD=DA C

Now the breakpoint is in the Transport.c,line 605.
The variable memory is:
data:
0x01391E00  5d 00 00 00 00 00 3c 00  ].....<.
0x01391E08  00 00 00 00 0b 00 00 00  ........

p->odata:
0x01391E18  5e 00 00 00 00 00 00 00  ^.......
0x01391E20  1d 00 00 00 00 00 00 00  ........
As you see data !=3D p->odata, so the function send_existing() will
return LIBSSH2_ERROR_BAD_USE
 to the function _libssh2_transport_send() line 696.
the function _libssh2_transport_send() then return LIBSSH2_ERROR_BAD_USE to
the function _libssh2_channel_receive_window_adjust() line 1581 as follow:
rc =3D _libssh2_transport_send(channel->session, channel->adjust_adjust, 9,
                                 NULL, 0);
    if (rc =3D=3D LIBSSH2_ERROR_EAGAIN) {
        _libssh2_error(channel->session, rc,
                       "Would block sending window adjust");
        return rc;
    }
    else if (rc) {
        channel->adjust_queue =3D adjustment;
        return _libssh2_error(channel->session, LIBSSH2_ERROR_SOCKET_SEND,
                              "Unable to send transfer-window adjustment "
                              "packet, deferring");
    }
    else {
        channel->remote.window_size +=3D adjustment;
    }

because rc !=3D LIBSSH2_ERROR_EAGAIN and rc !=3D 0, so the
function _libssh2_transport_send() :1589 will print error message -7
and return -7 to the caller _libssh2_channel_read():1882
{
{
rc =3D _libssh2_channel_receive_window_adjust(channel,

 (LIBSSH2_CHANNEL_WINDOW_DEFAULT*60), 0, NULL);
        if (rc =3D=3D LIBSSH2_ERROR_EAGAIN)
            return rc;

        _libssh2_debug(session, LIBSSH2_TRACE_CONN,
                       "channel_read() filled %d adjusted %d",
                       bytes_read, buflen);
        /* continue in 'created' state to drain the already read packages
           first before starting to empty the socket further */
        channel->read_state =3D libssh2_NB_state_created;
    }

    return bytes_read;
}
the function _libssh2_channel_read() will return bytes_read but not -7,in m=
y
test ,bytes_read  is 4.
so -7 will not return to the user level.
After that any call to the function send_existing() will print an error
message -7 .

i haven't send anything, it is a internal mistake?
>>
>
> I don't understand. Are you saying this was the first call to
> _libssh2_transport_send() ? What do you mean with you haven't send anythi=
ng?

 I was to download a file, i only invoked the function libssh2_sftp_read(),
so i have not send anything in the user level. but the error is
from send_existing() , so i say it's a internal bug. No offense.

>

--=20
>
thanks.

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

--0016364c7b0978835a04a5dec2b9
Content-Type: text/html; charset=GB2312
Content-Transfer-Encoding: quoted-printable

<br><br><div class=3D"gmail_quote">=D4=DA 2011=C4=EA6=D4=C217=C8=D5 =C9=CF=
=CE=E75:58=A3=ACDaniel Stenberg <span dir=3D"ltr">&lt;<a href=3D"mailto:dan=
iel@haxx.se">daniel@haxx.se</a>&gt;</span>=D0=B4=B5=C0=A3=BA<br><blockquote=
 class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc soli=
d;padding-left:1ex;">
<div class=3D"im">On Thu, 16 Jun 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"><blockquote class=3D"gmail_quote" style=3D"m=
argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Can you see if you can figure out how that can happen?<br>
</blockquote></blockquote>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
-7 haven&#39;t return to the caller. just the internal errno.<br>
</blockquote>
<br></div>
I&#39;m confused. So which line of code logged the -7 you showed originally=
?</blockquote><div>&nbsp;</div><div>That&#39;s my fault.</div><div>I mean b=
efore the first &nbsp;-7 error message is print, the function call stack is=
:</div>
<div><br></div><div>&nbsp;libssh2.dll!send_existing(_LIBSSH2_SESSION * sess=
ion=3D0x017d0068, const unsigned char * data=3D0x014f1e00, unsigned int dat=
a_len=3D9, long * ret=3D0x00035410) &nbsp;=D0=D0605<span class=3D"Apple-tab=
-span" style=3D"white-space: pre; ">	</span>C</div>
<div>&nbsp;<span class=3D"Apple-tab-span" style=3D"white-space: pre; ">	</s=
pan>libssh2.dll!_libssh2_transport_send(_LIBSSH2_SESSION * session=3D0x017d=
0068, const unsigned char * data=3D0x014f1e00, unsigned int data_len=3D9, c=
onst unsigned char * data2=3D0x00000000, unsigned int data2_len=3D0) &nbsp;=
=D0=D0696 + 0x15 =D7=D6=BD=DA<span class=3D"Apple-tab-span" style=3D"white-=
space: pre; ">	</span>C</div>
<div>&nbsp;<span class=3D"Apple-tab-span" style=3D"white-space: pre; ">	</s=
pan>libssh2.dll!_libssh2_channel_receive_window_adjust(_LIBSSH2_CHANNEL * c=
hannel=3D0x014f1c10, unsigned int adjustment=3D3932160, unsigned char force=
=3D0, unsigned int * store=3D0x00000000) &nbsp;=D0=D01581 + 0x1b =D7=D6=BD=
=DA<span class=3D"Apple-tab-span" style=3D"white-space: pre; ">	</span>C</d=
iv>
<div>&nbsp;<span class=3D"Apple-tab-span" style=3D"white-space: pre; ">	</s=
pan>libssh2.dll!_libssh2_channel_read(_LIBSSH2_CHANNEL * channel=3D0x014f1c=
10, int stream_id=3D0, char * buf=3D0x017dda08, unsigned int buflen=3D4) &n=
bsp;=D0=D01882 + 0x12 =D7=D6=BD=DA<span class=3D"Apple-tab-span" style=3D"w=
hite-space: pre; ">	</span>C</div>
<div>&nbsp;<span class=3D"Apple-tab-span" style=3D"white-space: pre; ">	</s=
pan>libssh2.dll!sftp_packet_read(_LIBSSH2_SFTP * sftp=3D0x017dd9e8) &nbsp;=
=D0=D0193 + 0x25 =D7=D6=BD=DA<span class=3D"Apple-tab-span" style=3D"white-=
space: pre; ">	</span>C</div><div>
&nbsp;<span class=3D"Apple-tab-span" style=3D"white-space: pre; ">	</span>l=
ibssh2.dll!sftp_packet_requirev(_LIBSSH2_SFTP * sftp=3D0x017dd9e8, int num_=
valid_responses=3D2, const unsigned char * valid_responses=3D0x1002c03c, un=
signed int request_id=3D1, unsigned char * * data=3D0x000359ec, unsigned in=
t * data_len=3D0x000359e0) &nbsp;=D0=D0404 + 0x9 =D7=D6=BD=DA<span class=3D=
"Apple-tab-span" style=3D"white-space: pre; ">	</span>C</div>
<div>&nbsp;<span class=3D"Apple-tab-span" style=3D"white-space: pre; ">	</s=
pan>libssh2.dll!sftp_read(_LIBSSH2_SFTP_HANDLE * handle=3D0x017dd3c0, char =
* buffer=3D0x00035e68, unsigned int buffer_size=3D1024000) &nbsp;=D0=D01204=
 + 0x25 =D7=D6=BD=DA<span class=3D"Apple-tab-span" style=3D"white-space: pr=
e; ">	</span>C</div>
<div>&nbsp;<span class=3D"Apple-tab-span" style=3D"white-space: pre; ">	</s=
pan>libssh2.dll!libssh2_sftp_read(_LIBSSH2_SFTP_HANDLE * hnd=3D0x017dd3c0, =
char * buffer=3D0x00035e68, unsigned int buffer_maxlen=3D1024000) &nbsp;=D0=
=D01311 + 0x11 =D7=D6=BD=DA<span class=3D"Apple-tab-span" style=3D"white-sp=
ace: pre; ">	</span>C&nbsp;</div>
<div><br></div><div>Now the breakpoint is in the Transport.c,line 605.&nbsp=
;</div><div><div>The variable memory is:</div><div>data:</div><div>0x01391E=
00 &nbsp;5d 00 00 00 00 00 3c 00 &nbsp;].....&lt;.</div><div>0x01391E08 &nb=
sp;00 00 00 00 0b 00 00 00 &nbsp;........</div>
<div><br></div><div>p-&gt;odata:</div><div>0x01391E18 &nbsp;5e 00 00 00 00 =
00 00 00 &nbsp;^.......</div><div>0x01391E20 &nbsp;1d 00 00 00 00 00 00 00 =
&nbsp;........</div></div><div>As you see data !=3D p-&gt;odata, so the fun=
ction send_existing() will return&nbsp;LIBSSH2_ERROR_BAD_USE&nbsp;</div>
<div>&nbsp;to the function&nbsp;_libssh2_transport_send() line 696.</div><d=
iv>the function&nbsp;_libssh2_transport_send() then return&nbsp;LIBSSH2_ERR=
OR_BAD_USE to the function&nbsp;_libssh2_channel_receive_window_adjust() li=
ne 1581 as follow:</div>
<div><div>rc =3D _libssh2_transport_send(channel-&gt;session, channel-&gt;a=
djust_adjust, 9,</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; NULL,=
 0);</div><div>&nbsp;&nbsp; &nbsp;if (rc =3D=3D LIBSSH2_ERROR_EAGAIN) {</di=
v><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;_libssh2_error(channel-&gt;session,=
 rc,</div>
<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &quot;Would block sending window adjust&quot;);</div><div>&nbs=
p;&nbsp; &nbsp; &nbsp; &nbsp;return rc;</div><div>&nbsp;&nbsp; &nbsp;}</div=
><div>&nbsp;&nbsp; &nbsp;else if (rc) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp=
; &nbsp;channel-&gt;adjust_queue =3D adjustment;</div><div>&nbsp;&nbsp; &nb=
sp; &nbsp; &nbsp;return _libssh2_error(channel-&gt;session, LIBSSH2_ERROR_S=
OCKET_SEND,</div>
<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;Unable to send transfer-windo=
w adjustment &quot;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&quot;pack=
et, deferring&quot;);</div><div>&nbsp;&nbsp; &nbsp;}</div><div>&nbsp;&nbsp;=
 &nbsp;else {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;channel-&gt;remote=
.window_size +=3D adjustment;</div>
<div>&nbsp;&nbsp; &nbsp;}</div></div><div><br></div><div>because rc !=3D&nb=
sp;LIBSSH2_ERROR_EAGAIN and rc !=3D 0, so the function&nbsp;_libssh2_transp=
ort_send() :1589 will print error message -7</div><div>and return -7 to the=
 caller&nbsp;_libssh2_channel_read():1882</div>
<div>{</div><div>{</div><div>rc =3D _libssh2_channel_receive_window_adjust(=
channel,</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(LIBSSH2_CHANNEL_WI=
NDOW_DEFAULT*60), 0, NULL);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (=
rc =3D=3D LIBSSH2_ERROR_EAGAIN)</div>
<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return rc;</div><div><b=
r></div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;_libssh2_debug(session, LIBSS=
H2_TRACE_CONN,</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;channel_read() filled %d adjusted %d=
&quot;,</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; bytes_read, buflen);</div>
<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;/* continue in &#39;created&#39; stat=
e to drain the already read packages</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &=
nbsp; &nbsp; first before starting to empty the socket further */</div><div=
>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;channel-&gt;read_state =3D libssh2_NB_sta=
te_created;</div>
<div>&nbsp;&nbsp; &nbsp;}</div><div><br></div><div>&nbsp;&nbsp; &nbsp;retur=
n bytes_read;</div><div>}&nbsp;</div><div>the function _libssh2_channel_rea=
d() will return&nbsp;bytes_read but not -7,in my test ,bytes_read&nbsp;&nbs=
p;is 4.</div><div>so -7 will not return to the user level.</div>
<div>After that any call to the function&nbsp;send_existing() will print an=
 error message -7 .</div><div><br></div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #=
ccc solid;padding-left:1ex">
<div class=3D"im">
i haven&#39;t send anything, it is a internal mistake?<br>
</div></blockquote>
<br>
I don&#39;t understand. Are you saying this was the first call to _libssh2_=
transport_send() ? What do you mean with you haven&#39;t send anything?</bl=
ockquote><div>&nbsp;I was to download a file, i only invoked the function l=
ibssh2_sftp_read(), so i have not send anything in the user level. but the =
error is from&nbsp;send_existing() , so i say it&#39;s a&nbsp;internal bug.=
&nbsp;No offense.</div>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex;">&nbsp;</blockquote><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex;"><font color=3D"#888888">
-- <br></font></blockquote><div>thanks.&nbsp;</div><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex;"><font color=3D"#888888">
<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>

--0016364c7b0978835a04a5dec2b9--

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

--===============1988725173==--

From libssh2-devel-bounces@cool.haxx.se  Sun Jun 19 01:47:20 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5INklhg026261;
	Sun, 19 Jun 2011 01:47:12 +0200
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5INkkxL026256
	for <libssh2-devel@cool.haxx.se>; Sun, 19 Jun 2011 01:46:46 +0200
Received: (qmail 31931 invoked from network); 18 Jun 2011 23:46:45 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 18 Jun 2011 23:46:45 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Sat, 18 Jun 2011 23:46:45 -0000
X-URL: http://trac.libssh2.org/
Subject: [libssh2] #220: agent_list_identities pointer to out of scope variable
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/220
Message-ID: <058.b4c94a0a374b455b920eb6241b081146@libssh2.stuge.se>
X-Trac-Ticket-ID: 220
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Sun, 19 Jun 2011 01:47:20 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Sun, 19 Jun 2011 01:46:46 +0200 (CEST)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p5INkkxL026256
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

#220: agent_list_identities pointer to out of scope variable
-------------------------------------+--------------------------------------
  Reporter:  madwizard.myopenid.com  |       Owner:       
      Type:  defect                  |      Status:  new  
  Priority:  normal                  |   Milestone:  1.2.9
 Component:  API                     |     Version:  1.2.8
  Keywords:                          |      Blocks:       
Blocked By:                          |  
-------------------------------------+--------------------------------------
 In the windows version compiled with visual studio (I used 64-bit but
 32-bit probably has the same problem) libssh2_agent_list_identitites may
 fail with LIBSSH2_ERROR_BAD_USE / "illegal agent request" even when used
 properly. I have tracked down the problem to agent_list_identities in
 agent.c where transctx->request is set as a pointer to a local uchar
 variable 'c' containing SSH2_AGENTC_REQUEST_IDENTITIES. The scope of this
 variable is the if-statement but the pointer will be used after the if
 statement and may be overwritten with other data placed on the stack. The
 problem was fixed by placing the local variable at the top of the function
 rather than in the if statement.

-- 
Ticket URL: <http://trac.libssh2.org/ticket/220>
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 Jun 19 23:37:47 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5JLbPn3011269;
	Sun, 19 Jun 2011 23:37:44 +0200
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5JLbOUl011253
	for <libssh2-devel@cool.haxx.se>; Sun, 19 Jun 2011 23:37:24 +0200
Date: Sun, 19 Jun 2011 23:37:24 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: proper buffer size for libssh2_sftp_read()
In-Reply-To: <BANLkTikJyWvQVqM23YgSdfwbCggh1hmKWw@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1106192306290.14974@tvnag.unkk.fr>
References: <BANLkTin4B1O6TN9KO76=dDntYQpMHoCzsg@mail.gmail.com>
	<alpine.DEB.2.00.1106150912360.21319@tvnag.unkk.fr>
	<BANLkTiksN7Br93dvgcyPCtzsUTMEC7btsw@mail.gmail.com>
	<alpine.DEB.2.00.1106151339140.17838@tvnag.unkk.fr>
	<BANLkTim2ZSGqyMDN_Y3e=wbRSAwXtsox0g@mail.gmail.com>
	<alpine.DEB.2.00.1106162354440.27179@tvnag.unkk.fr>
	<BANLkTikJyWvQVqM23YgSdfwbCggh1hmKWw@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Sun, 19 Jun 2011 23:37:46 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Sun, 19 Jun 2011 23:37:24 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Fri, 17 Jun 2011, zl liu wrote:

> I mean before the first -7 error message is print, the function call stack 
> is:
>
> libssh2.dll!send_existing
> libssh2.dll!_libssh2_transport_send
> libssh2.dll!_libssh2_channel_receive_window_adjust
> libssh2.dll!_libssh2_channel_read

> As you see data != p->odata, so the function send_existing() will
> return LIBSSH2_ERROR_BAD_USE

Okay, so the real question is then how send_existing() ends up detecting that 
it gets called with another buffer than before, as it isn't supposed to.

It would indicate a bug in a parent function but I couldn't detect one now and 
also this seems to work most of the time so it probably has to be some special 
condition to trigger it.

Unfortunately I can't repeat this problem in my end so I have a hard time 
helping out with the debugging.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Mon Jun 20 00:07:45 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5JM7cnl003530;
	Mon, 20 Jun 2011 00:07:45 +0200
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5JM7bFS003522
	for <libssh2-devel@cool.haxx.se>; Mon, 20 Jun 2011 00:07:37 +0200
Received: (qmail 14604 invoked from network); 19 Jun 2011 22:07:39 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 19 Jun 2011 22:07: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: Sun, 19 Jun 2011 22:07:39 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #219: libssh2_channel_forward_listen_ex freezes the
	program!
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/219#comment:5
Message-ID: <059.fc48fe481d6c69670906fc288d71cf26@libssh2.stuge.se>
References: <044.d06f6ca1fdc86dce6e752ef3a98d50dd@libssh2.stuge.se>
X-Trac-Ticket-ID: 219
In-Reply-To: <044.d06f6ca1fdc86dce6e752ef3a98d50dd@libssh2.stuge.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Mon, 20 Jun 2011 00:07:45 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Mon, 20 Jun 2011 00:07:37 +0200 (CEST)
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p5JM7bFS003522
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

#219: libssh2_channel_forward_listen_ex freezes the program!
-----------------------+----------------------------------------------------
  Reporter:  fingster  |        Owner:  bagder      
      Type:  defect    |       Status:  closed      
  Priority:  high      |    Milestone:  1.2.9       
 Component:  API       |      Version:  1.2.8       
Resolution:  invalid   |     Keywords:  port forward
    Blocks:            |   Blocked By:              
-----------------------+----------------------------------------------------

Comment (by fingster):

 When I put
 {{{
 libssh2_session_set_blocking(session, 0);
 }}}
 before the cited example code, channel gets nothing but NULL. And printf
 shows that "Remote forwding port: 0".
 If I put
 {{{
 libssh2_session_set_blocking(session, 0);
 }}}
 after the cited example code, the program freezes at
 libssh2_channel_forward_listen_ex and never returns. Nothing outputs.

 how to use libssh2_channel_forward_listen_ex? Any example?
 Thank you!

-- 
Ticket URL: <http://trac.libssh2.org/ticket/219#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  Tue Jun 28 09:00:58 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5S70PTv007192;
	Tue, 28 Jun 2011 09:00:52 +0200
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5S70MLZ007044
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 28 Jun 2011 09:00:23 +0200
Received: by qwc9 with SMTP id 9so3337551qwc.41
	for <libssh2-devel@cool.haxx.se>; Tue, 28 Jun 2011 00:00:17 -0700 (PDT)
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=pTpRqzDaNrZVDeKurzNx3xXkC5sT2B8GD7gaJURYWPI=;
	b=kADsHInrXkA+/Kr9GGYfNWGcOBr5QzH47qfSpyXBLFn8w3ExbjtpDMmwjP143vtYlq
	9B7fpzwMptUL53MnQ28tE8w1WrPun7b/7F381QNqTBwMCRXBq7E+Utuz97SYWDBOWMPA
	pTpLPxCSBjxXQ3UsZKiUgvuxDHdigSIPVFTEg=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=KojmaNsgHRj68ZxV9nt1XOAjQ1wH8rSVY/eM/8quMFSLV8PdefRWQ2QaHa6fVR5CU2
	a7H1uVXa/BKDExghzT3DJY4d1UfomF8F7Cvkh/jMdJ9EIiLnUJcqqITgFEfC7UDOniOy
	Q4y4iRkUG/z+Tu24yUDkBo9aLffo5q5ALMTI4=
MIME-Version: 1.0
Received: by 10.229.88.144 with SMTP id a16mr2452598qcm.45.1309244417744; Tue,
	28 Jun 2011 00:00:17 -0700 (PDT)
Received: by 10.229.234.9 with HTTP; Tue, 28 Jun 2011 00:00:17 -0700 (PDT)
Date: Tue, 28 Jun 2011 09:00:17 +0200
Message-ID: <BANLkTik=TKoGYSQHid0VG438rNfAONyxJg@mail.gmail.com>
Subject: SIGSEGV if using patch "keyb-interactive: allow zero length fields"
From: Alfred Gebert <alfred.gebert@gmail.com>
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 28 Jun 2011 09:00:58 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 28 Jun 2011 09:00:24 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

I'm using libssh2 from git. My test uses curl and if I try to
establish a sftp session the program dies with "Segmentaion fault".

curl --insecure -u agebert:password --verbose sftp://gebert4.e2e.ch/
* About to connect() to gebert4.e2e.ch port 22 (#0)
*   Trying 127.0.0.2... connected
* Connected to gebert4.e2e.ch (127.0.0.2) port 22 (#0)
* SSH authentication methods available:
publickey,gssapi-with-mic,keyboard-interactive
* Using ssh public key file /home/agebert/.ssh/id_dsa.pub
* Using ssh private key file /home/agebert/.ssh/id_dsa
* SSH public key authentication failed: Unable to open public key file
Segmentation fault

Program received signal SIGSEGV, Segmentation fault.
0xb7cd8fa1 in free () from /lib/libc.so.6
(gdb) where
#0  0xb7cd8fa1 in free () from /lib/libc.so.6
#1  0xb7e83670 in my_libssh2_free () from /home/agebert/local/lib/libcurl.so.4
#2  0xb7b136d8 in userauth_keyboard_interactive (session=0x8084a40,
username=0x8084810 "agebert", username_len=7,
    response_callback=0xb7e83840 <kbd_callback>) at userauth.c:1616
#3  0xb7b1390b in libssh2_userauth_keyboard_interactive_ex
(session=0x8084a40, user=0x8084810 "agebert", user_len=7,
    response_callback=0xb7e83840 <kbd_callback>) at userauth.c:1672
#4  0xb7e851d6 in ssh_statemach_act () from /home/agebert/local/lib/libcurl.so.4
#5  0xb7e87a32 in ssh_easy_statemach () from
/home/agebert/local/lib/libcurl.so.4
#6  0xffffffff in ?? ()

I tried to isolate which commit introduced the regression.

This is fine:
0723dab4d76c16208132367922ca2151cb458073
libssh2_channel_process_startup.3: clean up

This does crash:
5b004a4b67e3c6e8de97d5bbbab470b1191b1a16 keyb-interactive: add the fixed buffer

The other commits between these commits do not compile.

For me the fix "keyb-interactive: allow zero length fields" is
important because on AIX malloc(0) returns an error.

If you need more details let me know.

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

From libssh2-devel-bounces@cool.haxx.se  Tue Jun 28 09:35:16 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5S7Z88J028890;
	Tue, 28 Jun 2011 09:35:15 +0200
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5S7Z5jD028355
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 28 Jun 2011 09:35:06 +0200
Received: by qwc9 with SMTP id 9so3347624qwc.41
	for <libssh2-devel@cool.haxx.se>; Tue, 28 Jun 2011 00:35:00 -0700 (PDT)
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=BsNQKrGgsj34JiwIhlmzU0ostdFON9L8RSUDlAd9w1o=;
	b=mqMFn+iL8ouetJT2rnhuyWvPwruTU4274YIqLh9yv68AnMbzpUp02eOOrlZIF8TTDk
	os3TqTaR8c/eInzlMX1c0eue616+jvc7WjLF5dvw76mClGfR3o0ppL5PFkpDRd6wqBiC
	8CNSqHQhCQfpIdPcwssU3LArhrDDPnWCvIBos=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=nMSl1q8euU3Ubef7dAzuUmK5WhzEh4evIatkKPENwnhn7UGieQ6DUIaYuvwVafTleT
	Q7Vydstdz//9sLKEYaWV6+EpCEBe+nAZRu7CHvUe1lA3qiVby5mi3Bmolva43wGtYSad
	7PqfAVrm9VXscjF9IcB5V83PhWQzc1Z9f760Q=
MIME-Version: 1.0
Received: by 10.224.186.5 with SMTP id cq5mr5112403qab.373.1309246500584; Tue,
	28 Jun 2011 00:35:00 -0700 (PDT)
Received: by 10.229.234.9 with HTTP; Tue, 28 Jun 2011 00:35:00 -0700 (PDT)
Date: Tue, 28 Jun 2011 09:35:00 +0200
Message-ID: <BANLkTikwBRRpr+9yTDBvcJkX573UZThiUA@mail.gmail.com>
Subject: [PATCH] _libssh2_recv(): handle ENOENT error as EAGAIN
From: Alfred Gebert <alfred.gebert@gmail.com>
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 28 Jun 2011 09:35:16 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 28 Jun 2011 09:35:06 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

A sftp session failed with error "failure establishing ssh session"
on Solaris and HP-UX. Sometimes the first recv() function call
sets errno to ENOENT. In the man pages for recv of Solaris and
HP-UX the error ENOENT is not documented.

I tested Solaris SPARC and x86, HP-UX i64, AIX, Windows and Linux.
---
 src/misc.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/misc.c b/src/misc.c
index 489605c..fefb497 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -108,8 +108,12 @@ _libssh2_recv(libssh2_socket_t sock, void
*buffer, size_t length, int flags)
             return -errno;
     }
 #else
-    if (rc < 0 )
-        return -errno;
+    if (rc < 0 ){
+        if ( errno == ENOENT )
+            return -EAGAIN;
+        else
+            return -errno;
+    }
 #endif
     return rc;
 }
-- 
1.7.3.4
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Jun 28 22:40:50 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5SKeLGF004527;
	Tue, 28 Jun 2011 22:40:47 +0200
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5SKeJor004519
	for <libssh2-devel@cool.haxx.se>; Tue, 28 Jun 2011 22:40:19 +0200
Date: Tue, 28 Jun 2011 22:40:19 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: SIGSEGV if using patch "keyb-interactive: allow zero length
	fields"
In-Reply-To: <BANLkTik=TKoGYSQHid0VG438rNfAONyxJg@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1106282239010.19858@tvnag.unkk.fr>
References: <BANLkTik=TKoGYSQHid0VG438rNfAONyxJg@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 28 Jun 2011 22:40:50 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 28 Jun 2011 22:40:20 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Tue, 28 Jun 2011, Alfred Gebert wrote:

> I'm using libssh2 from git. My test uses curl and if I try to establish a 
> sftp session the program dies with "Segmentaion fault".

Thanks for this report!

> #2  0xb7b136d8 in userauth_keyboard_interactive (session=0x8084a40,
> username=0x8084810 "agebert", username_len=7,
>    response_callback=0xb7e83840 <kbd_callback>) at userauth.c:1616

At this point (userauth.c:1616), is session->userauth_kybd_data NULL or what 
does it point to?

If it isn't NULL, I'm curious to figure out what it points to...

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Tue Jun 28 22:44:36 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5SKiZCE005550;
	Tue, 28 Jun 2011 22:44:36 +0200
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5SKiY6n005545
	for <libssh2-devel@cool.haxx.se>; Tue, 28 Jun 2011 22:44:34 +0200
Date: Tue, 28 Jun 2011 22:44:34 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: [PATCH] _libssh2_recv(): handle ENOENT error as EAGAIN
In-Reply-To: <BANLkTikwBRRpr+9yTDBvcJkX573UZThiUA@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1106282244190.19858@tvnag.unkk.fr>
References: <BANLkTikwBRRpr+9yTDBvcJkX573UZThiUA@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Tue, 28 Jun 2011 22:44:36 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Tue, 28 Jun 2011 22:44:34 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Tue, 28 Jun 2011, Alfred Gebert wrote:

> A sftp session failed with error "failure establishing ssh session" on 
> Solaris and HP-UX. Sometimes the first recv() function call sets errno to 
> ENOENT. In the man pages for recv of Solaris and HP-UX the error ENOENT is 
> not documented.
>
> I tested Solaris SPARC and x86, HP-UX i64, AIX, Windows and Linux.

Thanks, applied!

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Wed Jun 29 08:42:42 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5T6gKBl008198;
	Wed, 29 Jun 2011 08:42:38 +0200
Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com
	[209.85.216.175])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5T6gHgx008126
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 29 Jun 2011 08:42:18 +0200
Received: by qyk30 with SMTP id 30so2396454qyk.20
	for <libssh2-devel@cool.haxx.se>; Tue, 28 Jun 2011 23:42:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type:content-transfer-encoding;
	bh=3RzgEUS5fkDwhOwqV8vwfz/qsK9zLb0rLZd09HuqC8Q=;
	b=YloeNf2ObhZBxzmD3jNEnnK1IbC8p+BUPnLQEiX/rqtC1QJYAvpfVT3SYscWrcmFH4
	0uV8c2dDk46mrfyGEPSM3bu2A1ugRWgHY9KVJnCIjisw4SXYuKUZVE2cpRC0Xloqv+xZ
	od6m037QJpt/KH4eDy3ZURbIzzMcjG2o5PVoc=
MIME-Version: 1.0
Received: by 10.229.7.141 with SMTP id d13mr311744qcd.21.1309329733251; Tue,
	28 Jun 2011 23:42:13 -0700 (PDT)
Received: by 10.229.241.9 with HTTP; Tue, 28 Jun 2011 23:42:13 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1106282239010.19858@tvnag.unkk.fr>
References: <BANLkTik=TKoGYSQHid0VG438rNfAONyxJg@mail.gmail.com>
	<alpine.DEB.2.00.1106282239010.19858@tvnag.unkk.fr>
Date: Wed, 29 Jun 2011 08:42:13 +0200
Message-ID: <BANLkTimsEANviKf_k43QqiZ2pfeZ6jfKBQ@mail.gmail.com>
Subject: Re: SIGSEGV if using patch "keyb-interactive: allow zero length
	fields"
From: Alfred Gebert <alfred.gebert@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 29 Jun 2011 08:42:42 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 29 Jun 2011 08:42:18 +0200 (CEST)
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id
	p5T6gHgx008126
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p5T6gKBl008198

On Tue, Jun 28, 2011 at 10:40 PM, Daniel Stenberg <daniel@haxx.se> wrote:
> On Tue, 28 Jun 2011, Alfred Gebert wrote:
>
>> I'm using libssh2 from git. My test uses curl and if I try to establish a
>> sftp session the program dies with "Segmentaion fault".
>
> Thanks for this report!
>
>> #2  0xb7b136d8 in userauth_keyboard_interactive (session=0x8084a40,
>> username=0x8084810 "agebert", username_len=7,
>>   response_callback=0xb7e83840 <kbd_callback>) at userauth.c:1616
>
> At this point (userauth.c:1616), is session->userauth_kybd_data NULL or what
> does it point to?

session->userauth_kybd_data is _not_ NULL.

>
> If it isn't NULL, I'm curious to figure out what it points to...
>

Can you reproduce the bug?

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

From libssh2-devel-bounces@cool.haxx.se  Wed Jun 29 11:50:20 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5T9nt5O025593;
	Wed, 29 Jun 2011 11:50:14 +0200
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5T9nr5i025578
	for <libssh2-devel@cool.haxx.se>; Wed, 29 Jun 2011 11:49:53 +0200
Date: Wed, 29 Jun 2011 11:49:53 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: SIGSEGV if using patch "keyb-interactive: allow zero length
	fields"
In-Reply-To: <BANLkTimsEANviKf_k43QqiZ2pfeZ6jfKBQ@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1106291148110.19858@tvnag.unkk.fr>
References: <BANLkTik=TKoGYSQHid0VG438rNfAONyxJg@mail.gmail.com>
	<alpine.DEB.2.00.1106282239010.19858@tvnag.unkk.fr>
	<BANLkTimsEANviKf_k43QqiZ2pfeZ6jfKBQ@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-1063505007-1309340993=:19858"
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 29 Jun 2011 11:50:20 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 29 Jun 2011 11:49:53 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

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

--1129329158-1063505007-1309340993=:19858
Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8BIT

On Wed, 29 Jun 2011, Alfred Gebert wrote:

>>> #2  0xb7b136d8 in userauth_keyboard_interactive (session=0x8084a40,
>>> username=0x8084810 "agebert", username_len=7,
>>>   response_callback=0xb7e83840 <kbd_callback>) at userauth.c:1616
>>
>> At this point (userauth.c:1616), is session->userauth_kybd_data NULL or what
>> does it point to?
>
> session->userauth_kybd_data is _not_ NULL.

Oh. Can you see from where it jumps to the cleanup label?

> Can you reproduce the bug?

I haven't even tried yet, I don't think I have any live keyboard-interactive 
enabled servers around and I haven't setup a test server for it. I thought we 
could start out with your tests and possibly figure it out based on this 
alone.

-- 

  / daniel.haxx.se
--1129329158-1063505007-1309340993=:19858
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-1063505007-1309340993=:19858--

From libssh2-devel-bounces@cool.haxx.se  Wed Jun 29 13:39:42 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5TBdQxv023057;
	Wed, 29 Jun 2011 13:39:39 +0200
Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com
	[209.85.216.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5TBdOLv023043
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 29 Jun 2011 13:39:25 +0200
Received: by qyk38 with SMTP id 38so677019qyk.20
	for <libssh2-devel@cool.haxx.se>; Wed, 29 Jun 2011 04:39:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type:content-transfer-encoding;
	bh=LOotiwWUSRG/gzk059HWucrJx+kZppTwcMW3zZsx7QE=;
	b=ZALPzkz7aMxLNeahBfxao3xAZqJ9ik5EYZneuljoIh9P9l9uJrUswyFpvNQ3VK9X0A
	3cHMzxadhOtz6gmf5VWoxvn/lcs/DQ78hCEjT/lFHn8m02QP6PU80mbAaGfQGunW1ZxT
	nfmYIez56a/vvqeptetBzeQVA3enukTO657So=
MIME-Version: 1.0
Received: by 10.229.137.149 with SMTP id w21mr497868qct.59.1309347560654; Wed,
	29 Jun 2011 04:39:20 -0700 (PDT)
Received: by 10.229.241.9 with HTTP; Wed, 29 Jun 2011 04:39:20 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1106291148110.19858@tvnag.unkk.fr>
References: <BANLkTik=TKoGYSQHid0VG438rNfAONyxJg@mail.gmail.com>
	<alpine.DEB.2.00.1106282239010.19858@tvnag.unkk.fr>
	<BANLkTimsEANviKf_k43QqiZ2pfeZ6jfKBQ@mail.gmail.com>
	<alpine.DEB.2.00.1106291148110.19858@tvnag.unkk.fr>
Date: Wed, 29 Jun 2011 13:39:20 +0200
Message-ID: <BANLkTi=tZ_xN4tcrz4-=acDcL+_nAAN8jw@mail.gmail.com>
Subject: Re: SIGSEGV if using patch "keyb-interactive: allow zero length
	fields"
From: Alfred Gebert <alfred.gebert@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 29 Jun 2011 13:39:41 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 29 Jun 2011 13:39:25 +0200 (CEST)
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id
	p5TBdOLv023043
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p5TBdQxv023057

On Wed, Jun 29, 2011 at 11:49 AM, Daniel Stenberg <daniel@haxx.se> wrote:
> On Wed, 29 Jun 2011, Alfred Gebert wrote:
>
>>>> #2  0xb7b136d8 in userauth_keyboard_interactive (session=0x8084a40,
>>>> username=0x8084810 "agebert", username_len=7,
>>>>   response_callback=0xb7e83840 <kbd_callback>) at userauth.c:1616
>>>
>>> At this point (userauth.c:1616), is session->userauth_kybd_data NULL or
>>> what
>>> does it point to?
>>
>> session->userauth_kybd_data is _not_ NULL.
>
> Oh. Can you see from where it jumps to the cleanup label?
>

session->userauth_kybd_data is set to NULL on line userauth.c:1575.

And then modified here

(gdb) cont
Continuing.
Hardware watchpoint 4: session->userauth_kybd_data

Old value = (unsigned char *) 0x0
New value = (unsigned char *) 0x3 <Address 0x3 out of bounds>
_libssh2_htonu32 (buf=0x8091855 "", value=3) at misc.c:176
176     }
(gdb) where
#0  _libssh2_htonu32 (buf=0x8091855 "", value=3) at misc.c:176
#1  0xb7b0102a in _libssh2_store_u32 (buf=0xbfffdaf0, value=3) at misc.c:182
#2  0xb7b01061 in _libssh2_store_str (buf=0xbfffdaf0, str=0x80966c0
"e2e", len=3) at misc.c:190
#3  0xb7b13600 in userauth_keyboard_interactive (session=0x8084a78,
username=0x8083ef0 "agebert", username_len=7,
    response_callback=0xb7e83840 <kbd_callback>) at userauth.c:1585
#4  0xb7b1390b in libssh2_userauth_keyboard_interactive_ex
(session=0x8084a78, user=0x8083ef0 "agebert", user_len=7,
    response_callback=0xb7e83840 <kbd_callback>) at userauth.c:1672
#5  0xb7e851d6 in ssh_statemach_act () from /home/agebert/local/lib/libcurl.so.4
#6  0xb7e87a32 in ssh_easy_statemach () from
/home/agebert/local/lib/libcurl.so.4
#7  0xbfffec28 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)

The five byte from session->userauth_buf are too small and
session->userauth_kybd_data is the next member after userauth_buf.

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

From libssh2-devel-bounces@cool.haxx.se  Wed Jun 29 21:34:33 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5TJYDwg009338;
	Wed, 29 Jun 2011 21:34:30 +0200
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5TJYCdT009332
	for <libssh2-devel@cool.haxx.se>; Wed, 29 Jun 2011 21:34:12 +0200
Date: Wed, 29 Jun 2011 21:34:12 +0200 (CEST)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: SIGSEGV if using patch "keyb-interactive: allow zero length
	fields"
In-Reply-To: <BANLkTi=tZ_xN4tcrz4-=acDcL+_nAAN8jw@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1106292133050.14020@tvnag.unkk.fr>
References: <BANLkTik=TKoGYSQHid0VG438rNfAONyxJg@mail.gmail.com>
	<alpine.DEB.2.00.1106282239010.19858@tvnag.unkk.fr>
	<BANLkTimsEANviKf_k43QqiZ2pfeZ6jfKBQ@mail.gmail.com>
	<alpine.DEB.2.00.1106291148110.19858@tvnag.unkk.fr>
	<BANLkTi=tZ_xN4tcrz4-=acDcL+_nAAN8jw@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Wed, 29 Jun 2011 21:34:33 +0200 (CEST)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Wed, 29 Jun 2011 21:34:12 +0200 (CEST)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Wed, 29 Jun 2011, Alfred Gebert wrote:

> session->userauth_kybd_data is set to NULL on line userauth.c:1575.

...

> The five byte from session->userauth_buf are too small and 
> session->userauth_kybd_data is the next member after userauth_buf.

Thanks. Clearly I was very stupid when I changed that, and I've now reverted 
the bad stuff and put back the previous logic that should work better. Please 
pull the new code and see if it works better for you!

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Thu Jun 30 10:45:13 2011
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5U8irin032764;
	Thu, 30 Jun 2011 10:45:09 +0200
Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com
	[209.85.216.182])
	by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p5U8ip7t032631
	(version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 30 Jun 2011 10:44:52 +0200
Received: by qyk38 with SMTP id 38so1216444qyk.20
	for <libssh2-devel@cool.haxx.se>; Thu, 30 Jun 2011 01:44:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=rmR6XZbbmlmP4dRbxCAgpwxwLVxXK6xOzpAxDnQPFsY=;
	b=PGDq9QaHt9MdBQmiEq+r1jGX1jCyRHWb8trw9vEzSQIeVESbk1RvJW2AfVzCMgu3sT
	67yPr3PXuDBhLf2PZ8V68twmJ5KR4gttyafpEKyxmU4/bdzia/6ZStY8h90dvj241HsS
	FADVNj6siTaw1s96VgDv6tZ6SyAWabXJU6KfA=
MIME-Version: 1.0
Received: by 10.229.40.139 with SMTP id k11mr1321392qce.135.1309419867312;
	Thu, 30 Jun 2011 00:44:27 -0700 (PDT)
Received: by 10.229.241.9 with HTTP; Thu, 30 Jun 2011 00:44:27 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.00.1106292133050.14020@tvnag.unkk.fr>
References: <BANLkTik=TKoGYSQHid0VG438rNfAONyxJg@mail.gmail.com>
	<alpine.DEB.2.00.1106282239010.19858@tvnag.unkk.fr>
	<BANLkTimsEANviKf_k43QqiZ2pfeZ6jfKBQ@mail.gmail.com>
	<alpine.DEB.2.00.1106291148110.19858@tvnag.unkk.fr>
	<BANLkTi=tZ_xN4tcrz4-=acDcL+_nAAN8jw@mail.gmail.com>
	<alpine.DEB.2.00.1106292133050.14020@tvnag.unkk.fr>
Date: Thu, 30 Jun 2011 09:44:27 +0200
Message-ID: <BANLkTinZdOMrD3j7_d8XmeHu4dapfGMGxw@mail.gmail.com>
Subject: Re: SIGSEGV if using patch "keyb-interactive: allow zero length
	fields"
From: Alfred Gebert <alfred.gebert@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (giant.haxx.se [127.0.0.1]); Thu, 30 Jun 2011 10:45:12 +0200 (CEST)
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8
	(giant.haxx.se [80.67.6.50]);
	Thu, 30 Jun 2011 10:44:52 +0200 (CEST)
Cc: Marcel Rassinger <mrassinger@e2e.ch>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: libssh2-devel-bounces@cool.haxx.se

On Wed, Jun 29, 2011 at 9:34 PM, Daniel Stenberg <daniel@haxx.se> wrote:
> On Wed, 29 Jun 2011, Alfred Gebert wrote:
>
>> session->userauth_kybd_data is set to NULL on line userauth.c:1575.
>
> ...
>
>> The five byte from session->userauth_buf are too small and
>> session->userauth_kybd_data is the next member after userauth_buf.
>
> Thanks. Clearly I was very stupid when I changed that, and I've now reverted
> the bad stuff and put back the previous logic that should work better.
> Please pull the new code and see if it works better for you!
>

It works for me. Thank you.

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

