From libssh2-devel-bounces@cool.haxx.se  Wed Dec  1 02:28:35 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB11S9Yw026448;
	Wed, 1 Dec 2010 02:28:30 +0100
Received: from qswall.lpma.nsw.gov.au (qswall.lpma.nsw.gov.au [203.14.35.57])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB11S4Hn026413
	for <libssh2-devel@cool.haxx.se>; Wed, 1 Dec 2010 02:28:07 +0100
Received: from SRV-QS-MAIL6.lands.nsw (srv-qs-mail6.lands.nsw [10.4.100.151]) 
	by qswall.lpma.nsw.gov.au (8.14.1/8.14.1) with ESMTP id 
	oB11RnND019122 for <libssh2-devel@cool.haxx.se>; Wed, 1 Dec 2010 
	12:27:49 +1100
Received: from SRV-QS-MAIL6.lands.nsw ([fe80::d546:5904:a1f4:4f5d]) by 
	SRV-QS-MAIL6.lands.nsw ([fe80::d546:5904:a1f4:4f5d%12]) with mapi; 
	Wed, 1 Dec 2010 12:27:47 +1100
From: Phillip Wu <Phillip.Wu@lpma.nsw.gov.au>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Wed, 1 Dec 2010 12:27:46 +1100
Subject: Windows and libssh2 not working
Thread-Topic: Windows and libssh2 not working
Thread-Index: AcuHbgqWtfDqj8qsQzyDtFbrIcyNRAAAdcggAAXLRkA=
Message-ID: <137CA4FE5CCDB7449ED3CD4445077AC3050AD1DCD3@SRV-QS-MAIL6.lands.nsw>
References: <137CA4FE5CCDB7449ED3CD4445077AC3050AD1DA2E@SRV-QS-MAIL6.lands.nsw>
	<003b01cb8770$ca6dc6f0$5f4954d0$@com>
In-Reply-To: <003b01cb8770$ca6dc6f0$5f4954d0$@com>
Accept-Language: en-US, en-AU
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US, en-AU
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 01 Dec 2010 02:28:35 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 01 Dec 2010 02:28:08 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Thanks for the info.

I am new to Visual Studio C++ development.
But from what I read dynamic linking means calls to the dll is resolved at run time and
implicit/static linking is resolved at compile time. Does this mean if I use implicit linking and
the location of the dll changes then I need to recompile my client program?

I tried implicit linking:
1. I downloaded the libssh2.dll (version 1.2.7), libgcrypt.dll, libgpg-error.dll
2. I created *.obj for libssh2 using MSDN document "How To Create 32-bit Import Libraries Without .OBJs or Source"
   This is a dummy *.obj file used to tell the linker about the calls in the dll.
3. I wrote a very simple client program based on MSDN socket program:
   sock=ssh_connection(host)); /* Creates socket to host */
   session = libssh2_session_init();
   if (status=libssh2_session_startup(session, sock)) exit(0);
   userauthlist = libssh2_userauth_list(session, username, strlen(username));

However userauthlist is empty. If I run the same program (replacing the socket creation part) on my Redhat Linux system
with the same user it works fine. This is the trace from openssh:
Server listening on 0.0.0.0 port 2022.
socket: Address family not supported by protocol
debug3: fd 4 is not O_NONBLOCK
debug1: Server will not fork when running in debugging mode.
debug3: send_rexec_state: entering fd = 7 config len 350
debug3: ssh_msg_send: type 0
debug3: send_rexec_state: done
debug1: rexec start in 4 out 4 newsock 4 pipe -1 sock 7
debug3: recv_rexec_state: entering fd = 5
debug3: ssh_msg_recv entering
debug3: recv_rexec_state: done
debug2: parse_server_config: config rexec len 350
debug3: rexec:13 setting Port 22
debug3: rexec:19 setting Protocol 2
debug3: rexec:33 setting SyslogFacility AUTH
debug3: rexec:34 setting LogLevel INFO
debug3: rexec:59 setting PasswordAuthentication yes
debug3: rexec:63 setting ChallengeResponseAuthentication yes
debug3: rexec:90 setting X11Forwarding yes
debug3: rexec:112 setting Subsystem sftp        /home/myuser/openssh/libexec/sftp-server
debug3: rexec:113 setting Subsystem sua /home/myuser/openssh/libexec/sftp-server
debug1: sshd version OpenSSH_5.5p1
debug3: Not a RSA1 key file /home/myuser/openssh/ssh/ssh_host_rsa_key.
debug1: read PEM private key done: type RSA
debug1: private host key: #0 type 1 RSA
debug3: Not a RSA1 key file /home/myuser/openssh/ssh/ssh_host_dsa_key.
debug1: read PEM private key done: type DSA
debug1: private host key: #1 type 2 DSA
debug1: setgroups() failed: Operation not permitted
debug1: inetd sockets after dupping: 3, 3
Connection from 10.1.8.1 port 5408
Did not receive identification string from 10.1.8.1

Questions
=========
1. Can someone spot what is wrong?
2. libssh2.dll calls routines in libgcrypt.dll which in turn calls routines in libgpg-error.dll.
 Do I need to do anything special with *.obj for libssh2 to tell Windows about this?

-----Original Message-----
From: libssh2-devel-bounces@cool.haxx.se [mailto:libssh2-devel-bounces@cool.haxx.se] On Behalf Of Mark Riordan
Sent: Friday, 19 November 2010 9:35 AM
To: 'libssh2 development'
Subject: RE: Windows and libssh2

Phillip wrote:
> 1. Has anyone used (dynamic linking) for libssh2? 
> If so, is there somewhere I can get the code stubs for
> all the libssh2 functions (perhaps as a "define")?

I haven't done it, but it should be reasonably straightforward.
I'm assuming you have a specific reason for dynamically linking...

> 2. When I try to compile ssh2 example it is unable to find:
> closesocket (etc.)
> Does anyone know which dll on Windows have these system calls?

WSock32.dll

> 3. Would I be better off using MinGW or some other 
> build package for Windows?

I've used VC 2008 with libssh2 and it worked well.
I've found VC 2010 to be pretty similar, so it should work equally well.
MinGW would probably only complicate things.
You can take a look at the VC 2008 .vcproj file for my libssh2 sample at:
http://trac.libssh2.org/attachment/ticket/197/sftpmrr.zip

Mark


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

***************************************************************
This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of the Land and Property Management Authority. This email message has been swept by MIMEsweeper for the presence of computer viruses.
***************************************************************
Please consider the environment before printing this email.
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Wed Dec  1 16:14:53 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB1FEWHQ006252;
	Wed, 1 Dec 2010 16:14:50 +0100
Received: from imail.ipswitch.com (imail.ipswitch.com [156.21.1.5])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB1FEUZc006229
	for <libssh2-devel@cool.haxx.se>; Wed, 1 Dec 2010 16:14:31 +0100
DKIM-Signature: q=dns/txt; v=1; c=relaxed/relaxed; s=ipswitch;
	d=ipswitch.com; a=rsa-sha1;
	h=From:To:References:In-Reply-To:Subject:Date:Message-ID:
	MIME-Version:Content-Type:Content-Transfer-Encoding;
	b=kH2zfgk5nAB7H5mJL8uc62VaGe+frbP2qWtAb4Vn5o94kyetRoLQKhlnj4tZr4wNGF
	IzZNNxmg+joYKRdQ7cgiOBiLTDUlVYiBGRdZ/sw8L4kkk56bUaRSUa51BrvdpHhE47+X
	T6miC76NwxKb7mmxpF57ijxtzzw6/5Qp5uXP0=;
	bh=6/sKX9vEcxh26IKe8RDmX8Rbvk4=; t=1291216461;
Received: from mrrnt [66.170.5.130] by ipswitch.com with ESMTP
	(SMTPD-11.03) id a01e000f98016d62; Wed, 1 Dec 2010 10:14:19 -0500
From: "Mark Riordan" <mriordan@ipswitch.com>
To: "'libssh2 development'" <libssh2-devel@cool.haxx.se>
References: <137CA4FE5CCDB7449ED3CD4445077AC3050AD1DA2E@SRV-QS-MAIL6.lands.nsw>	<003b01cb8770$ca6dc6f0$5f4954d0$@com>
	<137CA4FE5CCDB7449ED3CD4445077AC3050AD1DCD3@SRV-QS-MAIL6.lands.nsw>
In-Reply-To: <137CA4FE5CCDB7449ED3CD4445077AC3050AD1DCD3@SRV-QS-MAIL6.lands.nsw>
Subject: RE: Windows and libssh2 not working
Date: Wed, 1 Dec 2010 09:14:20 -0600
Message-ID: <000d01cb916a$6de53590$49afa0b0$@com>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AcuHbgqWtfDqj8qsQzyDtFbrIcyNRAAAdcggAAXLRkACeKgfEA==
Content-Language: en-us
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 01 Dec 2010 16:14:53 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 01 Dec 2010 16:14:31 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

> I am new to Visual Studio C++ development.
> But from what I read dynamic linking means calls to the dll
> is resolved at run time and
> implicit/static linking is resolved at compile time. 
> Does this mean if I use implicit linking and
> the location of the dll changes then I need to recompile my client
program?

No - Windows will search your path to find the DLL.

> 3. I wrote a very simple client program based on MSDN socket program:
>   sock=ssh_connection(host)); /* Creates socket to host */
>   session = libssh2_session_init();
>   if (status=libssh2_session_startup(session, sock)) exit(0);
>   userauthlist = libssh2_userauth_list(session, username,
strlen(username));
> However userauthlist is empty. 

I'm not sure what is wrong, but it might be easier to diagnose if 
you put a call like this in your program, after libssh2_session_init:

  libssh2_trace(session, ~0);

then report what is printed on stderr.
You may want to redirect it like this:

mytest.exe 2>trace.txt

Mark


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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec  1 18:03:39 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB1H3MRo010153;
	Wed, 1 Dec 2010 18:03:37 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id oB1H3L5Y010108
	for <libssh2-devel@cool.haxx.se>; Wed, 1 Dec 2010 18:03:22 +0100
Received: (qmail 6826 invoked by uid 501); 1 Dec 2010 17:03:18 -0000
Message-ID: <20101201170318.6825.qmail@stuge.se>
Date: Wed, 1 Dec 2010 18:03:18 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: Windows and libssh2 not working
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <137CA4FE5CCDB7449ED3CD4445077AC3050AD1DA2E@SRV-QS-MAIL6.lands.nsw>
	<003b01cb8770$ca6dc6f0$5f4954d0$@com>
	<137CA4FE5CCDB7449ED3CD4445077AC3050AD1DCD3@SRV-QS-MAIL6.lands.nsw>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <137CA4FE5CCDB7449ED3CD4445077AC3050AD1DCD3@SRV-QS-MAIL6.lands.nsw>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 01 Dec 2010 18:03:39 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 01 Dec 2010 18:03:22 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Phillip Wu wrote:
> I am new to Visual Studio C++ development.

Are you experienced with another C or C++ development environment? I
find Visual Studio to be a difficult environment, so if you know
something else then I would suggest starting with that.


> But from what I read dynamic linking means calls to the dll is
> resolved at run time

Yes, which means that the DLL must be available at run time.


> and implicit/static linking is resolved at compile time.

Yes, the linker will include all neccessary parts of the library in
the program that it generates, which means that the DLL is not needed
anymore, once the program has been linked.


> Does this mean if I use implicit linking and the location of the
> dll changes then I need to recompile my client program?

See above.


Further, on Windows I believe you will never need to recompile
because of where a DLL is stored.

You need to recompile your program if you upgrade the DLL to a
version which is not backwards compatible. We make an effort to avoid
breaking backwards compatibility in the library, so that this never
happens. Still, if upgrading from a very old DLL then you may run
into trouble with this, and have no choice but to recompile.

As for location of DLLs, the part of the system that loads executables
(called the loader) has a certain way to search for DLLs that programs
require. This is a property of each system (Windows, Linux, Mac OS)
and is not usually something that the program can/should change.

On UNIX (including Mac OS X) it's possible to specify full paths to
shared objects (platform-specific name for DLLs) but should be used
mostly for dynamically loadable plugins, and the like.




> 3. I wrote a very simple client program based on MSDN socket program:
>    sock=ssh_connection(host)); /* Creates socket to host */
>    session = libssh2_session_init();
>    if (status=libssh2_session_startup(session, sock)) exit(0);
>    userauthlist = libssh2_userauth_list(session, username, strlen(username));
> 
> However userauthlist is empty. If I run the same program (replacing
> the socket creation part) on my Redhat Linux system with the same
> user it works fine. This is the trace from openssh:
..
> Connection from 10.1.8.1 port 5408
> Did not receive identification string from 10.1.8.1

Is this sshd output from when the client runs on Linux and succeeds,
or from when running on Windows and failing to retrieve userauthlist?


> 1. Can someone spot what is wrong?

Not without further information.


> 2. libssh2.dll calls routines in libgcrypt.dll which in turn calls
> routines in libgpg-error.dll.
> Do I need to do anything special with *.obj for libssh2 to tell
> Windows about this?

No, you just need to make sure to link your program with the correct
libraries. If you are using dynamic linking I believe you'll only
need to link with libssh2, since that is all you are making direct
calls to. If you are using static linking you need to link with the
union of all libraries required by all libraries that you require, so
all of libssh2, libgcrypt and libgpg-error, because they will all be
included in the program output from the linker.

It may be good for you to look more into how compiling and linking
works, preferably in the particular context of your development
environment, before you continue with your project.


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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec  1 19:39:51 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB1IdQQS009856;
	Wed, 1 Dec 2010 19:39:46 +0100
Received: from dns-factory.at (mail.dns-factory.at [194.242.35.75])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB1IdOxF009836
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 1 Dec 2010 19:39:24 +0100
Received: from [172.17.100.7] lists@gknw.net [84.63.50.167]
	by dns-factory.at with NetMail SMTP Agent $Revision: 8582 $ on Novell
	NetWare via secured & encrypted transport (TLS);
	Wed, 01 Dec 2010 19:39:11 +0100
Message-ID: <4CF6963A.9090608@gknw.net>
Date: Wed, 01 Dec 2010 19:38:50 +0100
From: Guenter <lists@gknw.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de;
	rv:1.9.2.12) Gecko/20101027 Lightning/1.0b2 Thunderbird/3.1.6
MIME-Version: 1.0
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Windows and libssh2 not working
References: <137CA4FE5CCDB7449ED3CD4445077AC3050AD1DA2E@SRV-QS-MAIL6.lands.nsw>	<003b01cb8770$ca6dc6f0$5f4954d0$@com>
	<137CA4FE5CCDB7449ED3CD4445077AC3050AD1DCD3@SRV-QS-MAIL6.lands.nsw>
In-Reply-To: <137CA4FE5CCDB7449ED3CD4445077AC3050AD1DCD3@SRV-QS-MAIL6.lands.nsw>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 01 Dec 2010 19:39:51 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 01 Dec 2010 19:39:25 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hi Phillip,
Am 01.12.2010 02:27, schrieb Phillip Wu:
> I tried implicit linking:
> 1. I downloaded the libssh2.dll (version 1.2.7), libgcrypt.dll, libgpg-er=
ror.dll
> 2. I created *.obj for libssh2 using MSDN document "How To Create 32-bit =
Import Libraries Without .OBJs or Source"
>     This is a dummy *.obj file used to tell the linker about the calls in=
 the dll.
although this might sometimes work with some luck this is not a =

recomment way to - especially not since the DLL you pointed to is build =

with another compiler (MinGW32). Why dont you build the libssh2 lib/dll =

self from source? Within the time you spent with fiddling with the =

import lib I bet you would have build libssh2 including dependencies =

twice ...
On the other side if you really want to use this downloaded libssh2.dll =

then its really recommended to use the MingW32 compiler (free).

BTW. such problems you face is nothing unknown but very common, and even =

if the libssh2.dll would have been build with MSVC then just a different =

compiler switch is enough to make your program fail. Build self from =

source so you can be sure that you compile both the DLL and your program =

with same compiler switches; if your program then still fails then you =

can at least rule out that is is a compiler issue.

G=FCn.


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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec  1 21:47:14 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB1Kktcd019026;
	Wed, 1 Dec 2010 21:47:13 +0100
Received: from yxa-v.extundo.com (yxa-v.extundo.com [83.241.177.39])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB1Kkr8b019023
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 1 Dec 2010 21:46:53 +0100
Received: from latte.josefsson.org (static-77.91.223.94.gastabud.com
	[77.91.223.94] (may be forged)) (authenticated bits=0)
	by yxa-v.extundo.com (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id
	oB1KkhhP005720
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 1 Dec 2010 21:46:46 +0100
From: Simon Josefsson <simon@josefsson.org>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Windows and libssh2 not working
References: <137CA4FE5CCDB7449ED3CD4445077AC3050AD1DA2E@SRV-QS-MAIL6.lands.nsw>
	<003b01cb8770$ca6dc6f0$5f4954d0$@com>
	<137CA4FE5CCDB7449ED3CD4445077AC3050AD1DCD3@SRV-QS-MAIL6.lands.nsw>
	<4CF6963A.9090608@gknw.net>
OpenPGP: id=B565716F; url=http://josefsson.org/key.txt
X-Hashcash: 1:22:101201:libssh2-devel@cool.haxx.se::8xY93KJy0zolBs1Y:8i6i
Date: Wed, 01 Dec 2010 21:46:39 +0100
In-Reply-To: <4CF6963A.9090608@gknw.net> (Guenter's message of "Wed, 01 Dec
	2010 19:38:50 +0100")
Message-ID: <87wrnt2pcg.fsf@latte.josefsson.org>
User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux)
MIME-Version: 1.0
X-Spam-Flag: YES
X-Spam-Status: Yes, score=11.8 required=5.0 tests=AWL,BAYES_00,
	DATE_IN_FUTURE_96_XX,SPF_FAIL autolearn=no version=3.2.5
X-Spam-Level: ***********
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on yxa-v.extundo.com
X-Virus-Scanned: clamav-milter 0.96.4 at yxa-v
X-Virus-Status: Clean
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 01 Dec 2010 21:47:14 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 01 Dec 2010 21:46:53 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Guenter <lists@gknw.net> writes:

> Hi Phillip,
> Am 01.12.2010 02:27, schrieb Phillip Wu:
>> I tried implicit linking:
>> 1. I downloaded the libssh2.dll (version 1.2.7), libgcrypt.dll, libgpg-error.dll
>> 2. I created *.obj for libssh2 using MSDN document "How To Create 32-bit Import Libraries Without .OBJs or Source"
>>     This is a dummy *.obj file used to tell the linker about the calls in the dll.
> although this might sometimes work with some luck this is not a
> recomment way to - especially not since the DLL you pointed to is
> build with another compiler (MinGW32). Why dont you build the libssh2
> lib/dll self from source? Within the time you spent with fiddling with
> the import lib I bet you would have build libssh2 including
> dependencies twice ...
> On the other side if you really want to use this downloaded
> libssh2.dll then its really recommended to use the MingW32 compiler
> (free).

I would also recommend MinGW32, but I don't think luck is required to
use an import library successfully -- I use similar schemes for a bunch
of project, to support Windows applications written in MSVS.  There have
been problems, but none that couldn't be fixed, and none was directly
caused by the compiler mix (modulo some compiler bugs which have
subsequently been fixed..).

For some other projects, I create a DEF file using -Wl,--output-def,
which makes MSVS integration simpler, we could consider something
similar.

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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec  1 21:56:16 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB1KuB1H023600;
	Wed, 1 Dec 2010 21:56:15 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id oB1KuAcP023592
	for <libssh2-devel@cool.haxx.se>; Wed, 1 Dec 2010 21:56:10 +0100
Received: (qmail 12174 invoked by uid 501); 1 Dec 2010 20:56:06 -0000
Message-ID: <20101201205606.12173.qmail@stuge.se>
Date: Wed, 1 Dec 2010 21:56:06 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: Windows and libssh2 not working
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <137CA4FE5CCDB7449ED3CD4445077AC3050AD1DA2E@SRV-QS-MAIL6.lands.nsw>
	<003b01cb8770$ca6dc6f0$5f4954d0$@com>
	<137CA4FE5CCDB7449ED3CD4445077AC3050AD1DCD3@SRV-QS-MAIL6.lands.nsw>
	<4CF6963A.9090608@gknw.net> <87wrnt2pcg.fsf@latte.josefsson.org>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <87wrnt2pcg.fsf@latte.josefsson.org>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 01 Dec 2010 21:56:15 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 01 Dec 2010 21:56:10 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Simon Josefsson wrote:
> For some other projects, I create a DEF file using -Wl,--output-def,
> which makes MSVS integration simpler, we could consider something
> similar.

It's possible to share libraries between MS and GNU as long as the
calling convention is made explicit in headers, and the right build
flags get used. A DEF file is also needed, but may need some
massaging for MS to be happy about the output.

I'm sorting this mess out for libusb and will make sure to send a
note here when that's done.


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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec  2 12:27:17 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB2BQwNN014213;
	Thu, 2 Dec 2010 12:27:15 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB2BQvIh014210
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 2 Dec 2010 12:26:57 +0100
Received: (qmail 14193 invoked from network); 2 Dec 2010 11:26:51 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 2 Dec 2010 11:26:51 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Thu, 02 Dec 2010 11:26:51 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #199: Endless poll in libssh2_sftp_write
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/199#comment:1
Message-ID: <058.d32a5a0c7ffbe795239703a4b623c390@libssh2.stuge.se>
References: <043.d3f73542967b706ee368d12923800fce@libssh2.stuge.se>
X-Trac-Ticket-ID: 199
In-Reply-To: <043.d3f73542967b706ee368d12923800fce@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 02 Dec 2010 12:27:17 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 02 Dec 2010 12:26:57 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#199: Endless poll in libssh2_sftp_write
----------------------+-----------------------------------------------------
  Reporter:  josusky  |        Owner:       
      Type:  defect   |       Status:  new  
  Priority:  normal   |    Milestone:  1.2.8
 Component:  SFTP     |      Version:  1.2.7
Resolution:           |     Keywords:       
    Blocks:           |   Blocked By:       
----------------------+-----------------------------------------------------

Comment (by bagder):

 This is in fact issue #160 just expressed differently...

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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec  2 13:06:13 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB2C64oQ006988;
	Thu, 2 Dec 2010 13:06:12 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB2C63l7006957
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 2 Dec 2010 13:06:03 +0100
Received: (qmail 19314 invoked from network); 2 Dec 2010 12:06:01 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 2 Dec 2010 12:06:01 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Thu, 02 Dec 2010 12:06:01 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #199: Endless poll in libssh2_sftp_write
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/199#comment:2
Message-ID: <058.81cf38910262f9fbe868facbb1ea2ac8@libssh2.stuge.se>
References: <043.d3f73542967b706ee368d12923800fce@libssh2.stuge.se>
X-Trac-Ticket-ID: 199
In-Reply-To: <043.d3f73542967b706ee368d12923800fce@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 02 Dec 2010 13:06:13 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 02 Dec 2010 13:06:03 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#199: Endless poll in libssh2_sftp_write
------------------------+---------------------------------------------------
  Reporter:  josusky    |        Owner:        
      Type:  defect     |       Status:  closed
  Priority:  normal     |    Milestone:  1.2.8 
 Component:  SFTP       |      Version:  1.2.7 
Resolution:  duplicate  |     Keywords:        
    Blocks:             |   Blocked By:        
------------------------+---------------------------------------------------
Changes (by josusky):

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


Comment:

 You are right, the _libssh2_wait_socket() can use either poll() or
 select() and in both cases it can block indefinitely.

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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec  2 13:10:48 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB2CAjJS008666;
	Thu, 2 Dec 2010 13:10:48 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB2CAhhV008649
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 2 Dec 2010 13:10:44 +0100
Received: (qmail 20199 invoked from network); 2 Dec 2010 12:10:42 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 2 Dec 2010 12:10:42 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Thu, 02 Dec 2010 12:10:42 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #160: Blocking indefinitely in _libssh2_wait_socket
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/160#comment:7
Message-ID: <060.8e2cc6c61983727e37476593f2a0c3d3@libssh2.stuge.se>
References: <045.25a362f658d23c60d7f99022aa740690@libssh2.stuge.se>
X-Trac-Ticket-ID: 160
In-Reply-To: <045.25a362f658d23c60d7f99022aa740690@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 02 Dec 2010 13:10:48 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 02 Dec 2010 13:10:44 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#160: Blocking indefinitely in _libssh2_wait_socket
--------------------------+-------------------------------------------------
  Reporter:  dietmar11    |        Owner:  bagder  
      Type:  enhancement  |       Status:  assigned
  Priority:  normal       |    Milestone:          
 Component:  API          |      Version:  1.2.4   
Resolution:               |     Keywords:          
    Blocks:               |   Blocked By:          
--------------------------+-------------------------------------------------

Comment (by josusky):

 See also #199 which reports endless poll() (which is alternative to
 select() in _libssh2_wait_socket())

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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec  2 13:23:21 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB2CNDDr017022;
	Thu, 2 Dec 2010 13:23:20 +0100
Received: from mail0.avcosystems.co.uk (mail0.avcosystems.co.uk
	[195.224.236.86])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB2CNCSH016912
	(version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 2 Dec 2010 13:23:12 +0100
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 1PO8Bl-0008V5-Ar
	for <libssh2-devel@cool.haxx.se>; Thu, 02 Dec 2010 12:23:05 +0000
From: "Mark Smith" <mts-filtered@avcosystems.co.uk>
To: "'libssh2 development'" <libssh2-devel@cool.haxx.se>
References: <899419.69857.qm@web45307.mail.sp1.yahoo.com><4CD3CA48.4060403@peut.org><702C2A8AA0DB49DE8D4C4A6456A05A1D@internal.avcosystems.com><AANLkTinJWbiGKfJLkDkMybC_ScszeWdi03VrTVaUFHpw@mail.gmail.com><0B0C709AC25D4C4BB7E760234B8591FD@internal.avcosystems.com><87r5ezzzjm.fsf@latte.josefsson.org><alpine.DEB.2.00.1011051420150.26143@tvnag.unkk.fr><4CD40598.2070606@SDlabs.se>
	<alpine.DEB.2.00.1011051426550.26143@tvnag.unkk.fr>
Subject: RE: Using libssh2_userauth_publickey_fromfile() when I don't have a
	public key
Date: Thu, 2 Dec 2010 12:23:05 -0000
Message-ID: <D56EF17649304BB28EE7861D1847457B@internal.avcosystems.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="----=_NextPart_000_0FD3_01CB921B.AC0F5790"
X-Mailer: Microsoft Office Outlook 11
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994
thread-index: Act87YT2XBJ2t9PPTSKSa7qEIntWMwVLS++Q
In-Reply-To: <alpine.DEB.2.00.1011051426550.26143@tvnag.unkk.fr>
X-AVCO-Scan-Signature: 5c5d5f0e5a73e36f254ba477c0befa71
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 02 Dec 2010 13:23:21 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 02 Dec 2010 13:23:12 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

This is a multi-part message in MIME format.

------=_NextPart_000_0FD3_01CB921B.AC0F5790
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

As previously discussed, I have completed the public key patch and
refactored it for 1.2.8 to split the openssl-specific code into openssl.c
(and .h) and put stubs into gcrypt.

I have only been able to test this when compiled with vc6 (win32) so please
could other people test this using other systems/compilers and
comment/improve before it gets committed?

For reference, credit for the work involved in creating the original version
should be given to the original supplier (Jean-Louis Charton), whose version
can be found at
http://libssh2.org/mail/libssh2-devel-archive-2009-03/0117.shtml; all I've
done since is modify it to apply against newer versions and now split it
into the version attached here.

-- 
Mark Smith

------=_NextPart_000_0FD3_01CB921B.AC0F5790
Content-Type: application/octet-stream;
	name="libssh2-1.2.8-pubkey.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="libssh2-1.2.8-pubkey.diff"

Index: libgcrypt.c=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
--- libgcrypt.c	(revision 4)=0A=
+++ libgcrypt.c	(working copy)=0A=
@@ -572,4 +572,16 @@=0A=
     return ret;=0A=
 }=0A=
 =0A=
+int=0A=
+gen_publickey_from_private_keyfile(LIBSSH2_SESSION *session,=0A=
+                                   unsigned char **method,=0A=
+                                   unsigned long *method_len,=0A=
+                                   unsigned char **pubkeydata,=0A=
+                                   unsigned long *pubkeydata_len,=0A=
+                                   const char *privatekey,=0A=
+                                   const char *passphrase)=0A=
+{=0A=
+    return -1; /* not yet supported; interpreted by userauth.c to call =
libssh2_error */=0A=
+}=0A=
+=0A=
 #endif /* LIBSSH2_LIBGCRYPT */=0A=
Index: libgcrypt.h=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
--- libgcrypt.h	(revision 4)=0A=
+++ libgcrypt.h	(working copy)=0A=
@@ -207,3 +207,11 @@=0A=
 #define _libssh2_bn_bytes(bn) (gcry_mpi_get_nbits (bn) / 8 + =
((gcry_mpi_get_nbits (bn) % 8 =3D=3D 0) ? 0 : 1))=0A=
 #define _libssh2_bn_bits(bn) gcry_mpi_get_nbits (bn)=0A=
 #define _libssh2_bn_free(bn) gcry_mpi_release(bn)=0A=
+=0A=
+int gen_publickey_from_private_keyfile(LIBSSH2_SESSION *session,=0A=
+                                       unsigned char **method,=0A=
+                                       unsigned long *method_len,=0A=
+                                       unsigned char **pubkeydata,=0A=
+                                       unsigned long *pubkeydata_len,=0A=
+                                       const char *privatekey,=0A=
+                                       const char *passphrase);=0A=
Index: openssl.c=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
--- openssl.c	(revision 4)=0A=
+++ openssl.c	(working copy)=0A=
@@ -514,5 +514,274 @@=0A=
     EVP_DigestUpdate(&ctx, message, len);=0A=
     EVP_DigestFinal(&ctx, out, NULL);=0A=
 }=0A=
+=0A=
+static unsigned char *=0A=
+write_bn(unsigned char *buf, const BIGNUM *bn, int bn_bytes)=0A=
+{=0A=
+    unsigned char *p =3D buf;=0A=
+=0A=
+    /* Left space for bn size which will be written below. */=0A=
+    p +=3D 4;=0A=
+=0A=
+    *p =3D 0;=0A=
+    BN_bn2bin(bn, p + 1);=0A=
+    if (!(*(p + 1) & 0x80)) {=0A=
+       memmove(p, p + 1, --bn_bytes);=0A=
+    }=0A=
+    _libssh2_htonu32(p - 4, bn_bytes);  /* Post write bn size. */=0A=
+=0A=
+    return p + bn_bytes;=0A=
+}=0A=
+=0A=
+static unsigned char *=0A=
+gen_publickey_from_rsa(LIBSSH2_SESSION *session, RSA *rsa,=0A=
+                       unsigned long *key_len)=0A=
+{=0A=
+    int            e_bytes, n_bytes;=0A=
+    unsigned long  len;=0A=
+    unsigned char* key;=0A=
+    unsigned char* p;=0A=
+=0A=
+    e_bytes =3D BN_num_bytes(rsa->e) + 1;=0A=
+    n_bytes =3D BN_num_bytes(rsa->n) + 1;=0A=
+=0A=
+    /* Key form is "ssh-rsa" + e + n. */=0A=
+    len =3D 4 + 7 + 4 + e_bytes + 4 + n_bytes;=0A=
+=0A=
+    key =3D LIBSSH2_ALLOC(session, len);=0A=
+    if (key =3D=3D NULL) {=0A=
+       return NULL;=0A=
+    }=0A=
+=0A=
+    /* Process key encoding. */=0A=
+    p =3D key;=0A=
+=0A=
+    _libssh2_htonu32(p, 7);  /* Key type. */=0A=
+    p +=3D 4;=0A=
+    memcpy(p, "ssh-rsa", 7);=0A=
+    p +=3D 7;=0A=
+=0A=
+    p =3D write_bn(p, rsa->e, e_bytes);=0A=
+    p =3D write_bn(p, rsa->n, n_bytes);=0A=
+=0A=
+    *key_len =3D (unsigned long)(p - key);=0A=
+    return key;=0A=
+}=0A=
+=0A=
+static unsigned char *=0A=
+gen_publickey_from_dsa(LIBSSH2_SESSION* session, DSA *dsa,=0A=
+                       unsigned long *key_len)=0A=
+{=0A=
+    int            p_bytes, q_bytes, g_bytes, k_bytes;=0A=
+    unsigned long  len;=0A=
+    unsigned char* key;=0A=
+    unsigned char* p;=0A=
+=0A=
+    p_bytes =3D BN_num_bytes(dsa->p) + 1;=0A=
+    q_bytes =3D BN_num_bytes(dsa->q) + 1;=0A=
+    g_bytes =3D BN_num_bytes(dsa->g) + 1;=0A=
+    k_bytes =3D BN_num_bytes(dsa->pub_key) + 1;=0A=
+=0A=
+    /* Key form is "ssh-dss" + p + q + g + pub_key. */=0A=
+    len =3D 4 + 7 + 4 + p_bytes + 4 + q_bytes + 4 + g_bytes + 4 + =
k_bytes;=0A=
+=0A=
+    key =3D LIBSSH2_ALLOC(session, len);=0A=
+    if (key =3D=3D NULL) {=0A=
+       return NULL;=0A=
+    }=0A=
+=0A=
+    /* Process key encoding. */=0A=
+    p =3D key;=0A=
+=0A=
+    _libssh2_htonu32(p, 7);  /* Key type. */=0A=
+    p +=3D 4;=0A=
+    memcpy(p, "ssh-dss", 7);=0A=
+    p +=3D 7;=0A=
+=0A=
+    p =3D write_bn(p, dsa->p, p_bytes);=0A=
+    p =3D write_bn(p, dsa->q, q_bytes);=0A=
+    p =3D write_bn(p, dsa->g, g_bytes);=0A=
+    p =3D write_bn(p, dsa->pub_key, k_bytes);=0A=
+=0A=
+    *key_len =3D (unsigned long)(p - key);=0A=
+    return key;=0A=
+}=0A=
+=0A=
+static int=0A=
+gen_publickey_from_rsa_evp(LIBSSH2_SESSION *session,=0A=
+                           unsigned char **method,=0A=
+                           unsigned long *method_len,=0A=
+                           unsigned char **pubkeydata,=0A=
+                           unsigned long *pubkeydata_len,=0A=
+                           EVP_PKEY *pk)=0A=
+{=0A=
+    RSA*           rsa =3D NULL;=0A=
+    unsigned char* key;=0A=
+    unsigned char* method_buf =3D NULL;=0A=
+    unsigned long  key_len;=0A=
+=0A=
+    _libssh2_debug(session,=0A=
+                   LIBSSH2_TRACE_AUTH,=0A=
+                   "Computing public key from RSA private key envelop");=0A=
+=0A=
+    rsa =3D EVP_PKEY_get1_RSA(pk);=0A=
+    if (rsa =3D=3D NULL) {=0A=
+        /* Assume memory allocation error... what else could it be ? */=0A=
+       goto __alloc_error;=0A=
+    }=0A=
+=0A=
+    method_buf =3D LIBSSH2_ALLOC(session, 7);  /* ssh-rsa. */=0A=
+    if (method_buf =3D=3D NULL) {=0A=
+       goto __alloc_error;=0A=
+    }=0A=
+=0A=
+    key =3D gen_publickey_from_rsa(session, rsa, &key_len);=0A=
+    if (key =3D=3D NULL) {=0A=
+       goto __alloc_error;=0A=
+    }=0A=
+    RSA_free(rsa);=0A=
+=0A=
+    memcpy(method_buf, "ssh-rsa", 7);=0A=
+    *method         =3D method_buf;=0A=
+    *method_len     =3D 7;=0A=
+    *pubkeydata     =3D key;=0A=
+    *pubkeydata_len =3D key_len;=0A=
+    return 0;=0A=
+=0A=
+__alloc_error:=0A=
+    if (rsa !=3D NULL) {=0A=
+       RSA_free(rsa);=0A=
+    }=0A=
+    if (method_buf !=3D NULL) {=0A=
+        LIBSSH2_FREE(session, method_buf);=0A=
+    }=0A=
+=0A=
+    _libssh2_error(session,=0A=
+                  LIBSSH2_ERROR_ALLOC,=0A=
+                  "Unable to allocate memory for private key data");=0A=
+    return -1;=0A=
+}=0A=
+=0A=
+static int=0A=
+gen_publickey_from_dsa_evp(LIBSSH2_SESSION *session,=0A=
+                           unsigned char **method,=0A=
+                           unsigned long *method_len,=0A=
+                           unsigned char **pubkeydata,=0A=
+                           unsigned long *pubkeydata_len,=0A=
+                           EVP_PKEY *pk)=0A=
+{=0A=
+    DSA*           dsa =3D NULL;=0A=
+    unsigned char* key;=0A=
+    unsigned char* method_buf =3D NULL;=0A=
+    unsigned long  key_len;=0A=
+=0A=
+    _libssh2_debug(session,=0A=
+                   LIBSSH2_TRACE_AUTH,=0A=
+                   "Computing public key from DSA private key envelop");=0A=
+=0A=
+    dsa =3D EVP_PKEY_get1_DSA(pk);=0A=
+    if (dsa =3D=3D NULL) {=0A=
+        /* Assume memory allocation error... what else could it be ? */=0A=
+       goto __alloc_error;=0A=
+    }=0A=
+=0A=
+    method_buf =3D LIBSSH2_ALLOC(session, 7);  /* ssh-dss. */=0A=
+    if (method_buf =3D=3D NULL) {=0A=
+       goto __alloc_error;=0A=
+    }=0A=
+=0A=
+    key =3D gen_publickey_from_dsa(session, dsa, &key_len);=0A=
+    if (key =3D=3D NULL) {=0A=
+       goto __alloc_error;=0A=
+    }=0A=
+    DSA_free(dsa);=0A=
+=0A=
+    memcpy(method_buf, "ssh-dss", 7);=0A=
+    *method         =3D method_buf;=0A=
+    *method_len     =3D 7;=0A=
+    *pubkeydata     =3D key;=0A=
+    *pubkeydata_len =3D key_len;=0A=
+    return 0;=0A=
+=0A=
+__alloc_error:=0A=
+    if (dsa !=3D NULL) {=0A=
+       DSA_free(dsa);=0A=
+    }=0A=
+    if (method_buf !=3D NULL) {=0A=
+        LIBSSH2_FREE(session, method_buf);=0A=
+    }=0A=
+=0A=
+    _libssh2_error(session,=0A=
+                  LIBSSH2_ERROR_ALLOC,=0A=
+                  "Unable to allocate memory for private key data");=0A=
+    return -1;=0A=
+}=0A=
+=0A=
+int=0A=
+gen_publickey_from_private_keyfile(LIBSSH2_SESSION *session,=0A=
+                                   unsigned char **method,=0A=
+                                   unsigned long *method_len,=0A=
+                                   unsigned char **pubkeydata,=0A=
+                                   unsigned long *pubkeydata_len,=0A=
+                                   const char *privatekey,=0A=
+                                   const char *passphrase)=0A=
+{=0A=
+    int       st;=0A=
+    BIO*	  bp;=0A=
+    EVP_PKEY* pk;=0A=
+=0A=
+    _libssh2_debug(session,=0A=
+                   LIBSSH2_TRACE_AUTH,=0A=
+                   "Computing public key from private key file: %s",=0A=
+                   privatekey);=0A=
+=0A=
+    bp =3D BIO_new_file(privatekey, "r");=0A=
+    if (bp =3D=3D NULL) {=0A=
+        _libssh2_error(session,=0A=
+                      LIBSSH2_ERROR_FILE,=0A=
+                      "Unable to open private key file");=0A=
+        return -1;=0A=
+    }=0A=
+    if (!EVP_get_cipherbyname("des")) {=0A=
+/* If this cipher isn't loaded it's a pretty good indication that none =
are.=0A=
+ * I have *NO DOUBT* that there's a better way to deal with this =
($#&%#$(%$#(=0A=
+ * Someone buy me an OpenSSL manual and I'll read up on it.=0A=
+ */=0A=
+        OpenSSL_add_all_ciphers();=0A=
+    }=0A=
+	BIO_reset(bp);=0A=
+    pk =3D PEM_read_bio_PrivateKey(bp, NULL, NULL, (void*)passphrase);=0A=
+    BIO_free(bp);=0A=
+=0A=
+    if (pk =3D=3D NULL) {=0A=
+        _libssh2_error(session,=0A=
+                      LIBSSH2_ERROR_FILE,=0A=
+                      "Wrong passphrase or invalid/unrecognized "=0A=
+                      "private key file format");=0A=
+        return -1;=0A=
+    }=0A=
+=0A=
+    switch (pk->type) {=0A=
+    case EVP_PKEY_RSA :=0A=
+        st =3D gen_publickey_from_rsa_evp(=0A=
+                 session, method, method_len, pubkeydata, =
pubkeydata_len, pk);=0A=
+        break;=0A=
+=0A=
+    case EVP_PKEY_DSA :=0A=
+        st =3D gen_publickey_from_dsa_evp(=0A=
+                 session, method, method_len, pubkeydata, =
pubkeydata_len, pk);=0A=
+        break;=0A=
+=0A=
+    default :=0A=
+        st =3D -1;=0A=
+        _libssh2_error(session,=0A=
+                      LIBSSH2_ERROR_FILE,=0A=
+                      "Unsupported private key file format");=0A=
+        break;=0A=
+    }=0A=
+=0A=
+    EVP_PKEY_free(pk);=0A=
+    return st;=0A=
+}=0A=
 =0A=
 #endif /* !LIBSSH2_LIBGCRYPT */=0A=
Index: openssl.h=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
--- openssl.h	(revision 4)=0A=
+++ openssl.h	(working copy)=0A=
@@ -241,3 +241,11 @@=0A=
 const EVP_CIPHER *_libssh2_EVP_aes_128_ctr(void);=0A=
 const EVP_CIPHER *_libssh2_EVP_aes_192_ctr(void);=0A=
 const EVP_CIPHER *_libssh2_EVP_aes_256_ctr(void);=0A=
+=0A=
+int gen_publickey_from_private_keyfile(LIBSSH2_SESSION *session,=0A=
+                                       unsigned char **method,=0A=
+                                       unsigned long *method_len,=0A=
+                                       unsigned char **pubkeydata,=0A=
+                                       unsigned long *pubkeydata_len,=0A=
+                                       const char *privatekey,=0A=
+                                       const char *passphrase);=0A=
Index: userauth.c=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
--- userauth.c	(revision 4)=0A=
+++ userauth.c	(working copy)=0A=
@@ -655,13 +655,22 @@=0A=
         memset(&session->userauth_host_packet_requirev_state, 0,=0A=
                sizeof(session->userauth_host_packet_requirev_state));=0A=
 =0A=
-        rc =3D file_read_publickey(session, =
&session->userauth_host_method,=0A=
-                                 &session->userauth_host_method_len,=0A=
-                                 &pubkeydata, &pubkeydata_len,=0A=
-                                 publickey);=0A=
-        if(rc)=0A=
-            /* Note: file_read_publickey() calls _libssh2_error() */=0A=
-            return rc;=0A=
+        if (publickey !=3D NULL) {=0A=
+            rc =3D file_read_publickey(session, =
&session->userauth_host_method,=0A=
+                                     &session->userauth_host_method_len,=0A=
+                                     &pubkeydata, &pubkeydata_len, =
publickey);=0A=
+            if(rc)=0A=
+                /* Note: file_read_publickey() calls _libssh2_error() */=0A=
+                return rc;=0A=
+        }=0A=
+        else {=0A=
+            /* Compute public key from private key. */=0A=
+            if (gen_publickey_from_private_keyfile(session, =
&session->userauth_host_method,=0A=
+                    &session->userauth_host_method_len,=0A=
+                    &pubkeydata, &pubkeydata_len, privatekey, =
passphrase))=0A=
+                return _libssh2_error(session, LIBSSH2_ERROR_FILE,=0A=
+                                     "Unable to extract public key from =
private key file");=0A=
+        }=0A=
 =0A=
         /*=0A=
          * 52 =3D packet_type(1) + username_len(4) + servicename_len(4) =
+=0A=
@@ -1221,11 +1230,21 @@=0A=
     privkey_file.passphrase =3D passphrase;=0A=
 =0A=
     if (session->userauth_pblc_state =3D=3D libssh2_NB_state_idle) {=0A=
-        rc =3D file_read_publickey(session, =
&session->userauth_pblc_method,=0A=
-                                 &session->userauth_pblc_method_len,=0A=
-                                 &pubkeydata, &pubkeydata_len, =
publickey);=0A=
-        if(rc)=0A=
-            return rc;=0A=
+        if (publickey !=3D NULL) {=0A=
+            rc =3D file_read_publickey(session, =
&session->userauth_pblc_method,=0A=
+                                     &session->userauth_pblc_method_len,=0A=
+                                     &pubkeydata, =
&pubkeydata_len,publickey);=0A=
+            if(rc)=0A=
+                return rc;=0A=
+        }=0A=
+        else {=0A=
+            /* Compute public key from private key. */=0A=
+            if (gen_publickey_from_private_keyfile(session, =
&session->userauth_pblc_method,=0A=
+                    &session->userauth_pblc_method_len,=0A=
+                    &pubkeydata, &pubkeydata_len, privatekey, =
passphrase))=0A=
+                return _libssh2_error(session, LIBSSH2_ERROR_FILE,=0A=
+                                     "Unable to extract public key from =
private key file");=0A=
+        }=0A=
     }=0A=
 =0A=
     rc =3D _libssh2_userauth_publickey(session, username, username_len,=0A=

------=_NextPart_000_0FD3_01CB921B.AC0F5790
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

------=_NextPart_000_0FD3_01CB921B.AC0F5790--

From libssh2-devel-bounces@cool.haxx.se  Thu Dec  2 14:42:22 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB2Dg4Il002032;
	Thu, 2 Dec 2010 14:42:20 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB2Dg3bj002026
	for <libssh2-devel@cool.haxx.se>; Thu, 2 Dec 2010 14:42:03 +0100
Date: Thu, 2 Dec 2010 14:42:03 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Bring up to date windows build environment
In-Reply-To: <4CE3A55C.5050004@gmail.com>
Message-ID: <alpine.DEB.2.00.1012021438430.15665@tvnag.unkk.fr>
References: <4CE3A55C.5050004@gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 02 Dec 2010 14:42:22 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 02 Dec 2010 14:42:04 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Wed, 17 Nov 2010, Dongsheng Song wrote:

> Windows build environment is not up to date, missing 4 new C source files, 
> and VC 6.0 was broken now.

I feel a bit reluctant to add such an amount of changes in a single commit, 
and without any proper comments/explanations. Can you please provide them 
separately with separate commit comments so that we can consider and discuss 
them independently?

I fixed the elsif issue just a while ago independently if your patch (I got it 
reported on IRC and I hadn't noticed that your patch fixed this.)

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec  2 15:26:55 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB2EQnNU026404;
	Thu, 2 Dec 2010 15:26:55 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB2EP0w8025230
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 2 Dec 2010 15:25:00 +0100
Received: (qmail 4123 invoked from network); 2 Dec 2010 14:24:57 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 2 Dec 2010 14:24:57 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Thu, 02 Dec 2010 14:24:57 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #198: _libssh2_channel_close() may hang
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/198#comment:1
Message-ID: <055.9c8121073aaa4d99a1b31e502b5e5908@libssh2.stuge.se>
References: <040.f267185fd189c3163b83597a7e73540d@libssh2.stuge.se>
X-Trac-Ticket-ID: 198
In-Reply-To: <040.f267185fd189c3163b83597a7e73540d@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 02 Dec 2010 15:26:55 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 02 Dec 2010 15:25:01 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

Comment (by fd64):

 I have been testing the application with a patched libssh2 and I have not
 been able to reproduce this problem. This patch is certainly not the
 proper fix, but I just wanted to see if it still hangs when we limit the
 number of iteration of the loop when it hanged. So that's a good news,
 because with that modification libssh2 does not seem to hang any more even
 when it's running with very unreliable connections.

 If you could fix that problem in the upstream version, it would be great.

 Thanks

 Here is the patch:

 diff --git a/src/channel.c b/src/channel.c
 index ff1fb4d..bab8693 100644
 --- a/src/channel.c
 +++ b/src/channel.c
 @@ -2260,6 +2260,7 @@ int _libssh2_channel_close(LIBSSH2_CHANNEL *
 channel)
      LIBSSH2_SESSION *session = channel->session;
      int rc = 0;
      int retcode;
 +    int retries;

      if (channel->local.close) {
          /* Already closed, act like we sent another close,
 @@ -2304,7 +2305,8 @@ int _libssh2_channel_close(LIBSSH2_CHANNEL *
 channel)
      if (channel->close_state == libssh2_NB_state_sent) {
          /* We must wait for the remote SSH_MSG_CHANNEL_CLOSE message */

 -        while (!channel->remote.close && !rc) {
 +       retries = 0;
 +        while (!channel->remote.close && !rc && retries++ < 16) {
              rc = _libssh2_transport_read(session);
          }
      }

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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec  2 15:32:07 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB2EVx4m029091;
	Thu, 2 Dec 2010 15:32:05 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB2EVv2u029065
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 2 Dec 2010 15:31:57 +0100
Received: (qmail 4981 invoked from network); 2 Dec 2010 14:31:55 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 2 Dec 2010 14:31:55 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Thu, 02 Dec 2010 14:31:55 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #198: _libssh2_channel_close() may hang
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/198#comment:2
Message-ID: <055.4a20db2f9744287f31c4ec52537ca8e0@libssh2.stuge.se>
References: <040.f267185fd189c3163b83597a7e73540d@libssh2.stuge.se>
X-Trac-Ticket-ID: 198
In-Reply-To: <040.f267185fd189c3163b83597a7e73540d@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 02 Dec 2010 15:32:07 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 02 Dec 2010 15:31:57 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

Comment (by bagder):

 I think it is due to the #160 problem, in that the waiting will hang if
 the connection goes down unexpectedly.

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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec  2 16:09:25 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB2F9DAi021510;
	Thu, 2 Dec 2010 16:09:24 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB2F9CPA021495
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 2 Dec 2010 16:09:12 +0100
Received: (qmail 10181 invoked from network); 2 Dec 2010 15:09:09 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 2 Dec 2010 15:09:09 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Thu, 02 Dec 2010 15:09:09 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #198: _libssh2_channel_close() may hang
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/198#comment:3
Message-ID: <055.c2bca6436c854df0e1d39f8ee100682d@libssh2.stuge.se>
References: <040.f267185fd189c3163b83597a7e73540d@libssh2.stuge.se>
X-Trac-Ticket-ID: 198
In-Reply-To: <040.f267185fd189c3163b83597a7e73540d@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 02 Dec 2010 16:09:25 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 02 Dec 2010 16:09:12 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

Comment (by bagder):

 sorry, not the exact same problem, but simply that if the connection goes
 away the remote.close will never be set and the loop will hang
 indefinately

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

From libssh2-devel-bounces@cool.haxx.se  Fri Dec  3 13:52:09 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB3CploW010624;
	Fri, 3 Dec 2010 13:52:05 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB3Cpk1Z010616
	for <libssh2-devel@cool.haxx.se>; Fri, 3 Dec 2010 13:51:46 +0100
Date: Fri, 3 Dec 2010 13:51:46 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Pipelining and recent sftp upload improvements
In-Reply-To: <6BB02424-4FE7-4A99-B409-087FA01996CE@panic.com>
Message-ID: <alpine.DEB.2.00.1012031344100.15665@tvnag.unkk.fr>
References: <F2E2A065-EF4B-4D97-B13F-33607E8A695D@panic.com>
	<alpine.DEB.2.00.1011291404120.20074@tvnag.unkk.fr>
	<6BB02424-4FE7-4A99-B409-087FA01996CE@panic.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Fri, 03 Dec 2010 13:52:09 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Fri, 03 Dec 2010 13:51:46 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Mon, 29 Nov 2010, Will Cosgrove wrote:

> The advantages of this is that you can call write_async_begin say, 10 times 
> in a row, then starting draining the acks using write_async, this minimizes 
> network latency (aka sitting on a select() call) and does a better job 
> maxing out available bandwidth.

Advantage compared to the original naive implemention yes, but not to the 
current SFTP upload code, right?

> The advantages of this method to the new write pipelining on the 1.2.8 
> branch is that you don't have to pre-read a large buffer of data into 
> memory.

How come? If you want to send a lot of data, you need it there. I don't see 
how your API makes it use any less data in memory if you want to achieve the 
same amount of pipelining. Similarly, your way and my way both get less 
pipelining if you use less buffer memory. A fair trade-off methinks.

> The disadvantage is it's more leg-work for the implementor because you have 
> to track the offsets and drain replies manually.

I actually only see disadvantages with this quirky API as I believe we can 
reach the same model of sending without forcing this onto our users.

> Thinking out loud, it might be worth adding a convenance API that takes a 
> file path and does all this 'behind-the-scences' like the openssh 
> do_upload/do_download methods do.

Why? What is so bad with my current approach? It certainly maintains a very 
simple and familiar API to users (not to mention unmodified) and yet it should 
be possible to reach at least roughly the same throughput.

> Now for the ever-so-important speed improvements.  I'm testing against an 
> internal server (RAID'ed) on a gigabit ethernet.  My before benchmarks were 
> about 12 MB/sec upload using 1.2.7 stable release.  My after is about 53 
> MB/sec upload.  When shelling out to openssh's sftp, I can get about 73 
> MB/sec.  Ideally I'd like to get libssh up to ssh's performance levels, but 
> that's for another day.

That sounds cool, but isn't that a low-latency connection?

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Fri Dec  3 19:24:54 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB3IOYQw018899;
	Fri, 3 Dec 2010 19:24:50 +0100
Received: from panic.com (posh.panic.com [38.103.165.4])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB3IOWRs018864
	for <libssh2-devel@cool.haxx.se>; Fri, 3 Dec 2010 19:24:33 +0100
Received: from [10.0.0.81] (unknown [38.103.165.36])
	by panic.com (Postfix) with ESMTP id 2D1D130F73ED
	for <libssh2-devel@cool.haxx.se>; Fri,  3 Dec 2010 10:24:23 -0800 (PST)
From: Will Cosgrove <will@panic.com>
Mime-Version: 1.0 (Apple Message framework v1082)
Subject: Re: Pipelining and recent sftp upload improvements
Date: Fri, 3 Dec 2010 10:24:22 -0800
In-Reply-To: <alpine.DEB.2.00.1012031344100.15665@tvnag.unkk.fr>
To: libssh2 development <libssh2-devel@cool.haxx.se>
References: <F2E2A065-EF4B-4D97-B13F-33607E8A695D@panic.com>
	<alpine.DEB.2.00.1011291404120.20074@tvnag.unkk.fr>
	<6BB02424-4FE7-4A99-B409-087FA01996CE@panic.com>
	<alpine.DEB.2.00.1012031344100.15665@tvnag.unkk.fr>
Message-Id: <3FF44A41-1E6E-4819-A3F7-C34F7F3AEF07@panic.com>
X-Mailer: Apple Mail (2.1082)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Fri, 03 Dec 2010 19:24:54 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Fri, 03 Dec 2010 19:24:33 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1900665583=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se


--===============1900665583==
Content-Type: multipart/alternative; boundary=Apple-Mail-2--439149596


--Apple-Mail-2--439149596
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

>> The advantages of this is that you can call write_async_begin say, 10 =
times in a row, then starting draining the acks using write_async, this =
minimizes network latency (aka sitting on a select() call) and does a =
better job maxing out available bandwidth.
>=20
> Advantage compared to the original naive implemention yes, but not to =
the current SFTP upload code, right?

I have not benchmarked the current code, but I would assume it's =
similar.

>> The disadvantage is it's more leg-work for the implementor because =
you have to track the offsets and drain replies manually.
>=20
> I actually only see disadvantages with this quirky API as I believe we =
can reach the same model of sending without forcing this onto our users.

The main reason I wrote it like this was to be able to merge with new =
releases without modifying the current API/code.

>> Thinking out loud, it might be worth adding a convenance API that =
takes a file path and does all this 'behind-the-scences' like the =
openssh do_upload/do_download methods do.
>=20
> Why? What is so bad with my current approach? It certainly maintains a =
very simple and familiar API to users (not to mention unmodified) and =
yet it should be possible to reach at least roughly the same throughput.

Your approach is good, I would have used it if I had known about it =
before I wrote my own API. :)   But I still think a new API that does =
*all* the legwork of uploading/downloading a file would be useful.  It =
seems like the logical next step if end users don't have to do anything =
but pass in a file path.

Cheers,
Will=

--Apple-Mail-2--439149596
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; =
"><div><blockquote type=3D"cite"><div><blockquote type=3D"cite">The =
advantages of this is that you can call write_async_begin say, 10 times =
in a row, then starting draining the acks using write_async, this =
minimizes network latency (aka sitting on a select() call) and does a =
better job maxing out available bandwidth.<br></blockquote><br>Advantage =
compared to the original naive implemention yes, but not to the current =
SFTP upload code, right?<font class=3D"Apple-style-span" =
color=3D"#000000"><font class=3D"Apple-style-span" =
color=3D"#144FAE"><br></font></font></div></blockquote><div><br></div>I =
have not benchmarked the current code, but I would assume it's =
similar.<br><br><blockquote type=3D"cite"><div><blockquote =
type=3D"cite">The disadvantage is it's more leg-work for the implementor =
because you have to track the offsets and drain replies =
manually.<br></blockquote><br>I actually only see disadvantages with =
this quirky API as I believe we can reach the same model of sending =
without forcing this onto our users.<font class=3D"Apple-style-span" =
color=3D"#000000"><font class=3D"Apple-style-span" =
color=3D"#144FAE"><br></font></font></div></blockquote><div><br></div>The =
main reason I wrote it like this was to be able to merge with new =
releases without modifying the current API/code.<br><br><blockquote =
type=3D"cite"><div><blockquote type=3D"cite">Thinking out loud, it might =
be worth adding a convenance API that takes a file path and does all =
this 'behind-the-scences' like the openssh do_upload/do_download methods =
do.<br></blockquote><br>Why? What is so bad with my current approach? It =
certainly maintains a very simple and familiar API to users (not to =
mention unmodified) and yet it should be possible to reach at least =
roughly the same =
throughput.<br></div></blockquote><div><br></div><div>Your approach is =
good, I would have used it if I had known about it before I wrote my own =
API. :) &nbsp; But I still think a new API that does *all* the legwork =
of uploading/downloading a file would be useful. &nbsp;It seems like the =
logical next step if end users don't have to do anything but pass in a =
file =
path.</div><div><br></div><div>Cheers,</div><div>Will</div></div></body></=
html>=

--Apple-Mail-2--439149596--

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

--===============1900665583==--

From libssh2-devel-bounces@cool.haxx.se  Sat Dec  4 22:20:24 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB4LK1KK016684;
	Sat, 4 Dec 2010 22:20:21 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB4LK0C2016679
	for <libssh2-devel@cool.haxx.se>; Sat, 4 Dec 2010 22:20:00 +0100
Date: Sat, 4 Dec 2010 22:20:00 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Pipelining and recent sftp upload improvements
In-Reply-To: <3FF44A41-1E6E-4819-A3F7-C34F7F3AEF07@panic.com>
Message-ID: <alpine.DEB.2.00.1012042218060.27009@tvnag.unkk.fr>
References: <F2E2A065-EF4B-4D97-B13F-33607E8A695D@panic.com>
	<alpine.DEB.2.00.1011291404120.20074@tvnag.unkk.fr>
	<6BB02424-4FE7-4A99-B409-087FA01996CE@panic.com>
	<alpine.DEB.2.00.1012031344100.15665@tvnag.unkk.fr>
	<3FF44A41-1E6E-4819-A3F7-C34F7F3AEF07@panic.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sat, 04 Dec 2010 22:20:24 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sat, 04 Dec 2010 22:20:00 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Fri, 3 Dec 2010, Will Cosgrove wrote:

> Your approach is good, I would have used it if I had known about it before I 
> wrote my own API. :)  But I still think a new API that does *all* the 
> legwork of uploading/downloading a file would be useful.  It seems like the 
> logical next step if end users don't have to do anything but pass in a file 
> path.

Possibly, yes. If you have ideas on how such an API would look like, do throw 
in some of them ideas here and we can work on them to see where we might end 
up!

-- 

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

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

Hi friends,

Thanks to Mark Riordan for allowing me to use an account on his machine, I 
have the following report to tell:

I've now done libssh2 SFTP uploads just as fast as openssh over my test 
connection! The perhaps most intersting point of all: I didn't change the 
library code to make this happen!

Test connection: 140ms latency, 100mbit upload link, unknown bandwidth 
maximum in the receiving end. No compression was used.

Test system: Linux 2.6.30

Test file: 5MB (5 * 1024 * 1024) bytes.

OpenSSH: takes between 1 to 3 seconds to upload

libssh2: takes 2 seconds to upload (for some reason it seems more consistent
than OpenSSH in my timings): 5242880 bytes in 2 seconds makes 2621440.0 
bytes/sec

(Due to limited disk space in the target server I've only worked with this 
little file, I guess I'll learn more once I go to really large files.)

The secret

It struck me almost immediately once I started to analyze why the stock 
sftp_write_nonblock.c problem doesn't run fast.

It is sort of an API limitation. If the API is used just like it traditionally 
is we very easily get "boundary blockers" where libssh2 will wait until all 
packets are received. If the size of the buffer passed to libssh2_sftp_write() 
is not very large, like 100K or so, I then hardly see any higher speeds than 
300K/sec here (16 seconds was what the example code originally took).

There are but two subtle changes I had to do to the application code to make 
it really fly:

  1 - the most important: increase the buffer size A LOT. I upped it from 100K
      to 1000K, 1 megabyte. This alone makes a significant boost, only because
      the "boundary blockers" become much less frequent so libssh2 can do quite
      a few packets completely pipelined before they happen.

  2 - make the code use the buffer in a "sliding" manner so that as soon as
      libssh2 returns that data has been sent, the app moves the unsent data
      to the start of the buffer and reads data into the end of it in the
      gap of unused data. This makes the app avoid the blocking situation where
      it otherwise waits until the buffer is completely drained before it
      refills again and continues.

I've committed my modified example as sftp_write_sliding.c

Conclusion

The current library code works perfectly fine for this kind of pipelining and 
so does in fact the API.

We should perhaps still consider somehow adding another API that allows the 
application to achieve this somewhat easier without the need to do the massive 
amount of memmove()s that I do now. At the very least it needs to be 
documented if apps want to make use of libssh2's true SFTP powers.

What's next for me

1 - read your comments and feedback on this mail

2 - work on implementing the similar scheme for SFTP

3 - consider if another API is what we want/need and work with you guys what
     the best API/approach for that might be

-- 

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

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

On Sun, 5 Dec 2010, Daniel Stenberg wrote:

> 2 - work on implementing the similar scheme for SFTP

Uh, that should of course read "SFTP downloads" ...

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Sun Dec  5 00:40:39 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB4NeWEb028320;
	Sun, 5 Dec 2010 00:40:38 +0100
Received: from imail.ipswitch.com (imail.ipswitch.com [156.21.1.5])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB4NeTIL028284
	for <libssh2-devel@cool.haxx.se>; Sun, 5 Dec 2010 00:40:30 +0100
DKIM-Signature: q=dns/txt; v=1; c=relaxed/relaxed; s=ipswitch;
	d=ipswitch.com; a=rsa-sha1;
	h=From:To:References:In-Reply-To:Subject:Date:Message-ID:
	MIME-Version:Content-Type:Content-Transfer-Encoding;
	b=pWSMNI8s7I7xnZa+xMdjFBVDM5lpAqWurwzWhdj+7gvOcEwTcwu+b1m2WpMEUHU0YG
	qOqle/So/wBZmsf076y9d0rEU9C5NfEoDPGAolzNZFm9qEYpTau2ee3ZzOBgG6t/fj2f
	DoyLNKoIAuTOvcpfbZ9btvi+q4l3fWY7yY38s=;
	bh=KNdj5h8WhyEA1IYcz/oMCkX20NE=; t=1291506019;
Received: from mrrnt [66.170.5.130] by ipswitch.com with ESMTP
	(SMTPD-11.03) id 197e00176779b40f; Sat, 4 Dec 2010 18:40:18 -0500
From: "Mark Riordan" <mriordan@ipswitch.com>
To: "'libssh2 development'" <libssh2-devel@cool.haxx.se>
References: <alpine.DEB.2.00.1012042339500.27009@tvnag.unkk.fr>
In-Reply-To: <alpine.DEB.2.00.1012042339500.27009@tvnag.unkk.fr>
Subject: RE: SFTP upload speed
Date: Sat, 4 Dec 2010 17:40:19 -0600
Message-ID: <000201cb940c$9c695be0$d53c13a0$@com>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AcuUCN93lOzIm448R7mtcvg4+Ye7zQAA2llQ
Content-Language: en-us
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sun, 05 Dec 2010 00:40:39 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sun, 05 Dec 2010 00:40:30 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

> I've now done libssh2 SFTP uploads just as fast as openssh over my test 
> connection! The perhaps most intersting point of all: I didn't change the 
> library code to make this happen!
> ...
> There are but two subtle changes I had to do to the 
> application code to make it really fly:
> ...

Excellent!  I'll try this out in my test app and/or the 
more complex "real" app and let you know the results.

Mark


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

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

On Sun, 5 Dec 2010, Daniel Stenberg wrote:

> I've now done libssh2 SFTP uploads just as fast as openssh over my test 
> connection! The perhaps most intersting point of all: I didn't change the 
> library code to make this happen!

I re-ran my tests against localhost where I upload 1024000000 bytes to a 
openssh server on 127.0.0.1.

I showed that to make the same app reach really good speeds, I need to do a 
little code tweak and change MAX_SFTP_OUTGOING_SIZE from 4000 to 30000. The 
tests I did yesterday with the high latency tests didn't show any real 
difference whatever I had that size set to.

That number is the size in bytes that libssh2 cuts off the large input buffer 
and sends off as an individual sftp packet.

Using size 30000 I reach about 28 seconds (36MB/sec) which is still almost 50% 
slower than openssh which does the same upload in 19 seconds (51MB/sec)

I think perhaps that size could be made dynamic so that we use a smaller value 
if the buffer given to libssh2_sftp_write() is small, and use the large value 
only if the given buffer is big enough. There's clearly room for some further 
tests to check how that can be done sensibly for best performance...

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Mon Dec  6 11:29:53 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB6ATXx6023541;
	Mon, 6 Dec 2010 11:29:49 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB6ATVrG023527
	for <libssh2-devel@cool.haxx.se>; Mon, 6 Dec 2010 11:29:31 +0100
Date: Mon, 6 Dec 2010 11:29:31 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: [libssh2]libssh2_scp_recv always fails with "Timed out waiting
	for SCP response"
In-Reply-To: <AANLkTinH9eoMtV=ueG+dxPVQ3gdZcWHxHyY6YmCyHQ3w@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1012061129120.19637@tvnag.unkk.fr>
References: <AANLkTinH9eoMtV=ueG+dxPVQ3gdZcWHxHyY6YmCyHQ3w@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-1876622552-1291631371=:19637"
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 06 Dec 2010 11:29:52 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 06 Dec 2010 11:29:31 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

--1129329158-1876622552-1291631371=:19637
Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8BIT

On Sat, 27 Nov 2010, 张亚霏 wrote:

> I compile the example/scp.c and scp_nonblock.c. The result is that 
> libssh2_scp_recv always fails with "Timed out waiting for SCP response". And 
> command "scp" with the same username/password/filename is ok.

What libssh2 version on what platform? What server software?

-- 

  / daniel.haxx.se
--1129329158-1876622552-1291631371=:19637
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-1876622552-1291631371=:19637--

From libssh2-devel-bounces@cool.haxx.se  Mon Dec  6 12:13:52 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB6BDiqP017350;
	Mon, 6 Dec 2010 12:13:51 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB6BDhWe017344
	for <libssh2-devel@cool.haxx.se>; Mon, 6 Dec 2010 12:13:43 +0100
Date: Mon, 6 Dec 2010 12:13:43 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: How to append to remote file?
In-Reply-To: <001d01cb8c25$acd5ea50$0681bef0$@com>
Message-ID: <alpine.DEB.2.00.1012061200220.631@tvnag.unkk.fr>
References: <001d01cb8c25$acd5ea50$0681bef0$@com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 06 Dec 2010 12:13:52 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 06 Dec 2010 12:13:43 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Wed, 24 Nov 2010, Mark Riordan wrote:

> I tried doing a libssh2_sftp_fstat_ex on the remote file to find its size, 
> then seeking to the end of the file using libssh2_sftp_seek64. But 
> libssh2_sftp_seek64 isn't a real seek.  In this case, it causes subsequent 
> calls to libssh2_sftp_write to write 0 bytes.
>
> Is there a real remote seek or append capability?

Each FXP_WRITE packet sent to the server includes the offset so there's no 
real seek operation needed.

I first tought the difference between WRITE and APPEND would be that APPEND 
would allow a client to write beyond the end of the file, but then I read the 
following from the spec:

    The write will extend the file if writing beyond the end of the file.
    It is legal to write way beyond the end of the file; the semantics
    are to write zeroes from the end of the file to the specified offset
    and then the data.  On most operating systems, such writes do not
    allocate disk space but instead leave "holes" in the file.

... so I don't really understand what APPEND is good for! ;-)

> At any rate, I eventually tried the LIBSSH2_FXF_APPEND approach and got the 
> same problem.
>
> I used a different SSH client to append a file to the same OpenSSH server 
> and it did work.

Ah, you mean you don't know _how_ it appended but it worked?

I don't see any specific handling for APPEND in the libssh2 code, so I really 
wonder if it ever worked. The spec says APPEND "Force all writes to append 
data at the end of the file." but since all packets include an offset and as 
libssh2 doesn't adjust that offset to force it beyond end of existing file I 
don't think it works correctly...

My gut reaction is that we should use APPEND only in the API and instead just 
use FXP_WRITE operations and put them at the end of file by will instead. 
Especially due to that comment about there being servers that don't adhere to 
APPEND anyway.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Mon Dec  6 16:57:05 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB6Fuj5A017292;
	Mon, 6 Dec 2010 16:57:02 +0100
Received: from imail.ipswitch.com (imail.ipswitch.com [156.21.1.5])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB6FufxM017204
	for <libssh2-devel@cool.haxx.se>; Mon, 6 Dec 2010 16:56:42 +0100
DKIM-Signature: q=dns/txt; v=1; c=relaxed/relaxed; s=ipswitch;
	d=ipswitch.com; a=rsa-sha1;
	h=From:To:References:In-Reply-To:Subject:Date:Message-ID:
	MIME-Version:Content-Type:Content-Transfer-Encoding;
	b=Xn1stPYq7RixVVkqpHZwuzy/f+1bOXSKXKH2aSJ6zoykixvXnaXPU6awfbeAfJmat9
	dMnU9+TbRd2Ikursej3mFTHZVCI2ZmqOrqNdRakFtFigTcrqfKMTD10aSgIDqoVEFsqU
	ChbpWMC4aFWpNW4GSNlUmx6LERnZ20raac1y4=;
	bh=WMSBt/8fuYigkHeQJYyM5MMRMYA=; t=1291650993;
Received: from mrrnt [66.170.5.130] by ipswitch.com with ESMTP
	(SMTPD-11.03) id c928001a5bf6c325; Mon, 6 Dec 2010 10:56:33 -0500
From: "Mark Riordan" <mriordan@ipswitch.com>
To: "'libssh2 development'" <libssh2-devel@cool.haxx.se>
References: <001d01cb8c25$acd5ea50$0681bef0$@com>
	<alpine.DEB.2.00.1012061200220.631@tvnag.unkk.fr>
In-Reply-To: <alpine.DEB.2.00.1012061200220.631@tvnag.unkk.fr>
Subject: RE: How to append to remote file?
Date: Mon, 6 Dec 2010 09:56:33 -0600
Message-ID: <001801cb955e$27a350b0$76e9f210$@com>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AcuVNsloMcGR+TwHSFaoxu8C3PoQHAAJsciA
Content-Language: en-us
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 06 Dec 2010 16:57:05 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 06 Dec 2010 16:56:43 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

>> Is there a real remote seek or append capability?
>
> Each FXP_WRITE packet sent to the server includes the offset
> so there's no real seek operation needed.

I should have explained that I use this to resume upload
or download operations after a session has been unexpectedly
disconnected.  So, I reconnect and then try to "seek" to
where I had left off.  Of course, there is no real seek involved
in SSH, but I would like the ability to set the file offset
to something other than zero at the beginning of a transfer.
This, of course, would affect the embedded file offsets in 
subsequent write or read operations.

Mark


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

From libssh2-devel-bounces@cool.haxx.se  Mon Dec  6 20:53:18 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB6Jqx5X026014;
	Mon, 6 Dec 2010 20:53:14 +0100
Received: from imail.ipswitch.com (imail.ipswitch.com [156.21.1.5])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB6JqtQ3025995
	for <libssh2-devel@cool.haxx.se>; Mon, 6 Dec 2010 20:52:56 +0100
DKIM-Signature: q=dns/txt; v=1; c=relaxed/relaxed; s=ipswitch;
	d=ipswitch.com; a=rsa-sha1;
	h=From:To:References:In-Reply-To:Subject:Date:Message-ID:
	MIME-Version:Content-Type:Content-Transfer-Encoding;
	b=msjTJpu5Ijwst+urAsNUu1aH+2U57cEZ246P6tX6EKKW9RveokLT7l3HLT8n5ptOBs
	OadzfYAzodVxkYj2/l0FvTsaxMmjiqMZamjQ5G4VsW2lmdM/O8BXLYTSc6Qpmgn4Txlm
	B2ApIB4+pydjrgrSrtSb+eZ7C80bxQs+wFGDI=;
	bh=XyAYNOKmfNpc/ClpRTl9JcOQ+CM=; t=1291665166;
Received: from mrrnt [66.170.5.130] by ipswitch.com with ESMTP
	(SMTPD-11.03) id 6c40001aacd0cb97; Mon, 6 Dec 2010 14:52:46 -0500
From: "Mark Riordan" <mriordan@ipswitch.com>
To: "'libssh2 development'" <libssh2-devel@cool.haxx.se>
References: <alpine.DEB.2.00.1012042339500.27009@tvnag.unkk.fr>
	<alpine.DEB.2.00.1012060010400.19637@tvnag.unkk.fr>
In-Reply-To: <alpine.DEB.2.00.1012060010400.19637@tvnag.unkk.fr>
Subject: RE: SFTP upload speed
Date: Mon, 6 Dec 2010 13:52:46 -0600
Message-ID: <003601cb957f$27b2de10$77189a30$@com>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AcuU0zIdV6dxuxWhS32sgSBbxhVb5gAqlsSQ
Content-Language: en-us
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 06 Dec 2010 20:53:18 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 06 Dec 2010 20:52:57 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Daniel said:
> I showed that to make the same app reach really good speeds, I need to do
a 
> little code tweak and change MAX_SFTP_OUTGOING_SIZE from 4000 to 30000. 

I tweaked that macro in sftp.h, and increased the upload buffer size
in my test program to 1 MB.  Even without the sliding buffers, 
for the LAN test, now libssh2 has the fastest upload performance 
of all tested packages!
I'm getting 22 MB/sec uploading from Windows to Ubuntu OpenSSH server.

I tried increasing my app's buffer size before, and it didn't make any
difference.  I now see that I wasn't aggressive enough.

I'm looking forward to testing this over the WAN link I've been using
at home.  (The WAN link at work is somewhat unpredictable due to
use by colleagues).

Mark



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

From libssh2-devel-bounces@cool.haxx.se  Mon Dec  6 22:18:48 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB6LIWoP018996;
	Mon, 6 Dec 2010 22:18:47 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB6LIVZm018977
	for <libssh2-devel@cool.haxx.se>; Mon, 6 Dec 2010 22:18:31 +0100
Date: Mon, 6 Dec 2010 22:18:31 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: RE: How to append to remote file?
In-Reply-To: <001801cb955e$27a350b0$76e9f210$@com>
Message-ID: <alpine.DEB.2.00.1012062217090.4463@tvnag.unkk.fr>
References: <001d01cb8c25$acd5ea50$0681bef0$@com>
	<alpine.DEB.2.00.1012061200220.631@tvnag.unkk.fr>
	<001801cb955e$27a350b0$76e9f210$@com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 06 Dec 2010 22:18:48 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 06 Dec 2010 22:18:31 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Mon, 6 Dec 2010, Mark Riordan wrote:

> I should have explained that I use this to resume upload or download 
> operations after a session has been unexpectedly disconnected.

Are you working with the git version or with 1.2.7? I believe I may have 
destroyed the ability to seek and then write() in git when I implmented the 
pipelined writes.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Mon Dec  6 22:57:00 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB6LuoWB017187;
	Mon, 6 Dec 2010 22:56:59 +0100
Received: from imail.ipswitch.com (imail.ipswitch.com [156.21.1.5])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB6Lum4r017117
	for <libssh2-devel@cool.haxx.se>; Mon, 6 Dec 2010 22:56:49 +0100
DKIM-Signature: q=dns/txt; v=1; c=relaxed/relaxed; s=ipswitch;
	d=ipswitch.com; a=rsa-sha1;
	h=From:To:References:In-Reply-To:Subject:Date:Message-ID:
	MIME-Version:Content-Type:Content-Transfer-Encoding;
	b=oxtFjXUhU7v0/Bav+hQZiTeyhzExmPdkHpjjvg8K9gBhVJ4yd3C0OC+qKNMXiACXDb
	ypspHehGrjJZc5gfW0mHYScSTe8psZJ8ZeZDaDjJW0FzmW8Q+adxlp7M4HGiLu/OGd55
	h7pY74OIhCZwoBcxR/Dk+FFKbR83cD724Jhc8=;
	bh=K2sGTfYB9XMh8wv8UIoQ1MgEKQ8=; t=1291672599;
Received: from mrrnt [66.170.5.130] by ipswitch.com with ESMTP
	(SMTPD-11.03) id 7aa0001ad193cf94; Mon, 6 Dec 2010 16:56:38 -0500
From: "Mark Riordan" <mriordan@ipswitch.com>
To: "'libssh2 development'" <libssh2-devel@cool.haxx.se>
References: <001d01cb8c25$acd5ea50$0681bef0$@com>	<alpine.DEB.2.00.1012061200220.631@tvnag.unkk.fr>	<001801cb955e$27a350b0$76e9f210$@com>
	<alpine.DEB.2.00.1012062217090.4463@tvnag.unkk.fr>
In-Reply-To: <alpine.DEB.2.00.1012062217090.4463@tvnag.unkk.fr>
Subject: RE: How to append to remote file?
Date: Mon, 6 Dec 2010 15:56:38 -0600
Message-ID: <004401cb9590$75c95870$615c0950$@com>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AcuVi2D3tUJKlQFERXO5OPJecSQKjwABPeDw
Content-Language: en-us
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 06 Dec 2010 22:57:00 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 06 Dec 2010 22:56:49 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

> Are you working with the git version or with 1.2.7? 
> I believe I may have destroyed the ability to seek 
> and then write() in git when I implmented the pipelined writes.

That's the git version.

Mark


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

From libssh2-devel-bounces@cool.haxx.se  Tue Dec  7 08:34:25 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB77Y5hU016483;
	Tue, 7 Dec 2010 08:34:21 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB77Y4tv016479
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 7 Dec 2010 08:34:05 +0100
Received: (qmail 28738 invoked from network); 7 Dec 2010 07:34:04 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 7 Dec 2010 07:34:04 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Tue, 07 Dec 2010 07:34:04 -0000
X-URL: http://trac.libssh2.org/
Subject: [libssh2] #201: Can't connect using private/public key
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/201
Message-ID: <048.e01a7a303b0678d78167ccf0ab2db08e@libssh2.stuge.se>
X-Trac-Ticket-ID: 201
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 07 Dec 2010 08:34:25 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 07 Dec 2010 08:34:05 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#201: Can't connect using private/public key
---------------------------+------------------------------------------------
  Reporter:  rajendraelan  |       Owner:       
      Type:  build error   |      Status:  new  
  Priority:  high          |   Milestone:  1.2.8
 Component:  API           |     Version:  1.2.6
  Keywords:                |      Blocks:       
Blocked By:                |  
---------------------------+------------------------------------------------
 We are working on one iPhone application on which we need to use SSH
 integration. We have also tried to connect SSH instance having password,
 but we can't get how to connect the instance having keys authentication as
 instance having private key and public key. Actually we want to connect
 Amazon webserver instance using key authentication.

 So can you please provide us some more details how to connect it? Also it
 would be better if you will provide us any sample source code, so we can
 get better understanding.

 We can connect the AWS instance via MAC terminal using command.But
 unfortunately, we can't connect using Xcode.

-- 
Ticket URL: <http://trac.libssh2.org/ticket/201>
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 Dec  7 08:35:40 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB77ZaFh017547;
	Tue, 7 Dec 2010 08:35:38 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB77ZYSi017529
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 7 Dec 2010 08:35:34 +0100
Received: (qmail 28921 invoked from network); 7 Dec 2010 07:35:33 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 7 Dec 2010 07:35:33 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Tue, 07 Dec 2010 07:35:33 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #201: Can't connect using private/public key
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/201#comment:1
Message-ID: <063.44441a3f69e6939baddc0d40778cb685@libssh2.stuge.se>
References: <048.e01a7a303b0678d78167ccf0ab2db08e@libssh2.stuge.se>
X-Trac-Ticket-ID: 201
In-Reply-To: <048.e01a7a303b0678d78167ccf0ab2db08e@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 07 Dec 2010 08:35:40 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 07 Dec 2010 08:35:34 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#201: Can't connect using private/public key
---------------------------+------------------------------------------------
  Reporter:  rajendraelan  |        Owner:        
      Type:  build error   |       Status:  closed
  Priority:  high          |    Milestone:  1.2.8 
 Component:  API           |      Version:  1.2.6 
Resolution:  invalid       |     Keywords:        
    Blocks:                |   Blocked By:        
---------------------------+------------------------------------------------
Changes (by bagder):

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


Comment:

 If you need help or have questions, use the mailing list.

 This is not a bug afaics so I'm closing it.

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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec  8 11:07:20 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oB8A704q024577;
	Wed, 8 Dec 2010 11:07:16 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oB8A6x6w024570
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 8 Dec 2010 11:06:59 +0100
Received: (qmail 28196 invoked from network); 8 Dec 2010 10:06:54 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 8 Dec 2010 10:06:54 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Wed, 08 Dec 2010 10:06:54 -0000
X-URL: http://trac.libssh2.org/
Subject: [libssh2] #202: SFTP: broken seek + write/append
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/202
Message-ID: <042.dabf260c077547cd41e23e7369c439e4@libssh2.stuge.se>
X-Trac-Ticket-ID: 202
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 08 Dec 2010 11:07:20 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 08 Dec 2010 11:06:59 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#202: SFTP: broken seek + write/append
---------------------+------------------------------------------------------
  Reporter:  bagder  |       Owner:  bagder
      Type:  defect  |      Status:  new   
  Priority:  normal  |   Milestone:  1.2.8 
 Component:  SFTP    |     Version:        
  Keywords:          |      Blocks:        
Blocked By:          |  
---------------------+------------------------------------------------------
 Mark Riordan reported problems to do append with SFTP:

 http://www.libssh2.org/mail/libssh2-devel-archive-2010-11/0131.shtml

 A write beyond the end of a file should append data. I believe the current
 git code (8 dec 2010) doesn't quite work since the seeking and the new
 SFTP upload code doesn't combine well.

 Needs to be looked at

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

From libssh2-devel-bounces@cool.haxx.se  Fri Dec 10 15:07:02 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBAE6YK0026722;
	Fri, 10 Dec 2010 15:06:57 +0100
Received: from srv-mail.mtl.proksim.com (mail.quazal.com [64.254.252.195])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBAE6WAh026706
	for <libssh2-devel@cool.haxx.se>; Fri, 10 Dec 2010 15:06:33 +0100
X-MimeOLE: Produced By Microsoft Exchange V6.5
Content-class: urn:content-classes:message
MIME-Version: 1.0
Subject: Memory leaks in libssh2
Date: Fri, 10 Dec 2010 09:10:03 -0500
Message-ID: <E20CD87399FB894FBF542A240E63A2800477AA46@srv-mail.mtl.proksim.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Memory leaks in libssh2
Thread-Index: AcuYc/DOdaONDpp1R/exxA+y7aHELw==
From: "Philippe Lemoine" <plemoine@quazal.com>
To: <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Fri, 10 Dec 2010 15:07:02 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Fri, 10 Dec 2010 15:06:34 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0914107713=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

This is a multi-part message in MIME format.

--===============0914107713==
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01CB9873.7108D564"

This is a multi-part message in MIME format.

------_=_NextPart_001_01CB9873.7108D564
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

=20

Hello, I just want to report fixes that I have done in the lib. This
email address has been provided by Daniel Stenberg.

=20

=20

=20

Currently, we are using 1.2.4 but even though I compared the sources
with the newest release - 1.2.7 - I did not see those fixes there.

=20

=20

=20

In the files I am forwarding you, there are comments marked as < QUAZAL
>, which indicate the modifications. The reason of those fixes were to
handle properly connection termination in case of an unexpected socket
error.

=20

=20

=20

Best regards

=20

Philippe

=20

=20

NOTE that those changes are made against files from version 1.2.4. If it
would help, I can provide you the modified files.

=20

---- transport.c -------------------------

=20

Index: transport.c

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

RCS file: \devenv\CVSROOT/jade/Tools/libssh2/transport.c,v

retrieving revision 1.1.4.7

retrieving revision 1.1.4.8

diff -r1.1.4.7 -r1.1.4.8

833c833,839

<
&session->local.crypt_abstract))

---

>
&session->local.crypt_abstract))  {

>=20

>                 //  QUAZAL ADDED BEGIN

>                 //  bug:6144: Extra cleanup added, in case of failure

>                 LIBSSH2_FREE(session, p->outbuf);

>                 p->outbuf =3D NULL;

>                 //  QUAZAL ADDED END

834a841

>             }

861a869,873

>         //  QUAZAL ADDED BEGIN

>         //  bug:6144: Extra cleanup added, in case of failure

>         LIBSSH2_FREE(session, p->outbuf);

>         p->outbuf =3D NULL;

>         //  QUAZAL ADDED END

=20

=20

=20

---- sftp.c -------------------------

=20

Index: sftp.c

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

RCS file: \devenv\CVSROOT/jade/Tools/libssh2/sftp.c,v

retrieving revision 1.1.4.4

retrieving revision 1.1.4.5

diff -r1.1.4.4 -r1.1.4.5

44a45,49

> //  QUAZAL ADDED BEGIN

> #include "libssh2_qtrace.h"

> //  QUAZAL ADDED END

>=20

>=20

90a96

>=20

531c537

<=20

---

>=20

605a612

>=20

790a798

>=20

953a962

>=20

1700a1710,1713

> //  QUAZAL ADDED BEGIN

> //  bug:6144 Missing cleanup from original lib

>             LIBSSH2_FREE(session, handle);

> //  QUAZAL ADDED END

1728a1742,1745

> //  QUAZAL ADDED BEGIN

> //  bug:6144 Missing cleanup from original lib

>             LIBSSH2_FREE(session, handle);

> //  QUAZAL ADDED END

1746a1764,1767

> //  QUAZAL ADDED BEGIN

> //  bug:6144 Missing cleanup from original lib

>             LIBSSH2_FREE(session, handle);

> //  QUAZAL ADDED END

1760a1782,1785

> //  QUAZAL ADDED BEGIN

> //  bug:6144 Missing cleanup from original lib

>         LIBSSH2_FREE(session, handle);

> //  QUAZAL ADDED END

1777a1803

>=20

=20

=20

---- channel.c -------------------------

=20

Index: channel.c

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

RCS file: \devenv\CVSROOT/jade/Tools/libssh2/channel.c,v

retrieving revision 1.1.4.5

retrieving revision 1.1.4.6

diff -r1.1.4.5 -r1.1.4.6

52a53,57

> //  QUAZAL ADDED BEGIN

> #include "libssh2_qtrace.h"

> //  QUAZAL ADDED END

>=20

>=20

156a162

>=20

2024c2030

<=20

---

>=20

2240c2246

<=20

---

>=20

2266c2272,2275

<             return retcode;

---

> // QUAZAL MODIFIED BEGIN

> //  bug:6144: returning here cut off necessary cleanup, which causes
leaks.

> //            return retcode;

> // QUAZAL MODIFIED END

2290c2299

<=20

---

>=20

2405c2414,2418

<             return rc;

---

>=20

> // QUAZAL MODIFIED BEGIN

> //  bug:6144: returning here cut off necessary cleanup, which causes
leaks.

> //            return rc;

> // QUAZAL MODIFIED END

=20

=20

=20

Philippe Lemoine

<mailto:plemoine@quazal.com> plemoine@quazal.com

Senior Software Designer

Quazal Technologies Inc.
555 Rene-Levesque West
Suite 1800
Montreal, Quebec, Canada
H2Z 1B1
Phone: 514-395-4646
Fax: 514-395-6006

=20


------_=_NextPart_001_01CB9873.7108D564
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
 name=3D"PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:Arial;
	color:windowtext;}
@page Section1
	{size:612.0pt 792.0pt;
	margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
	{page:Section1;}
-->
</style>

</head>

<body lang=3DFR-CA link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Hello, I just want to report fixes that I have done =
in the
lib. This email address has been provided by Daniel =
Stenberg.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>&nbsp;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Currently, we are using 1.2.4 but even though I =
compared the
sources with the newest release &#8211; 1.2.7 &#8211; I did not see =
those fixes
there.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>&nbsp;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>In the files I am forwarding you, there are comments =
marked
as &laquo; QUAZAL &raquo;, which indicate the modifications. The reason =
of those fixes were
to handle properly connection termination in case of an unexpected =
socket
error.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>&nbsp;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Best regards<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Philippe<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>NOTE that those changes are made against files from =
version
1.2.4. If it would help, I can provide you the modified =
files.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>&nbsp;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>---- transport.c =
-------------------------<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>Index: =
transport.c<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<o:p></o:p></spa=
n></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>RCS file:
\devenv\CVSROOT/jade/Tools/libssh2/transport.c,v<o:p></o:p></span></font>=
</p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>retrieving revision =
1.1.4.7<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>retrieving revision =
1.1.4.8<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>diff -r1.1.4.7 =
-r1.1.4.8<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>833c833,839<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&amp;session-&gt;local.crypt_abstract))<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>---<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&gt;&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&am=
p;session-&gt;local.crypt_abstract))&nbsp;
{<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; QUAZAL ADDED =
BEGIN<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; bug:6144: Extra cleanup
added, in case of failure<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LIBSSH2_FREE(session,
p-&gt;outbuf);<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;p-&gt;outbuf =3D =
NULL;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; QUAZAL ADDED =
END<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>834a841<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; }<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>861a869,873<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; =
QUAZAL ADDED BEGIN<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; =
bug:6144: Extra cleanup added, in
case of failure<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
LIBSSH2_FREE(session, p-&gt;outbuf);<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p-&gt;outbuf =
=3D NULL;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; =
QUAZAL ADDED END<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>---- sftp.c =
-------------------------<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>Index: sftp.c<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<o:p></o:p></spa=
n></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>RCS file:
\devenv\CVSROOT/jade/Tools/libssh2/sftp.c,v<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>retrieving revision =
1.1.4.4<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>retrieving revision =
1.1.4.5<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>diff -r1.1.4.4 =
-r1.1.4.5<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>44a45,49<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; QUAZAL ADDED =
BEGIN<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; #include =
&quot;libssh2_qtrace.h&quot;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; QUAZAL ADDED =
END<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>90a96<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>531c537<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&lt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>---<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>605a612<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>790a798<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>953a962<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>1700a1710,1713<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; QUAZAL ADDED =
BEGIN<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; bug:6144 Missing cleanup from =
original lib<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; LIBSSH2_FREE(session, handle);<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; QUAZAL ADDED =
END<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>1728a1742,1745<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; QUAZAL ADDED =
BEGIN<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; bug:6144 Missing cleanup from =
original lib<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; LIBSSH2_FREE(session, handle);<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; // &nbsp;QUAZAL ADDED =
END<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>1746a1764,1767<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; QUAZAL ADDED =
BEGIN<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; bug:6144 Missing cleanup from =
original lib<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; LIBSSH2_FREE(session, handle);<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; QUAZAL ADDED =
END<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>1760a1782,1785<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; QUAZAL ADDED =
BEGIN<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; bug:6144 Missing cleanup from =
original lib<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
LIBSSH2_FREE(session, handle);<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; QUAZAL ADDED =
END<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>1777a1803<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>---- channel.c =
-------------------------<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>Index: channel.c<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D<o:p></o:p></spa=
n></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>RCS file:
\devenv\CVSROOT/jade/Tools/libssh2/channel.c,v<o:p></o:p></span></font></=
p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>retrieving revision =
1.1.4.5<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>retrieving revision =
1.1.4.6<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>diff -r1.1.4.5 =
-r1.1.4.6<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>52a53,57<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; QUAZAL ADDED =
BEGIN<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; #include =
&quot;libssh2_qtrace.h&quot;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; QUAZAL ADDED =
END<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>156a162<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>2024c2030<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&lt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>---<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>2240c2246<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&lt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>---<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>2266c2272,2275<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; return retcode;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>---<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; // QUAZAL MODIFIED =
BEGIN<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; bug:6144: returning here cut =
off necessary
cleanup, which causes leaks.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; =
//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
return retcode;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; // QUAZAL MODIFIED =
END<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>2290c2299<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&lt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>---<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>2405c2414,2418<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New"'>&lt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; return rc;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>---<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; // QUAZAL MODIFIED =
BEGIN<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; //&nbsp; bug:6144: returning here cut =
off necessary
cleanup, which causes leaks.<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; =
//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
return rc;<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span =
style=3D'font-size:10.0pt;
font-family:"Courier New"'>&gt; // QUAZAL MODIFIED =
END<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><st1:PersonName w:st=3D"on"><font size=3D2 =
face=3DArial><span
 style=3D'font-size:10.0pt;font-family:Arial'>Philippe =
Lemoine</span></font></st1:PersonName><o:p></o:p></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><a href=3D"mailto:plemoine@quazal.com"></a></span></font><font =
size=3D2
face=3DArial><span style=3D'font-size:10.0pt;font-family:Arial'><a
href=3D"mailto:plemoine@quazal.com">plemoine@quazal.com</a></span></font>=
<o:p></o:p></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Senior Software Designer</span></font><o:p></o:p></p>

<p class=3DMsoNormal><st1:PersonName w:st=3D"on"><font size=3D2 =
face=3DArial><span
 style=3D'font-size:10.0pt;font-family:Arial'>Quazal Technologies =
Inc.</span></font></st1:PersonName><br>
<font color=3D"#333333"><span style=3D'color:#333333'>555 Rene-Levesque =
West<br>
Suite 1800<br>
Montreal, Quebec, Canada<br>
H2Z 1B1<br>
Phone: 514-395-4646<br>
Fax: 514-395-6006</span></font><o:p></o:p></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span =
style=3D'font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>

------_=_NextPart_001_01CB9873.7108D564--

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

--===============0914107713==--

From libssh2-devel-bounces@cool.haxx.se  Fri Dec 10 15:18:27 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBAEIKPZ031439;
	Fri, 10 Dec 2010 15:18:26 +0100
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBAEIJ07031424
	for <libssh2-devel@cool.haxx.se>; Fri, 10 Dec 2010 15:18:19 +0100
Received: by qwj9 with SMTP id 9so4270173qwj.41
	for <libssh2-devel@cool.haxx.se>; Fri, 10 Dec 2010 06:18:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type;
	bh=c7Ct9RsCNO7fJBHjV+dJCDn8TkRRa/sTwT0iq4ppUrY=;
	b=NUU30/fKoQdym1HppuXiJnu6Zz95Z+l28CpkAhc6xci6hVMjZfp6UzOsUXokcoa1EE
	7pxgtyhTwaL6+3LvNPTtkNAZpFN/BNfgOrVJMrvbBEr5wy3/Yb2wuucck/ougjISTzGr
	n80qNpZJEggcHxGrpTKl+XaFSXK5VHQHYakFY=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	b=OugqSiIuackY+IzWI7Df4xYeqJ50VcWGVbMT+4so6khQtADZ975pr9eHlf+E7R9DpO
	KYuta6Bz0AbeafSAi/ShLOdQW/Z0gZ3CSYoVBVHBCxriqENfXEEKhtjwjqmIEwXtV+X5
	aTfixTkyOdunrfrtGyF2q69sRAkqy0fbAUQFs=
MIME-Version: 1.0
Received: by 10.229.192.195 with SMTP id dr3mr714731qcb.208.1291990691938;
	Fri, 10 Dec 2010 06:18:11 -0800 (PST)
Received: by 10.229.80.6 with HTTP; Fri, 10 Dec 2010 06:18:11 -0800 (PST)
In-Reply-To: <E20CD87399FB894FBF542A240E63A2800477AA46@srv-mail.mtl.proksim.com>
References: <E20CD87399FB894FBF542A240E63A2800477AA46@srv-mail.mtl.proksim.com>
Date: Fri, 10 Dec 2010 15:18:11 +0100
X-Google-Sender-Auth: vQkcrQkrUzG3T-9WrcrRRxjhrUI
Message-ID: <AANLkTim4+5JEnoujLPFHM55uSk=use6RtTdBdWppfXbu@mail.gmail.com>
Subject: Re: Memory leaks in libssh2
From: Tor Arntsen <tor@spacetec.no>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Fri, 10 Dec 2010 15:18:26 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Fri, 10 Dec 2010 15:18:20 +0100 (CET)
Cc: Philippe Lemoine <plemoine@quazal.com>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Fri, Dec 10, 2010 at 15:10, Philippe Lemoine <plemoine@quazal.com> wrote:

>
> RCS file: \devenv\CVSROOT/jade/Tools/libssh2/transport.c,v

> <
> &session->local.crypt_abstract))
>
> ---
>
>>

Please use diff -u, i.e. unified context. Otherwise it will be
impossible to apply the patches if the sources have changed just one
line.

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

From libssh2-devel-bounces@cool.haxx.se  Fri Dec 10 21:34:57 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBAKYZX0002209;
	Fri, 10 Dec 2010 21:34:52 +0100
Received: from mail-ew0-f52.google.com (mail-ew0-f52.google.com
	[209.85.215.52])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBAKYYxc002184
	for <libssh2-devel@cool.haxx.se>; Fri, 10 Dec 2010 21:34:34 +0100
Received: by ewy23 with SMTP id 23so3121205ewy.11
	for <libssh2-devel@cool.haxx.se>; Fri, 10 Dec 2010 12:34:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:mime-version:received:from:date
	:message-id:subject:to:content-type:content-transfer-encoding;
	bh=wvdRvZh/GC01VYre4WkyP0+AsQY2FHpiYwb9RRLZpSk=;
	b=pYnzolUrPxnbulL5WXF0KBJHPVScYv96XjOFLWjXJ+tOWnvvwYsvlUXpdpsJOQtYe9
	5TOoH2jDZ51gcKkE/Ab8mAEja1DML7W//k7gLQx1ZkyVS8LBDRTzMfuVcuyk7dbi5LQ+
	Un9oSRyC0xLMLNQCJXqycBNbHjTTPM88GKY/0=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:from:date:message-id:subject:to:content-type
	:content-transfer-encoding;
	b=oZDAvmXpF/XTd0AG9/gTryFba8PriKknFFIlu1vROr5AKazmL10VVlxJrrb0D126U9
	miaP27rcOCeg4vdSkhCiSv6tpIGR/a44dbxSPmfGMdr/RVxJwcW4UZ9w2m4mlR3TL9AI
	/up/AoycjMfJBp7vPqk515hOdYKhEpkHxxEfE=
Received: by 10.213.19.6 with SMTP id y6mr29330eba.18.1292013271044; Fri, 10
	Dec 2010 12:34:31 -0800 (PST)
MIME-Version: 1.0
Received: by 10.213.2.139 with HTTP; Fri, 10 Dec 2010 12:34:10 -0800 (PST)
From: Luis Lavena <luislavena@gmail.com>
Date: Fri, 10 Dec 2010 17:34:10 -0300
Message-ID: <AANLkTi=E+FZW+C1N875H9-zgKyXK7fKd77DmgyttHQ+f@mail.gmail.com>
Subject: Compile error in examples under MinGW
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Fri, 10 Dec 2010 21:34:57 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Fri, 10 Dec 2010 21:34:34 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hello,

I'm trying to compile latest snapshot (libssh2-1.2.8-20101210.tar.gz)
using GCC 4.5.1 (TDM release) on Windows 7 x64.

Configure works as expected and the library compile mostly without
warnings (except one for libz.a)

Anyhow, there is a problem compiling examples:

make[2]: Entering directory
`/c/Users/Luis/Projects/oss/oci/rubyinstaller/sandbox/src-libssh2/example'
if gcc -DHAVE_CONFIG_H   -I../include -I../example   -DLIBSSH2_WIN32
-DWINSOCK_VERSION=3D0x0200 -MT direct_tcpip.o -MD -MP -MF
".deps/direct_tcpip.Tpo" -c -o direct_tcpip.o direct_tcpip.c; \
        then mv -f ".deps/direct_tcpip.Tpo" ".deps/direct_tcpip.Po";
else rm -f ".deps/direct_tcpip.Tpo"; exit 1; fi
In file included from direct_tcpip.c:2:0:
../include/libssh2.h:134:16: error: expected '=3D', ',', ';', 'asm' or
'__attribute__' before 'libssh2_socket_t'
../include/libssh2.h:447:43: error: expected declaration specifiers or
'...' before 'libssh2_socket_t'
make[2]: *** [direct_tcpip.o] Error 1
make[2]: Leaving directory
`/c/Users/Luis/Projects/oss/oci/rubyinstaller/sandbox/src-libssh2/example'
make[1]: *** [all] Error 2
make[1]: Leaving directory
`/c/Users/Luis/Projects/oss/oci/rubyinstaller/sandbox/src-libssh2/example'
make: *** [all-recursive] Error 1

Anyone seen this too?

I cannot use code from git directly as my dev environment lacks libtoolize.

Thank you in advance,
-- =

Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exup=E9ry
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Sat Dec 11 00:06:00 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBAN5jcY000828;
	Sat, 11 Dec 2010 00:05:58 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBAN5he9000804
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Sat, 11 Dec 2010 00:05:43 +0100
Received: (qmail 2367 invoked from network); 10 Dec 2010 23:05:39 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 10 Dec 2010 23:05:39 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Fri, 10 Dec 2010 23:05:39 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #202: SFTP: broken seek + write/append
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/202#comment:1
Message-ID: <057.34a60e7e31a01adadf3a0f9c539b097c@libssh2.stuge.se>
References: <042.dabf260c077547cd41e23e7369c439e4@libssh2.stuge.se>
X-Trac-Ticket-ID: 202
In-Reply-To: <042.dabf260c077547cd41e23e7369c439e4@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sat, 11 Dec 2010 00:06:00 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sat, 11 Dec 2010 00:05:43 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#202: SFTP: broken seek + write/append
---------------------+------------------------------------------------------
  Reporter:  bagder  |        Owner:  bagder
      Type:  defect  |       Status:  closed
  Priority:  normal  |    Milestone:  1.2.8 
 Component:  SFTP    |      Version:        
Resolution:  fixed   |     Keywords:        
    Blocks:          |   Blocked By:        
---------------------+------------------------------------------------------
Changes (by bagder):

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


Comment:

 fixed in commit 0cc14be09dbd388edb7816f70b1a9dbfea2277d1

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

From libssh2-devel-bounces@cool.haxx.se  Sat Dec 11 00:07:03 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBAN71Ud001461;
	Sat, 11 Dec 2010 00:07:02 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBAN70NR001441
	for <libssh2-devel@cool.haxx.se>; Sat, 11 Dec 2010 00:07:00 +0100
Date: Sat, 11 Dec 2010 00:07:00 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: RE: How to append to remote file?
In-Reply-To: <004401cb9590$75c95870$615c0950$@com>
Message-ID: <alpine.DEB.2.00.1012110006160.12747@tvnag.unkk.fr>
References: <001d01cb8c25$acd5ea50$0681bef0$@com>
	<alpine.DEB.2.00.1012061200220.631@tvnag.unkk.fr>
	<001801cb955e$27a350b0$76e9f210$@com>
	<alpine.DEB.2.00.1012062217090.4463@tvnag.unkk.fr>
	<004401cb9590$75c95870$615c0950$@com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sat, 11 Dec 2010 00:07:02 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sat, 11 Dec 2010 00:07:00 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Mon, 6 Dec 2010, Mark Riordan wrote:

>> Are you working with the git version or with 1.2.7? I believe I may have 
>> destroyed the ability to seek and then write() in git when I implmented the 
>> pipelined writes.
>
> That's the git version.

Thanks. I added a new example that does SFTP append to a remote file (quite 
similar to your test app) and then I fixed the bug and pushed that commit just 
now...

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Sat Dec 11 00:10:24 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBANAMkL003925;
	Sat, 11 Dec 2010 00:10:23 +0100
Received: from imail.ipswitch.com (imail.ipswitch.com [156.21.1.5])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBANAJ9t003848
	for <libssh2-devel@cool.haxx.se>; Sat, 11 Dec 2010 00:10:20 +0100
DKIM-Signature: q=dns/txt; v=1; c=relaxed/relaxed; s=ipswitch;
	d=ipswitch.com; a=rsa-sha1;
	h=From:To:References:In-Reply-To:Subject:Date:Message-ID:
	MIME-Version:Content-Type:Content-Transfer-Encoding;
	b=ZkLJcctU2vhmiTDLYZbQvAPmbQn6eazMjUR22ZhGazfUKr6858V3HlMjHMVSLryc6e
	T53js634lr3QYGstbG/IzBw6QxU98UsUglBiH3ezEkNPRGb1C5RumcMQLtqoSGG/I63M
	HTFrp1BZ/LjAGcQkc9YmhQhFQstGVS0NTJo6s=;
	bh=r0nzAeOhNx3CKW4QRWEbG6a5s7c=; t=1292022609;
Received: from mrrnt [66.170.5.130] by ipswitch.com with ESMTP
	(SMTPD-11.03) id cf4800229d3428f9; Fri, 10 Dec 2010 18:10:07 -0500
From: "Mark Riordan" <mriordan@ipswitch.com>
To: "'libssh2 development'" <libssh2-devel@cool.haxx.se>
References: <001d01cb8c25$acd5ea50$0681bef0$@com>	<alpine.DEB.2.00.1012061200220.631@tvnag.unkk.fr>	<001801cb955e$27a350b0$76e9f210$@com>	<alpine.DEB.2.00.1012062217090.4463@tvnag.unkk.fr>	<004401cb9590$75c95870$615c0950$@com>
	<alpine.DEB.2.00.1012110006160.12747@tvnag.unkk.fr>
In-Reply-To: <alpine.DEB.2.00.1012110006160.12747@tvnag.unkk.fr>
Subject: RE: How to append to remote file?
Date: Fri, 10 Dec 2010 17:10:07 -0600
Message-ID: <000b01cb98bf$63428370$29c78a50$@com>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AcuYvxIZfv+V2ThvS2uwBLIwpEOv/gAADgYw
Content-Language: en-us
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sat, 11 Dec 2010 00:10:24 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sat, 11 Dec 2010 00:10:20 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

> Thanks. I added a new example that does SFTP append to 
> a remote file (quite similar to your test app) and then 
> I fixed the bug and pushed that commit just now...

Cool - thanks!

/mrr


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

From libssh2-devel-bounces@cool.haxx.se  Sat Dec 11 00:20:16 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBANKC7T008581;
	Sat, 11 Dec 2010 00:20:16 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBANKBxu008518
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Sat, 11 Dec 2010 00:20:11 +0100
Received: (qmail 3894 invoked from network); 10 Dec 2010 23:20:07 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 10 Dec 2010 23:20:07 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Fri, 10 Dec 2010 23:20:07 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #198: _libssh2_channel_close() may hang
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/198#comment:4
Message-ID: <055.6de9f2e659b0e3baa539bbd7a49ea9a6@libssh2.stuge.se>
References: <040.f267185fd189c3163b83597a7e73540d@libssh2.stuge.se>
X-Trac-Ticket-ID: 198
In-Reply-To: <040.f267185fd189c3163b83597a7e73540d@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sat, 11 Dec 2010 00:20:16 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sat, 11 Dec 2010 00:20:11 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

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


Comment:

 What about this patch:

 {{{
 diff --git a/src/channel.c b/src/channel.c
 index ff1fb4d..efe95e6 100644
 --- a/src/channel.c
 +++ b/src/channel.c
 @@ -2304,9 +2304,9 @@ int _libssh2_channel_close(LIBSSH2_CHANNEL *
 channel)
      if (channel->close_state == libssh2_NB_state_sent) {
          /* We must wait for the remote SSH_MSG_CHANNEL_CLOSE message */

 -        while (!channel->remote.close && !rc) {
 +        while (!channel->remote.close && !rc &&
 +               (session->socket_state != LIBSSH2_SOCKET_DISCONNECTED))
              rc = _libssh2_transport_read(session);
 -        }
      }

      if(rc != LIBSSH2_ERROR_EAGAIN) {

 }}}

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

From libssh2-devel-bounces@cool.haxx.se  Sat Dec 11 19:15:59 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBBIEVlw029149;
	Sat, 11 Dec 2010 19:15:54 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBBIEUqW029136
	for <libssh2-devel@cool.haxx.se>; Sat, 11 Dec 2010 19:14:30 +0100
Date: Sat, 11 Dec 2010 19:14:30 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Compile error in examples under MinGW
In-Reply-To: <AANLkTi=E+FZW+C1N875H9-zgKyXK7fKd77DmgyttHQ+f@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1012111913020.26098@tvnag.unkk.fr>
References: <AANLkTi=E+FZW+C1N875H9-zgKyXK7fKd77DmgyttHQ+f@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sat, 11 Dec 2010 19:15:58 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sat, 11 Dec 2010 19:14:30 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Fri, 10 Dec 2010, Luis Lavena wrote:

> Anyhow, there is a problem compiling examples:

> In file included from direct_tcpip.c:2:0:
> ../include/libssh2.h:134:16: error: expected '=', ',', ';', 'asm' or
> '__attribute__' before 'libssh2_socket_t'
> ../include/libssh2.h:447:43: error: expected declaration specifiers or
> '...' before 'libssh2_socket_t'

> Anyone seen this too?

I don't use windows so I've not seen this. Does this happen because the 
windows.h and family headers are included after and not before libssh.h?

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Sat Dec 11 21:11:22 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBBKA8aa012357;
	Sat, 11 Dec 2010 21:11:20 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id oBBKA6gF012161
	for <libssh2-devel@cool.haxx.se>; Sat, 11 Dec 2010 21:10:06 +0100
Received: (qmail 13592 invoked by uid 501); 11 Dec 2010 20:10:01 -0000
Message-ID: <20101211201001.13591.qmail@stuge.se>
Date: Sat, 11 Dec 2010 21:10:01 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: Compile error in examples under MinGW
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <AANLkTi=E+FZW+C1N875H9-zgKyXK7fKd77DmgyttHQ+f@mail.gmail.com>
	<alpine.DEB.2.00.1012111913020.26098@tvnag.unkk.fr>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.00.1012111913020.26098@tvnag.unkk.fr>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sat, 11 Dec 2010 21:11:22 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sat, 11 Dec 2010 21:10:06 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Daniel Stenberg wrote:
>> ../include/libssh2.h:134:16: error: expected '=', ',', ';', 'asm' or
>> '__attribute__' before 'libssh2_socket_t'
>
> I don't use windows so I've not seen this. Does this happen because the 
> windows.h and family headers are included after and not before libssh.h?

Yeah. I'm inclined to stuff the unix socket headers into libssh2.h
too. What do you think? And Luis, does applying the below patch fix
your problem? Please confirm.

diff --git a/include/libssh2.h b/include/libssh2.h
index e011d49..17bb208 100644
--- a/include/libssh2.h
+++ b/include/libssh2.h
@@ -93,6 +93,25 @@ extern "C" {
 #include <sys/stat.h>
 #include <sys/types.h>
 
+#ifdef WIN32
+#include <windows.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#else
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#endif
+
 /* Allow alternate API prefix from CFLAGS or calling app */
 #ifndef LIBSSH2_API
 # ifdef LIBSSH2_WIN32


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

From libssh2-devel-bounces@cool.haxx.se  Sat Dec 11 21:34:46 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBBKXdVG022325;
	Sat, 11 Dec 2010 21:34:45 +0100
Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com
	[209.85.215.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBBKXb7N022315
	for <libssh2-devel@cool.haxx.se>; Sat, 11 Dec 2010 21:33:37 +0100
Received: by eyf6 with SMTP id 6so3605095eyf.13
	for <libssh2-devel@cool.haxx.se>; Sat, 11 Dec 2010 12:33:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:mime-version:received:in-reply-to
	:references:from:date:message-id:subject:to:content-type
	:content-transfer-encoding;
	bh=9+4J8/3DorksnraCGPZrRUyVr7T6JrcCCSnTHt9goHc=;
	b=k1r6HPySyrNhfbhFFSlHaF21ddf8ri+aPoQdaf0RVwqbbNv6Vx8Qnm9SIBecuzyHQ3
	YCY1ncBvEdBtOSdNBU9Gg8uxGlmA8gC1xo7t2GPcZayhkbf3rh2p53q5h4jByPl356Dh
	ptLOs6Rxib3wX0l0ohFDhuDqBVgFMPSq5yp4Q=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:content-type:content-transfer-encoding;
	b=V27QfhvwPm62U1KZ/CT8yngRnbSOHPe246PuJI+RnKotpq2rPOFv+VzFJUsTwij1ZE
	HsF1Je+g3pbSaJpXsXGqkCIX9MenIjEXMECGJUqt0jXHdsJN9shMYSwJtA67Xgqnfv2t
	kVVfe8YD1AEYwKAs9CwAuuabrOh5uYhPxF11s=
Received: by 10.213.30.5 with SMTP id s5mr2427220ebc.44.1292099614191; Sat, 11
	Dec 2010 12:33:34 -0800 (PST)
MIME-Version: 1.0
Received: by 10.213.2.139 with HTTP; Sat, 11 Dec 2010 12:33:14 -0800 (PST)
In-Reply-To: <alpine.DEB.2.00.1012111913020.26098@tvnag.unkk.fr>
References: <AANLkTi=E+FZW+C1N875H9-zgKyXK7fKd77DmgyttHQ+f@mail.gmail.com>
	<alpine.DEB.2.00.1012111913020.26098@tvnag.unkk.fr>
From: Luis Lavena <luislavena@gmail.com>
Date: Sat, 11 Dec 2010 17:33:14 -0300
Message-ID: <AANLkTinX=uOuKgBtKeP5kD37b2-fvCRMUSidrcym_YRQ@mail.gmail.com>
Subject: Re: Compile error in examples under MinGW
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sat, 11 Dec 2010 21:34:46 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sat, 11 Dec 2010 21:33:37 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Sat, Dec 11, 2010 at 3:14 PM, Daniel Stenberg <daniel@haxx.se> wrote:
> On Fri, 10 Dec 2010, Luis Lavena wrote:
>
>> Anyhow, there is a problem compiling examples:
>
>> In file included from direct_tcpip.c:2:0:
>> ../include/libssh2.h:134:16: error: expected '=3D', ',', ';', 'asm' or
>> '__attribute__' before 'libssh2_socket_t'
>> ../include/libssh2.h:447:43: error: expected declaration specifiers or
>> '...' before 'libssh2_socket_t'
>
>> Anyone seen this too?
>
> I don't use windows so I've not seen this. Does this happen because the
> windows.h and family headers are included after and not before libssh.h?
>

Thank you for answering.

You're correct, moving:

#include "libssh2_config.h"
#include <libssh2.h>

After #ifdef WIN32 block solves the compilation problem, also Peter
Stuge patch works (removing all the windows stuff from
direct_tcpip.c), If oyu can commit that change will be great.

There is another problem also:

/bin/sh ../libtool --tag=3DCC --mode=3Dlink gcc  -DLIBSSH2_WIN32
-DWINSOCK_VERSION=3D0x0200   -o direct_tcpip.exe  direct_tcpip.o
../src/libssh2.la -lws2_32
libtool: link: gcc -DLIBSSH2_WIN32 -DWINSOCK_VERSION=3D0x0200 -o
.libs/direct_tcpip.exe direct_tcpip.o  ../src/.libs/libssh2.a -lssl
-lcrypto -lz -lws2_32
direct_tcpip.o:direct_tcpip.c:(.text+0xf4): undefined reference to
`_imp__libssh2_init'
direct_tcpip.o:direct_tcpip.c:(.text+0x20b): undefined reference to
`_imp__libssh2_session_init_ex'
direct_tcpip.o:direct_tcpip.c:(.text+0x25a): undefined reference to
`_imp__libssh2_session_startup'
direct_tcpip.o:direct_tcpip.c:(.text+0x2a1): undefined reference to
`_imp__libssh2_hostkey_hash'
direct_tcpip.o:direct_tcpip.c:(.text+0x347): undefined reference to
`_imp__libssh2_userauth_list'
direct_tcpip.o:direct_tcpip.c:(.text+0x44d): undefined reference to
`_imp__libssh2_userauth_password_ex'
direct_tcpip.o:direct_tcpip.c:(.text+0x4d2): undefined reference to
`_imp__libssh2_userauth_publickey_fromfile_ex'
direct_tcpip.o:direct_tcpip.c:(.text+0x6ff): undefined reference to
`_imp__libssh2_channel_direct_tcpip_ex'
direct_tcpip.o:direct_tcpip.c:(.text+0x74a): undefined reference to
`_imp__libssh2_session_set_blocking'
direct_tcpip.o:direct_tcpip.c:(.text+0x8d0): undefined reference to
`_imp__libssh2_channel_write_ex'
direct_tcpip.o:direct_tcpip.c:(.text+0x93b): undefined reference to
`_imp__libssh2_channel_read_ex'
direct_tcpip.o:direct_tcpip.c:(.text+0x9e0): undefined reference to
`_imp__libssh2_channel_eof'
direct_tcpip.o:direct_tcpip.c:(.text+0xa37): undefined reference to
`_imp__libssh2_channel_free'
direct_tcpip.o:direct_tcpip.c:(.text+0xa5c): undefined reference to
`_imp__libssh2_session_disconnect_ex'
direct_tcpip.o:direct_tcpip.c:(.text+0xa69): undefined reference to
`_imp__libssh2_session_free'
direct_tcpip.o:direct_tcpip.c:(.text+0xa7e): undefined reference to
`_imp__libssh2_exit'
collect2: ld returned 1 exit status
make[2]: *** [direct_tcpip.exe] Error 1
make[2]: Leaving directory
`/c/Users/Luis/Projects/oss/oci/rubyinstaller/sandbox/src-libssh2/example'
make[1]: *** [all] Error 2
make[1]: Leaving directory
`/c/Users/Luis/Projects/oss/oci/rubyinstaller/sandbox/src-libssh2/example'
make: *** [all-recursive] Error 1

I've tried both --enable-shared and --disable-static, but the same issue.

Above is a common problem of usage of __declspec(dllexport) versus
__declspec(dllimport). All that is generated by LIBSSH2_LIBRARY,
defined in libssh2_priv and included by every single source file that
the library uses, but is never defined during the library compilation.

Instead, libtool defined DLL_EXPORT:

libtool: compile:  gcc -DHAVE_CONFIG_H -I../../include -I../src
-DLIBSSH2_WIN32 -DWINSOCK_VERSION=3D0x0200 -MT channel.lo -MD -MP -MF
.deps/channel.Tpo -c ../../src/channel.c  -DDLL_EXPORT -DPIC -o
.libs/channel.o

Could this be the linking issue?
-- =

Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exup=E9ry
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Sat Dec 11 21:53:51 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBBKqjWW000625;
	Sat, 11 Dec 2010 21:53:51 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id oBBKqhki000614
	for <libssh2-devel@cool.haxx.se>; Sat, 11 Dec 2010 21:52:43 +0100
Received: (qmail 20896 invoked by uid 501); 11 Dec 2010 20:52:40 -0000
Message-ID: <20101211205240.20895.qmail@stuge.se>
Date: Sat, 11 Dec 2010 21:52:40 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: Compile error in examples under MinGW
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <AANLkTi=E+FZW+C1N875H9-zgKyXK7fKd77DmgyttHQ+f@mail.gmail.com>
	<alpine.DEB.2.00.1012111913020.26098@tvnag.unkk.fr>
	<AANLkTinX=uOuKgBtKeP5kD37b2-fvCRMUSidrcym_YRQ@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <AANLkTinX=uOuKgBtKeP5kD37b2-fvCRMUSidrcym_YRQ@mail.gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sat, 11 Dec 2010 21:53:51 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sat, 11 Dec 2010 21:52:43 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Luis Lavena wrote:
> also Peter Stuge patch works (removing all the windows stuff from
> direct_tcpip.c), If oyu can commit that change will be great.

I'll have a look.


> There is another problem also:
> 
> /bin/sh ../libtool --tag=CC --mode=link gcc  -DLIBSSH2_WIN32
> -DWINSOCK_VERSION=0x0200   -o direct_tcpip.exe  direct_tcpip.o
> ../src/libssh2.la -lws2_32
> libtool: link: gcc -DLIBSSH2_WIN32 -DWINSOCK_VERSION=0x0200 -o
> .libs/direct_tcpip.exe direct_tcpip.o  ../src/.libs/libssh2.a -lssl
> -lcrypto -lz -lws2_32
> direct_tcpip.o:direct_tcpip.c:(.text+0xf4): undefined reference to
> `_imp__libssh2_init'
..

> I've tried both --enable-shared and --disable-static, but the same issue.

Do you want to use a DLL? I have always linked libssh2 statically in
my projects, which may explain why I haven't seen the problem.


> Above is a common problem of usage of __declspec(dllexport) versus
> __declspec(dllimport).

Or linking with the wrong type of library. I've done a fair bit of
research on DLLs in Windows for libusb, in order to build
interchangeable (MinGW and MS) DLLs and static libraries. I believe
I've figured out the minimum that is neccessary, and declspec is not
enough.


> Instead, libtool defined DLL_EXPORT:
..
> Could this be the linking issue?

Sure, but it could also be something else. Can you look into it?

Especially when switching back and forth between options that are
relevant for libtool it's nice to do make distclean, to ensure that
there are no left-overs from a previous build that are causing
trouble.


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

From libssh2-devel-bounces@cool.haxx.se  Sat Dec 11 22:05:55 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBBL4pU2011299;
	Sat, 11 Dec 2010 22:05:55 +0100
Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com
	[209.85.215.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBBL4ntb011247
	for <libssh2-devel@cool.haxx.se>; Sat, 11 Dec 2010 22:04:50 +0100
Received: by eyf6 with SMTP id 6so3613650eyf.13
	for <libssh2-devel@cool.haxx.se>; Sat, 11 Dec 2010 13:04:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:mime-version:received:in-reply-to
	:references:from:date:message-id:subject:to:content-type
	:content-transfer-encoding;
	bh=oZ9ApJsFlPffg/xyaIeqDkCdRaNBFyF5/h3vUedOCrQ=;
	b=PPtzdABh5sT2RgxM2478tPicHLpvxledIZBpnXT9xlk78Bb1i/WgzV1gq/eUU+9ziV
	G6s09QjYVy+vgFh/2QQEG9b7Dqu7gAkz+zwfDkWwG5NNh39slSUNrmRtegP6PHR42PCA
	ZIR8PekpejFgbh/4sKOsAZC0fOw86Hc7uTRQE=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:content-type:content-transfer-encoding;
	b=D2t1m+z1AHyk2I2RdCKE4frBYJANWmUSSQpewRCUIY6e9f8JGuANkJ8bCEYrNVXThx
	J9EmuccLyDiQYgvOZzzBdW0dES9J5IhtglEPQDyEG2NR4ZEmkoPUBHti4VQNcxMxWq9o
	gLe9xys/dT89UaQGC/jHe7HawRFwk8GEra+sg=
Received: by 10.213.14.7 with SMTP id e7mr872506eba.18.1292101486277; Sat, 11
	Dec 2010 13:04:46 -0800 (PST)
MIME-Version: 1.0
Received: by 10.213.2.139 with HTTP; Sat, 11 Dec 2010 13:04:26 -0800 (PST)
In-Reply-To: <20101211205240.20895.qmail@stuge.se>
References: <AANLkTi=E+FZW+C1N875H9-zgKyXK7fKd77DmgyttHQ+f@mail.gmail.com>
	<alpine.DEB.2.00.1012111913020.26098@tvnag.unkk.fr>
	<AANLkTinX=uOuKgBtKeP5kD37b2-fvCRMUSidrcym_YRQ@mail.gmail.com>
	<20101211205240.20895.qmail@stuge.se>
From: Luis Lavena <luislavena@gmail.com>
Date: Sat, 11 Dec 2010 18:04:26 -0300
Message-ID: <AANLkTi=agRbzU0E1A2NuMKXtymhO6fJVEr8G7bjqofp1@mail.gmail.com>
Subject: Re: Compile error in examples under MinGW
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sat, 11 Dec 2010 22:05:55 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sat, 11 Dec 2010 22:04:50 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Sat, Dec 11, 2010 at 5:52 PM, Peter Stuge <peter@stuge.se> wrote:
>> I've tried both --enable-shared and --disable-static, but the same issue.
>
> Do you want to use a DLL? I have always linked libssh2 statically in
> my projects, which may explain why I haven't seen the problem.
>

I always prefer static, but wanted to mention tried different
combination with the same results.

>
>> Above is a common problem of usage of __declspec(dllexport) versus
>> __declspec(dllimport).
>
> Or linking with the wrong type of library. I've done a fair bit of
> research on DLLs in Windows for libusb, in order to build
> interchangeable (MinGW and MS) DLLs and static libraries. I believe
> I've figured out the minimum that is neccessary, and declspec is not
> enough.
>

Can you provide a link to your work? I would love take a look and see
what needs to be changed in libssh2

>
>> Instead, libtool defined DLL_EXPORT:
> ..
>> Could this be the linking issue?
>
> Sure, but it could also be something else. Can you look into it?
>
> Especially when switching back and forth between options that are
> relevant for libtool it's nice to do make distclean, to ensure that
> there are no left-overs from a previous build that are causing
> trouble.
>

I always create a new build directory and run configure inside of it,
never build on top of the source code as policy :-)

Thank you for your time answering my questions.
-- =

Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exup=E9ry
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Sat Dec 11 22:47:45 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBBLlSQV010781;
	Sat, 11 Dec 2010 22:47:42 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBBLlR3l010718
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Sat, 11 Dec 2010 22:47:27 +0100
Received: (qmail 31492 invoked from network); 11 Dec 2010 21:47:23 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 11 Dec 2010 21:47:23 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Sat, 11 Dec 2010 21:47:23 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #198: _libssh2_channel_close() may hang
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/198#comment:5
Message-ID: <055.0774e7b28e19871792b612fd9d34ebd0@libssh2.stuge.se>
References: <040.f267185fd189c3163b83597a7e73540d@libssh2.stuge.se>
X-Trac-Ticket-ID: 198
In-Reply-To: <040.f267185fd189c3163b83597a7e73540d@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sat, 11 Dec 2010 22:47:45 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sat, 11 Dec 2010 22:47:27 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

  * milestone:  1.2.7 => 1.2.8


Comment:

 This change was pushed to git as commit
 811cce09b5c885a40b6b3ee6cf4a1562322f4b2d

-- 
Ticket URL: <http://trac.libssh2.org/ticket/198#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  Sat Dec 11 22:49:31 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBBLnUg0011669;
	Sat, 11 Dec 2010 22:49:31 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBBLnSaB011617
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Sat, 11 Dec 2010 22:49:28 +0100
Received: (qmail 31987 invoked from network); 11 Dec 2010 21:49:25 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 11 Dec 2010 21:49:25 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Sat, 11 Dec 2010 21:49:25 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #197: Very slow sftp uploads from Windows
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/197#comment:1
Message-ID: <060.ea44c5964f824561aaec40e688344410@libssh2.stuge.se>
References: <045.3abea9eceb7c7df16aff9ed2443543f2@libssh2.stuge.se>
X-Trac-Ticket-ID: 197
In-Reply-To: <045.3abea9eceb7c7df16aff9ed2443543f2@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sat, 11 Dec 2010 22:49:31 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sat, 11 Dec 2010 22:49:29 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#197: Very slow sftp uploads from Windows
------------------------+---------------------------------------------------
  Reporter:  riordanmr  |        Owner:        
      Type:  defect     |       Status:  closed
  Priority:  normal     |    Milestone:  1.2.8 
 Component:  SFTP       |      Version:  1.2.7 
Resolution:  fixed      |     Keywords:        
    Blocks:             |   Blocked By:        
------------------------+---------------------------------------------------
Changes (by bagder):

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


Comment:

 This issue has now been resolved and fixed. There is still room for
 improvements in the API to make it easier to do a client for fast
 transfers, but that's not a bug and will be discussed on the mailing list
 later on.

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

From libssh2-devel-bounces@cool.haxx.se  Sat Dec 11 22:51:38 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBBLpZGQ012846;
	Sat, 11 Dec 2010 22:51:37 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBBLpYac012785
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Sat, 11 Dec 2010 22:51:34 +0100
Received: (qmail 32316 invoked from network); 11 Dec 2010 21:51:30 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 11 Dec 2010 21:51:30 -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, 11 Dec 2010 21:51:30 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #186: libssh gets stuck at
	kex_method_diffie_hellman_groupGP_sha1_key_exchange. CPU
	utilization goes upto 100%
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/186#comment:2
Message-ID: <123.c05806587f2dcb0188789ce22d506ab7@libssh2.stuge.se>
References: <108.a5a9892915fbecf282faa78e591a6c63@libssh2.stuge.se>
X-Trac-Ticket-ID: 186
In-Reply-To: <108.a5a9892915fbecf282faa78e591a6c63@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sat, 11 Dec 2010 22:51:37 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sat, 11 Dec 2010 22:51:34 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

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


Comment:

 Sorry I don't get this fully. Does it get stuck in a loop within gcrypt or
 does it somehow loop within libssh2?

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

From libssh2-devel-bounces@cool.haxx.se  Sun Dec 12 02:06:43 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBC16InU005227;
	Sun, 12 Dec 2010 02:06:39 +0100
Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com
	[209.85.215.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBC16G1Z005210
	for <libssh2-devel@cool.haxx.se>; Sun, 12 Dec 2010 02:06:16 +0100
Received: by eyf6 with SMTP id 6so3669141eyf.13
	for <libssh2-devel@cool.haxx.se>; Sat, 11 Dec 2010 17:06:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:mime-version:received:in-reply-to
	:references:from:date:message-id:subject:to:content-type
	:content-transfer-encoding;
	bh=qgkLwc2JQop+x/mlFR+2cnqRLQjubt+kPKgg8SOIrL8=;
	b=XGZBxwzU4apZklgRXOz7XR2uGSqIit8NREuymtbYI4bTRrQOEF899qMq7lrjP0ZPXX
	Oa9cDlRt380c+ia/lnNOKCPCCGHlJAlv50Bqwr3VUqsToLKFix33LMoTjrOo+JZ/ohzJ
	oFU8wRdHYHyme31CAzlDDwhMYPAdFOWPMLas0=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:content-type:content-transfer-encoding;
	b=uDmG518lSIj+K5cn5m+eA/FaBAH5lpET4k0IrsyOh26VmQbZkubyJuSMKhu/Y745Y7
	RkrPuZMuA+Dgc12FtkH/0iyhdm/PPtN3/CQ0G3QRZRrgwkKWqAs1yuWZ8Db1lrBmqIQ+
	bfTmeR9JacXjxX1+MuNr1poRaf0upfLeLAH14=
Received: by 10.213.113.210 with SMTP id b18mr1166242ebq.31.1292115972313;
	Sat, 11 Dec 2010 17:06:12 -0800 (PST)
MIME-Version: 1.0
Received: by 10.213.35.130 with HTTP; Sat, 11 Dec 2010 17:05:52 -0800 (PST)
In-Reply-To: <AANLkTi=agRbzU0E1A2NuMKXtymhO6fJVEr8G7bjqofp1@mail.gmail.com>
References: <AANLkTi=E+FZW+C1N875H9-zgKyXK7fKd77DmgyttHQ+f@mail.gmail.com>
	<alpine.DEB.2.00.1012111913020.26098@tvnag.unkk.fr>
	<AANLkTinX=uOuKgBtKeP5kD37b2-fvCRMUSidrcym_YRQ@mail.gmail.com>
	<20101211205240.20895.qmail@stuge.se>
	<AANLkTi=agRbzU0E1A2NuMKXtymhO6fJVEr8G7bjqofp1@mail.gmail.com>
From: Luis Lavena <luislavena@gmail.com>
Date: Sat, 11 Dec 2010 22:05:52 -0300
Message-ID: <AANLkTimJd58W8ugDZ+HMonOH7CjOU7aAG_7s11uETLep@mail.gmail.com>
Subject: Re: Compile error in examples under MinGW
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sun, 12 Dec 2010 02:06:43 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sun, 12 Dec 2010 02:06:16 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Sat, Dec 11, 2010 at 6:04 PM, Luis Lavena <luislavena@gmail.com> wrote:
>>
>>> Above is a common problem of usage of __declspec(dllexport) versus
>>> __declspec(dllimport).
>>
>> Or linking with the wrong type of library. I've done a fair bit of
>> research on DLLs in Windows for libusb, in order to build
>> interchangeable (MinGW and MS) DLLs and static libraries. I believe
>> I've figured out the minimum that is neccessary, and declspec is not
>> enough.
>>
>
> Can you provide a link to your work? I would love take a look and see
> what needs to be changed in libssh2
>

I've managed to get all the examples build against the static library
changing LIBSSH2_API definition:

 /* Allow alternate API prefix from CFLAGS or calling app */
 #ifndef LIBSSH2_API
 # ifdef LIBSSH2_WIN32
 #  ifdef LIBSSH2_LIBRARY
-#   define LIBSSH2_API __declspec(dllexport)
+#   define LIBSSH2_API extern
 #  else
-#   define LIBSSH2_API __declspec(dllimport)
+#   define LIBSSH2_API extern
 #  endif /* LIBSSH2_LIBRARY */
 # else /* !LIBSSH2_WIN32 */
 #  define LIBSSH2_API

Tomorrow will investigate how to differentiate when linking against
the static library or the shared library.

Cheers,
-- =

Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exup=E9ry
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Sun Dec 12 10:56:08 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBC9tlBC009120;
	Sun, 12 Dec 2010 10:56:04 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBC9tkZU009110
	for <libssh2-devel@cool.haxx.se>; Sun, 12 Dec 2010 10:55:46 +0100
Date: Sun, 12 Dec 2010 10:55:46 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Compile error in examples under MinGW
In-Reply-To: <AANLkTimJd58W8ugDZ+HMonOH7CjOU7aAG_7s11uETLep@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1012121054150.26098@tvnag.unkk.fr>
References: <AANLkTi=E+FZW+C1N875H9-zgKyXK7fKd77DmgyttHQ+f@mail.gmail.com>
	<alpine.DEB.2.00.1012111913020.26098@tvnag.unkk.fr>
	<AANLkTinX=uOuKgBtKeP5kD37b2-fvCRMUSidrcym_YRQ@mail.gmail.com>
	<20101211205240.20895.qmail@stuge.se>
	<AANLkTi=agRbzU0E1A2NuMKXtymhO6fJVEr8G7bjqofp1@mail.gmail.com>
	<AANLkTimJd58W8ugDZ+HMonOH7CjOU7aAG_7s11uETLep@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sun, 12 Dec 2010 10:56:08 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sun, 12 Dec 2010 10:55:46 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Sat, 11 Dec 2010, Luis Lavena wrote:

> I've managed to get all the examples build against the static library
> changing LIBSSH2_API definition:

That reminds me that in libcurl we have a CURL_STATICLIB define set when 
building the library static (on Windows) which then avoids the __declspec 
stuff similar to your patch.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Mon Dec 13 03:32:02 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBD2VaPE019610;
	Mon, 13 Dec 2010 03:31:58 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBD2VZEa019600
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Mon, 13 Dec 2010 03:31:35 +0100
Received: (qmail 20268 invoked from network); 13 Dec 2010 02:31:29 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 13 Dec 2010 02:31:29 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Mon, 13 Dec 2010 02:31:29 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #186: libssh gets stuck at
	kex_method_diffie_hellman_groupGP_sha1_key_exchange. CPU
	utilization goes upto 100%
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/186#comment:3
Message-ID: <123.773439e207174cde5fec7d8a604368ed@libssh2.stuge.se>
References: <108.a5a9892915fbecf282faa78e591a6c63@libssh2.stuge.se>
X-Trac-Ticket-ID: 186
In-Reply-To: <108.a5a9892915fbecf282faa78e591a6c63@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 13 Dec 2010 03:32:02 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 13 Dec 2010 03:31:35 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

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

 Replying to [comment:2 bagder]:
 > Sorry I don't get this fully. Does it get stuck in a loop within gcrypt
 or does it somehow loop within libssh2?

 It gets stuck in the gcrypt's , gcry_mpi_copy () function, with the cpu
 utilization going to 100% and staying that way till we terminate the
 process.

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

From libssh2-devel-bounces@cool.haxx.se  Mon Dec 13 08:02:32 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBD728Ux004715;
	Mon, 13 Dec 2010 08:02:28 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBD7274V004673
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Mon, 13 Dec 2010 08:02:07 +0100
Received: (qmail 17135 invoked from network); 13 Dec 2010 07:02:06 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 13 Dec 2010 07:02:06 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Mon, 13 Dec 2010 07:02:06 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #186: libssh gets stuck at
	kex_method_diffie_hellman_groupGP_sha1_key_exchange. CPU
	utilization goes upto 100%
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/186#comment:4
Message-ID: <123.384243b17054b840bc87bbe6cddfcbcc@libssh2.stuge.se>
References: <108.a5a9892915fbecf282faa78e591a6c63@libssh2.stuge.se>
X-Trac-Ticket-ID: 186
In-Reply-To: <108.a5a9892915fbecf282faa78e591a6c63@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 13 Dec 2010 08:02:32 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 13 Dec 2010 08:02:07 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

Comment (by stuge):

 Replying to [comment:3 www.google.com/accounts/o8/id?id
 =aitoawlhggg_yplkl7grwwpbbum-omtqud4rmna]:
 > It gets stuck in the gcrypt's , gcry_mpi_copy () function, with the cpu
 utilization going to 100% and staying that way till we terminate the
 process.

 Are you positive that it is really stuck inside the libgcrypt function,
 and that the problem is not that the function is called over and over?

 Can you work with gdb when it gets stuck? Step through? What does it
 actually do in that function? Also, it would be helpful to build a
 libgcrypt which includes debugging symbols.

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

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

From libssh2-devel-bounces@cool.haxx.se  Mon Dec 13 11:55:11 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBDAsrlA025365;
	Mon, 13 Dec 2010 11:55:07 +0100
Received: from earth.stuge.se (earth.stuge.se [213.88.146.15])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBDAsqsE025344
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Mon, 13 Dec 2010 11:54:52 +0100
Received: (qmail 19134 invoked from network); 13 Dec 2010 10:54:50 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 13 Dec 2010 10:54:50 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Mon, 13 Dec 2010 10:54:50 -0000
X-URL: http://trac.libssh2.org/
Subject: [libssh2] #203: Compile warnings under VC6 (Win32, 32bit) for DLL
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/203
Message-ID: <085.18e26a0ee26c16f89f3e33c9c220b94b@libssh2.stuge.se>
X-Trac-Ticket-ID: 203
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 13 Dec 2010 11:55:11 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 13 Dec 2010 11:54:52 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#203: Compile warnings under VC6 (Win32, 32bit) for DLL
----------------------------------------------------------------+-----------
  Reporter:  me.yahoo.com/a/zb4rfgwuv_ft.mggqltssk.ndw--#37f15  |       Owner:       
      Type:  build error                                        |      Status:  new  
  Priority:  normal                                             |   Milestone:  1.2.8
 Component:  API                                                |     Version:  1.2.7
  Keywords:                                                     |      Blocks:       
Blocked By:                                                     |  
----------------------------------------------------------------+-----------
 The following warnings are being reported against 1.2.8-20101213 when
 compiling the DLL using VC6 32bit:

 libssh2-1.2.8-20101213\src\scp.c(728) : warning C4244: '=' : conversion
 from 'long ' to 'unsigned short ', possible loss of data
 libssh2-1.2.8-20101213\src\session.c(1407) : warning C4018: '==' :
 signed/unsigned mismatch
 libssh2-1.2.8-20101213\src\session.c(1408) : warning C4018: '>' :
 signed/unsigned mismatch
 libssh2-1.2.8-20101213\src\session.c(1412) : warning C4018: '==' :
 signed/unsigned mismatch
 libssh2-1.2.8-20101213\src\session.c(1413) : warning C4018: '>' :
 signed/unsigned mismatch
 libssh2-1.2.8-20101213\src\sftp.c(1446) : warning C4244: 'initializing' :
 conversion from 'unsigned __int64 ' to 'unsigned int ', possible loss of
 data
 libssh2-1.2.8-20101213\src\sftp.c(2206) : warning C4244: '=' : conversion
 from 'unsigned __int64 ' to 'unsigned int ', possible loss of data
 libssh2-1.2.8-20101213\src\sftp.c(2318) : warning C4244: '=' : conversion
 from 'unsigned __int64 ' to 'unsigned int ', possible loss of data
 libssh2-1.2.8-20101213\src\packet.c(1172) : warning C4761: integral size
 mismatch in argument; conversion supplied

 The resulting library compiles and appears to work correctly, although I'm
 currently having issues with sftp_write() returning zero which may be
 unrelated.

-- 
Ticket URL: <http://trac.libssh2.org/ticket/203>
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 Dec 14 13:49:22 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBECn2Uu028694;
	Tue, 14 Dec 2010 13:49:18 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBECn1nR028676
	for <libssh2-devel@cool.haxx.se>; Tue, 14 Dec 2010 13:49:01 +0100
Date: Tue, 14 Dec 2010 13:49:01 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: SFTP download speeds
Message-ID: <alpine.DEB.2.00.1012140032240.16941@tvnag.unkk.fr>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 14 Dec 2010 13:49:22 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 14 Dec 2010 13:49:01 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hi friends,

I've been working on introducing the asynch approach for SFTP downloads. 
Downloads are a bit different in nature than uploads as for example we will 
normally get a largish buffer in each call and we will read until EOF.

I first experimented with sending very large FXP_READ requests, and I learned 
than OpenSSH only sends back 64K data and never more. The SFTP spec is a bit 
vaguely written but seems to say that implementations are only obliged to 
support 32K.

So, to read SFTP really fast we create a queue of outgoing READ packets and 
send them out one by one and return data as soon as we get such. This way we 
get the pipelining effect we want and thus circumvent the waiting. The fact 
that we don't know the size before-hand combined with this sort of pre-reading 
makes us send a lot of READs beyond the end of the file. That's definately 
room for improvement.

SOME NUMBERS

    (As usual all numbers are rough, possibly wrong due to my mistakes and I've
    ran all libssh2 tests using debug builds (without any kind of compiler
    optimizations enabled) and some of them used a fair about of printf outputs
    during their operations.)

  - I made the pre-reading use 'buffer_size * 4' as maximum outstanding reads.

  - I used the sftp_nonblock.c code and bumped its own buffer to 1MB - yes that
    makes libssh2 pre-read 4MB! Setting down the max to 'buffer_size * 4' did
    cut the transfer speed by 20%! 4MB makes ~135 outstanding READ packets when
    30000 is requested in each.

  - I modified the code to not write() the received data anywhere

  - For my test with the 1.2.7 code, I modified the buffer to 100K just to make
    sure it was as big as possible for that code.

HIGH LATENCY

  To simulate a far away server, I used a nice new trick I've learned to add
  RTT time:

   $ tc qdisc add dev lo root handle 1:0 netem delay 100msec

  Restore it back to normal again with:

   $ tc qdisc del dev lo root

  The added 100 millisecond delay here is once for each way, so this makes a
  200ms RTT when I ping localhost.

  A test with the original 1.2.7 code first:

   Got 10240000 bytes in 64238 ms = 159407.2 bytes/sec

  Yes, it really does perform that terribly bad. OpenSSH's sftp tool does the
  upload at 7.5MB/sec over the same connection.

  My first test with my new code, using the 4MB/30000 sizes:

   Got 102400000 bytes in 20585 ms = 4974496.0 bytes/sec

  Correct. Check the number of zeroes. Ten times the data in a third of the
  time: 31 times faster in total...

  So I started to experiment with sizes. My thinking is that with a 200 ms
  latency, we might want more than 200 requests in the pipe to be really
  efficient. And what do you know? If I cut down the outgoing data requests to
  ask for just 2000 bytes per "piece" I'm able to bump it up another 40%:

   Got 102400000 bytes in 14695 ms = 6968356.6 bytes/sec

  At almost 7MB/sec we're now very close to OpenSSH and roughly 43 times faster
  than 1.2.7...

ZERO LATENCY

  When I removed the added latency again and ran the test against localhost my
  test app seemed to get quite stable 25MB/sec while OpenSSH run like the wind
  at 44MB/sec. I've tried changing the packet sizes between 2000 and 30000 as I
  suspected that localhost might perform better with larger sizes there, but I
  didn't see any significant difference. I believe this difference is more due
  to something in our regular transport/channel handling as we are noticably
  slower than openssh already with plain SCP and as long as we are that, we
  can't make SFTP compare either.

DOWNSIDE

  When we use this approach we have a significant over-read for small files. If
  we for example were to write an application that moves over a directory with
  100 files, each being 20 bytes, we would perform terribly slow and waste a
  lot of bandwidth.

IMPROVEMENTS

  I think that we should consider having the SFTP code do an SSH_FXP_STAT
  query first to figure out the size of the remote file so that _no_
  "over-read" will be done and thus there will be no punishment for small
  files. Of course this will then not work exactly like today in cases when for
  example the file is being written to while the download begins.

  I think we should consider an API that limits or disables this read-ahead
  concept for small memory situations or just situations where it doesn't
  behave in a way that is favourable to the application.

WHAT NOW

  I'll be committing my changes soonish. I have come to think of a few quirks I
  want to look over first - not really related to my changes but I think my
  changes expose these problems more.

  I will really appreciate if everyone would consider getting the new
  code for a little spin to see in which ways it breaks and what mistakes I
  haven't yet found myself. My tests seems to run rather solidly, but I have a
  rather limited test environment and quite likely too bad imagination to cause
  the real disasters!

-- 

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

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

hi

(I decided to push my code and not do any fix for this right now, and here I 
try to describe the little problem.)

Currently I've made the 'packet_list' a linked list of packets that is kept 
within the SFTP handle that you get returned when you call sftp_open().

The list keeps track of all outstanding "pipelined" requests and using that 
list the code maps incoming ACKs etc against that list. The incoming SFTP 
packets are kept in a list that is "global" for the SFTP session, as an SFTP 
session is using a single SSH channel during its entire life span which may do 
many different SFTP operations.

The problem with this is when we have outstanding SFTP packets at the time we 
close an SFTP handle, as then we nuke the list of known outstanding packets 
and when the server responds the packets are added to the queue but will never 
be read off from it. "outstanding packets" are for example read-head reads 
that is sent off to read before we knew that the file actually has ended. 
(Each outgoing packet has a 32bit 'id' field and each incoming packet has one 
too, and that's what maps requests with responses.)

Since the ids are sequential and used for the SFTP session and not on a 
per-handle basis I figure moving the list to the handle is a good idea anyway. 
Then we need to add a way to make sure each handle knows which outgoing 
packets that it added there. I figure we can start with simply storing a 
within each struct back to the correct SFTP handle.

When a single handle is removed, we go through the list of outstanding request 
that haven't yet received a response and we "unmark" the request as having a 
handle as then we can discard received response packets to such requests 
immediately on sight.

However, with a better STAT done on the file before SFTP downloads we should 
do MUCH less over-reads and thus the problem will be reduced drastically, so I 
think I'll prioritize the STAT fix.

Unless someone else have any other great ideas, thoughts or comments that make 
change my mind! ;-)

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Tue Dec 14 15:47:31 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBEElIr8010039;
	Tue, 14 Dec 2010 15:47:30 +0100
Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com
	[209.85.210.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBEElFQw010023
	for <libssh2-devel@cool.haxx.se>; Tue, 14 Dec 2010 15:47:16 +0100
Received: by iyb26 with SMTP id 26so387914iyb.41
	for <libssh2-devel@cool.haxx.se>; Tue, 14 Dec 2010 06:47:08 -0800 (PST)
MIME-Version: 1.0
Received: by 10.231.16.205 with SMTP id p13mr3260475iba.145.1292338028724;
	Tue, 14 Dec 2010 06:47:08 -0800 (PST)
Received: by 10.231.30.196 with HTTP; Tue, 14 Dec 2010 06:47:08 -0800 (PST)
In-Reply-To: <alpine.DEB.2.00.1012141409390.16941@tvnag.unkk.fr>
References: <alpine.DEB.2.00.1012141409390.16941@tvnag.unkk.fr>
Date: Tue, 14 Dec 2010 15:47:08 +0100
Message-ID: <AANLkTiktK8cMJFJfLA2QuY+jW_6PZRtmUOzvzLpFBhmz@mail.gmail.com>
Subject: Re: The little SFTP flaw I found
From: Jose Baars <peut@peut.org>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 14 Dec 2010 15:47:31 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 14 Dec 2010 15:47:17 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1037348349=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============1037348349==
Content-Type: multipart/alternative; boundary=0003255759f621c45304975fe58b

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

2010/12/14 Daniel Stenberg <daniel@haxx.se>

>
> Unless someone else have any other great ideas, thoughts or comments that
> make change my mind! ;-)
>
>
Hi Daniel,  very clever and promising!

Just my 2 cents:

Maybe consider changing the linked list in a pre allocated array where the
index has a direct relation
to the sequence number so you can bsearch. I have not sufficiently studied
your code to know if
you could even make the size of the array dependent on STAT result.
It will use a bit more memory, but a lot less CPU, and better elapsed time.
A lot of after the fact performance enhancements I have seen in unrelated
projects consist of getting rid of linked lists,
as searching through it was identified as a bottleneck.

Good luck!
Jose

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

<br><div class=3D"gmail_quote">2010/12/14 Daniel Stenberg <span dir=3D"ltr"=
>&lt;<a href=3D"mailto:daniel@haxx.se">daniel@haxx.se</a>&gt;</span><br><bl=
ockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-l=
eft: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Unless someone else have any other great ideas, thoughts or comments that m=
ake change my mind! ;-)<br><font color=3D"#888888">
<br></font></blockquote><br></div>Hi Daniel,=A0 very clever and promising! =
<br><br>Just my 2 cents:<br><br>Maybe consider changing the linked list in =
a pre allocated array where the index has a direct relation <br>
to the sequence number so you can bsearch. I have not sufficiently studied =
your code to know if <br>you could even make the size of the array dependen=
t on STAT result.=A0 <br>It will use a bit more=20
memory, but a lot less CPU, and better elapsed time. A lot of after the=20
fact performance enhancements I have seen in unrelated projects consist of =
getting rid of linked lists,<br>as searching through it was identified as a=
 bottleneck.<br>
<br>

Good luck!<br>Jose<br>
<br>
<br><br>

--0003255759f621c45304975fe58b--

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

--===============1037348349==--

From libssh2-devel-bounces@cool.haxx.se  Tue Dec 14 16:39:35 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBEFdSvg014466;
	Tue, 14 Dec 2010 16:39:34 +0100
Received: from imail.ipswitch.com (imail.ipswitch.com [156.21.1.5])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBEFdQaD014425
	for <libssh2-devel@cool.haxx.se>; Tue, 14 Dec 2010 16:39:27 +0100
DKIM-Signature: q=dns/txt; v=1; c=relaxed/relaxed; s=ipswitch;
	d=ipswitch.com; a=rsa-sha1;
	h=From:To:References:In-Reply-To:Subject:Date:Message-ID:
	MIME-Version:Content-Type:Content-Transfer-Encoding;
	b=gWT9us6iQSs+QJYuRPwdGQQKa8Tj18v4E64uzBvsvbSE3RtRKPAxp8o9Qw+r8iM6kM
	9gaPaS5cL3yAE6WlbaZfJeMtFfizN8uqork8lbeM/pJ++QCeQzdaPpb0RdJvNRW+OTUC
	clnfvS1TSLXMJGdq9KLi1ypm+oQWClNLNqI+E=;
	bh=YMvbF218a+cAZ0ckJNroB0FOMWk=; t=1292341159;
Received: from mrrnt [66.170.5.130] by ipswitch.com with ESMTP
	(SMTPD-11.03) id ef4e0028796f54f5; Tue, 14 Dec 2010 10:39:18 -0500
From: "Mark Riordan" <mriordan@ipswitch.com>
To: "'libssh2 development'" <libssh2-devel@cool.haxx.se>
References: <alpine.DEB.2.00.1012140032240.16941@tvnag.unkk.fr>
In-Reply-To: <alpine.DEB.2.00.1012140032240.16941@tvnag.unkk.fr>
Subject: RE: SFTP download speeds
Date: Tue, 14 Dec 2010 09:39:17 -0600
Message-ID: <000c01cb9ba5$11f6fee0$35e4fca0$@com>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AcubjX7JPCTvAQooQZ64yq/1PsJd4wAF2JyA
Content-Language: en-us
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 14 Dec 2010 16:39:35 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 14 Dec 2010 16:39:27 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Daniel said:
> I've been working on introducing the asynch approach for SFTP downloads...

This sounds promising!

/mrr


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

From libssh2-devel-bounces@cool.haxx.se  Tue Dec 14 19:51:25 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBEIp3Jh003751;
	Tue, 14 Dec 2010 19:51:21 +0100
Received: from ponderosa.fch.wimsey.bc.ca (zz20920564179.cipherkey.net
	[209.205.64.179])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBEIp1N8003683
	for <libssh2-devel@cool.haxx.se>; Tue, 14 Dec 2010 19:51:02 +0100
Received: by coneharvesters.com
	via sendmail with stdio id <m1PSZxb-000l6IC@ponderosa.fch.wimsey.bc.ca>
	for libssh2-devel@cool.haxx.se; Tue, 14 Dec 2010 10:50:51 -0800 (PST)
Date: Tue, 14 Dec 2010 10:50:50 -0800
From: Dan Fandrich <dan@coneharvesters.com>
To: libssh2-devel@cool.haxx.se
Subject: Re: SFTP download speeds
Message-ID: <20101214185049.GA16539@coneharvesters.com>
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <alpine.DEB.2.00.1012140032240.16941@tvnag.unkk.fr>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.00.1012140032240.16941@tvnag.unkk.fr>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 14 Dec 2010 19:51:25 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 14 Dec 2010 19:51:02 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Tue, Dec 14, 2010 at 01:49:01PM +0100, Daniel Stenberg wrote:
>  My first test with my new code, using the 4MB/30000 sizes:
> 
>   Got 102400000 bytes in 20585 ms = 4974496.0 bytes/sec
> 
>  Correct. Check the number of zeroes. Ten times the data in a third of the
>  time: 31 times faster in total...

That's an amazing improvement!

[...]

>  When we use this approach we have a significant over-read for small files. If
>  we for example were to write an application that moves over a directory with
>  100 files, each being 20 bytes, we would perform terribly slow and waste a
>  lot of bandwidth.

One approach could be to use a slow-start that only queues a few
over-reads at the start, then increases the window exponentially to a
maximum of 4 MB as data is read. This shouldn't penalize the small file
case much while (hopefully) allowing large file transfers to happen
reasonably quickly.

> IMPROVEMENTS
> 
>  I think that we should consider having the SFTP code do an SSH_FXP_STAT
>  query first to figure out the size of the remote file so that _no_
>  "over-read" will be done and thus there will be no punishment for small
>  files. Of course this will then not work exactly like today in cases when for
>  example the file is being written to while the download begins.

The latter case could be handled by queuing a single over-read past the EOF.
The normal case will be that it won't return any data, but if the file size
has increased and it does return data, then treat the file as infinitely long
and continue queuing over-reads in 4 MB chunks until the true end.

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

From libssh2-devel-bounces@cool.haxx.se  Tue Dec 14 19:58:25 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBEIwNl1007115;
	Tue, 14 Dec 2010 19:58:25 +0100
Received: from mail180.messagelabs.com (mail180.messagelabs.com
	[85.158.139.51])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBEIwL52007084
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Tue, 14 Dec 2010 19:58:21 +0100
X-VirusChecked: Checked
X-Env-Sender: Jussi.Mononen@comptel.com
X-Msg-Ref: server-2.tower-180.messagelabs.com!1292353095!19170071!1
X-StarScan-Version: 6.2.9; banners=-,-,-
X-Originating-IP: [195.237.145.102]
Received: (qmail 7299 invoked from network); 14 Dec 2010 18:58:16 -0000
Received: from mx1.comptel.com (HELO mx1.comptel.com) (195.237.145.102)
	by server-2.tower-180.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 14 Dec 2010 18:58:16 -0000
Received: from comptelexc1.ctldomain.ad.local (comptelexc1 [172.21.184.15])
	by mx1.comptel.com (8.13.1/8.13.1) with ESMTP id oBEIwFNi030052
	for <libssh2-devel@cool.haxx.se>; Tue, 14 Dec 2010 20:58:15 +0200
Received: from comptelexc1.ctldomain.ad.local ([172.21.184.15]) by
	comptelexc1.ctldomain.ad.local ([172.21.184.15]) with mapi;
	Tue, 14 Dec 2010 20:58:14 +0200
From: Mononen Jussi <Jussi.Mononen@comptel.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Date: Tue, 14 Dec 2010 20:58:14 +0200
Subject: RE: SFTP download speeds
Thread-Topic: SFTP download speeds
Thread-Index: AcubwAoLyKQqWGTcRYGjhPeIvXM/vgAAK+sg
Message-ID: <095661E4E489344DA384BFA7024DEF45034FCD0D1E@comptelexc1.ctldomain.ad.local>
References: <alpine.DEB.2.00.1012140032240.16941@tvnag.unkk.fr>
	<20101214185049.GA16539@coneharvesters.com>
In-Reply-To: <20101214185049.GA16539@coneharvesters.com>
Accept-Language: en-US, fi-FI
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US, fi-FI
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 14 Dec 2010 19:58:25 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 14 Dec 2010 19:58:21 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

> >  When we use this approach we have a significant over-read
> for small
> > files. If  we for example were to write an application that
> moves over
> > a directory with  100 files, each being 20 bytes, we would perform
> > terribly slow and waste a  lot of bandwidth.
>
> One approach could be to use a slow-start that only queues a
> few over-reads at the start, then increases the window
> exponentially to a maximum of 4 MB as data is read. This
> shouldn't penalize the small file case much while (hopefully)
> allowing large file transfers to happen reasonably quickly.

AFAIK this is what OpenSSH does, it starts with few packets and then starts to fill the bandwidth.

Amazing improvements on perf!

Br,

--
You have to step outside the box to see it.

Disclaimer: This message and any attachments thereto are intended solely for the addressed recipient(s) and may contain confidential information.
If you are not the intended recipient, please notify the sender by reply e-mail and delete the e-mail (including any attachments thereto) without producing, distributing or retaining any copies thereof. Any review, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient(s) is prohibited.
Thank you.
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Dec 14 22:12:16 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBELC38R027947;
	Tue, 14 Dec 2010 22:12:15 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id oBELC2MX027866
	for <libssh2-devel@cool.haxx.se>; Tue, 14 Dec 2010 22:12:02 +0100
Received: (qmail 3705 invoked by uid 501); 14 Dec 2010 21:11:58 -0000
Message-ID: <20101214211158.3704.qmail@stuge.se>
Date: Tue, 14 Dec 2010 22:11:57 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: The little SFTP flaw I found
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <alpine.DEB.2.00.1012141409390.16941@tvnag.unkk.fr>
	<AANLkTiktK8cMJFJfLA2QuY+jW_6PZRtmUOzvzLpFBhmz@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <AANLkTiktK8cMJFJfLA2QuY+jW_6PZRtmUOzvzLpFBhmz@mail.gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 14 Dec 2010 22:12:16 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 14 Dec 2010 22:12:02 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Jose Baars wrote:
> Maybe consider changing the linked list in a pre allocated array
> where the index has a direct relation to the sequence number
..
> It will use a bit more memory, but a lot less CPU,

It's a solid optimization in many cases, but the impact obviously
depends on list length. I guess we don't have many enough packets
on that list in libssh2 for the list itself to be a problem, or..?


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

From libssh2-devel-bounces@cool.haxx.se  Tue Dec 14 23:43:12 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBEM4QdM002714;
	Tue, 14 Dec 2010 23:04:34 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBEM4OKn002632
	for <libssh2-devel@cool.haxx.se>; Tue, 14 Dec 2010 23:04:24 +0100
Date: Tue, 14 Dec 2010 23:04:24 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: The little SFTP flaw I found
In-Reply-To: <20101214211158.3704.qmail@stuge.se>
Message-ID: <alpine.DEB.2.00.1012142257240.29000@tvnag.unkk.fr>
References: <alpine.DEB.2.00.1012141409390.16941@tvnag.unkk.fr>
	<AANLkTiktK8cMJFJfLA2QuY+jW_6PZRtmUOzvzLpFBhmz@mail.gmail.com>
	<20101214211158.3704.qmail@stuge.se>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 14 Dec 2010 23:04:36 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 14 Dec 2010 23:04:24 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Tue, 14 Dec 2010, Peter Stuge wrote:

>> It will use a bit more memory, but a lot less CPU,
>
> It's a solid optimization in many cases, but the impact obviously depends on 
> list length. I guess we don't have many enough packets on that list in 
> libssh2 for the list itself to be a problem, or..?

I don't think we can easily switch to using arrays instead of the lists we 
have. Also, the lists I've added for the pipelined SFTP stuff are typically 
not searched through very far and we don't search in them so we can't bsearch 
there.

I do think we can use hash tables for some of the incoming packet storage 
(both SFTP and regular SSH layer) but I'm not convinced we have a lot to gain 
from that.

BTW, I did re-run my SFTP download tests against localhost with everything 
built with gcc -O2 and then we reach 40MB/sec and thus openssh is only ~10% 
faster.

I'll see if I can extract some additional info using some profiling later on.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 15 09:00:22 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBF801kH028063;
	Wed, 15 Dec 2010 09:00:19 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id oBF7xxno028058
	for <libssh2-devel@cool.haxx.se>; Wed, 15 Dec 2010 09:00:00 +0100
Received: (qmail 7162 invoked by uid 501); 15 Dec 2010 07:59:59 -0000
Message-ID: <20101215075959.7161.qmail@stuge.se>
Date: Wed, 15 Dec 2010 08:59:59 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: libssh2 master 2f0c0ce SFTP: store request_id separately in
	packets
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <20101215074859.18138.qmail@earth.stuge.se>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20101215074859.18138.qmail@earth.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 15 Dec 2010 09:00:22 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 15 Dec 2010 09:00:00 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

libssh2@git.stuge.se wrote:
> +++ b/src/sftp.h
> @@ -64,6 +64,15 @@ struct sftp_pipeline_chunk {
>  #define MIN(x,y) ((x)<(y)?(x):(y))
>  #endif
>  
> +struct _LIBSSH2_SFTP_PACKET
> +{
> +    struct list_node node;   /* linked list header */
> +    int request_id;
> +    unsigned char *data;
> +    size_t data_len;              /* payload size */
> +};

Remember to use data types that match the protocol on wire.
request_id is uint32, so must not be int here, or anywhere else in
our code.


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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 15 09:01:59 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBF81vna031627;
	Wed, 15 Dec 2010 09:01:59 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBF81uwo031574
	for <libssh2-devel@cool.haxx.se>; Wed, 15 Dec 2010 09:01:56 +0100
Date: Wed, 15 Dec 2010 09:01:56 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: libssh2 master 2f0c0ce SFTP: store request_id separately in
	packets
In-Reply-To: <20101215075959.7161.qmail@stuge.se>
Message-ID: <alpine.DEB.2.00.1012150901050.29000@tvnag.unkk.fr>
References: <20101215074859.18138.qmail@earth.stuge.se>
	<20101215075959.7161.qmail@stuge.se>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 15 Dec 2010 09:01:59 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 15 Dec 2010 09:01:56 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Wed, 15 Dec 2010, Peter Stuge wrote:

> Remember to use data types that match the protocol on wire. request_id is 
> uint32, so must not be int here, or anywhere else in our code.

Very true. I made it 'int' there because it is 'int' all over the code 
already.

In this particular case it's pretty harmless, but we should nonetheless fix 
it...

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 15 11:48:09 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBFAlrjM010575;
	Wed, 15 Dec 2010 11:48:06 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id oBFAlpiT010558
	for <libssh2-devel@cool.haxx.se>; Wed, 15 Dec 2010 11:47:51 +0100
Received: (qmail 3892 invoked by uid 501); 15 Dec 2010 10:47:46 -0000
Message-ID: <20101215104746.3891.qmail@stuge.se>
Date: Wed, 15 Dec 2010 11:47:46 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: trac.libssh2.org / git.libssh2.org planned downtime
Mail-Followup-To: libssh2-devel@cool.haxx.se
MIME-Version: 1.0
Content-Disposition: inline
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 15 Dec 2010 11:48:09 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 15 Dec 2010 11:47:51 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hi,

I will be moving the server that is hosting Trac and git to another
data center this Friday around 1500 UTC. I expect no more than two
hours of outage during the move, and ideally less than an hour.

Apologies if this causes you any problems.


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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 15 19:02:25 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBFI21RI002719;
	Wed, 15 Dec 2010 19:02:19 +0100
Received: from imail.ipswitch.com (imail.ipswitch.com [156.21.1.5])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBFI1wZO002490
	for <libssh2-devel@cool.haxx.se>; Wed, 15 Dec 2010 19:01:59 +0100
DKIM-Signature: q=dns/txt; v=1; c=relaxed/relaxed; s=ipswitch;
	d=ipswitch.com; a=rsa-sha1;
	h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:
	Content-Transfer-Encoding;
	b=QZeW/c9t9pf19KA4gI5Uvfhsb3wwRBIKGcEnkraM5NVFnecRrzxl+MkfLMU2b0opiZ
	Z2d3X+UPtR05uZ5fikWJVcgEpwudIbX/3etAGwLu1yVdz+MqweioVhWYa47HTVXitO2k
	RwHDVnjWGk/4veuU4lTNnZhidzupjNcXqPruQ=;
	bh=ttZ/SXtnSYVo/mFeW+L1Vq/kKoA=; t=1292436109;
Received: from mrrnt [66.170.5.130] by ipswitch.com with ESMTP
	(SMTPD-11.03) id 579a0029db0970be; Wed, 15 Dec 2010 13:01:49 -0500
From: "Mark Riordan" <mriordan@ipswitch.com>
To: "'libssh2 development'" <libssh2-devel@cool.haxx.se>
Subject: libssh2 pubkey authentication with private key only
Date: Wed, 15 Dec 2010 12:01:49 -0600
Message-ID: <000f01cb9c82$257f4390$707dcab0$@com>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AcucgiOuDilHVWs+QcW5D+F8jUzhpQ==
Content-Language: en-us
x-cr-hashedpuzzle: AOkp BMwG Bou9 CWh/ Crrq C1UT C3Pt DrHJ GQvf GuXG IMye IZ4Y
	Iz8H JEud KP9e KeJf; 1;
	bABpAGIAcwBzAGgAMgAtAGQAZQB2AGUAbABAAGMAbwBvAGwALgBoAGEAeAB4AC4AcwBlAA==;
	Sosha1_v1; 7; {8EA8471F-27EF-4A57-A11F-F5A2AD5CCD82};
	bQByAGkAbwByAGQAYQBuAEAAaQBwAHMAdwBpAHQAYwBoAC4AYwBvAG0A;
	Wed, 15 Dec 2010 18:01:46 GMT;
	bABpAGIAcwBzAGgAMgAgAHAAdQBiAGsAZQB5ACAAYQB1AHQAaABlAG4AdABpAGMAYQB0AGkAbwBuACAAdwBpAHQAaAAgAHAAcgBpAHYAYQB0AGUAIABrAGUAeQAgAG8AbgBsAHkA
x-cr-puzzleid: {8EA8471F-27EF-4A57-A11F-F5A2AD5CCD82}
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 15 Dec 2010 19:02:25 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 15 Dec 2010 19:02:00 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

I am trying to figure out how to use public key authentication
in libssh2 when I only have the private key file.
It appears that libssh2 also wants the public key file.
The private key file does have enough information to reconstruct
the public portion of the key, and indeed most SSH packages
do not require the client to have both files.

Is there a way in libssh2 to derive the public key from the
private key, or otherwise make it unnecessary for the user
to have the public key file?  I've been reading the doc 
(and the code a bit) and haven't figured one out yet.

Thanks.

Mark R


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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec 16 00:16:28 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBFNGA1o019023;
	Thu, 16 Dec 2010 00:16:26 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBFNG9k0019008
	for <libssh2-devel@cool.haxx.se>; Thu, 16 Dec 2010 00:16:09 +0100
Date: Thu, 16 Dec 2010 00:16:09 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: libssh2 pubkey authentication with private key only
In-Reply-To: <000f01cb9c82$257f4390$707dcab0$@com>
Message-ID: <alpine.DEB.2.00.1012160014230.11896@tvnag.unkk.fr>
References: <000f01cb9c82$257f4390$707dcab0$@com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 16 Dec 2010 00:16:28 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 16 Dec 2010 00:16:09 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Wed, 15 Dec 2010, Mark Riordan wrote:

> Is there a way in libssh2 to derive the public key from the private key, or 
> otherwise make it unnecessary for the user to have the public key file? 
> I've been reading the doc (and the code a bit) and haven't figured one out 
> yet.

Are you looking for Mark Smith's patch perhaps?

   http://www.libssh2.org/mail/libssh2-devel-archive-2010-12/0009.shtml

We've been discussing on IRC recently how to proceed with this due to the 
missing gcrypt support, but I think I'm in favour of adding this feature for 
openssl-builds as a start even if nobody steps up to do the gcrypt side of it 
just yet.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec 16 00:25:18 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBFNPEcW028637;
	Thu, 16 Dec 2010 00:25:16 +0100
Received: from imail.ipswitch.com (imail.ipswitch.com [156.21.1.5])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBFNPBTo028566
	for <libssh2-devel@cool.haxx.se>; Thu, 16 Dec 2010 00:25:12 +0100
DKIM-Signature: q=dns/txt; v=1; c=relaxed/relaxed; s=ipswitch;
	d=ipswitch.com; a=rsa-sha1;
	h=From:To:References:In-Reply-To:Subject:Date:Message-ID:
	MIME-Version:Content-Type:Content-Transfer-Encoding;
	b=dZhy3BG8VOmzYmS2PWlcv2yqfyf5OLzyxv7aS0tz+usXmV/C8wbOdSeH1v+MKAYFCH
	NwiwaVhkSQorwi72txVVoK7Yoyn2v+Hhu9n6NgRo1bIpiB1Q/JalQqUIrOh5D2dxzutY
	HO+Sa457PXH4rtnq4M4nhsWuO2aFPLkkXiSf8=;
	bh=E2x7Ge+Z0P0C1f69STiMAMyeP+U=; t=1292455501;
Received: from mrrnt [66.170.5.130] by ipswitch.com with ESMTP
	(SMTPD-11.03) id fa0c002a21c17947; Wed, 15 Dec 2010 18:25:00 -0500
From: "Mark Riordan" <mriordan@ipswitch.com>
To: "'libssh2 development'" <libssh2-devel@cool.haxx.se>
References: <000f01cb9c82$257f4390$707dcab0$@com>
	<alpine.DEB.2.00.1012160014230.11896@tvnag.unkk.fr>
In-Reply-To: <alpine.DEB.2.00.1012160014230.11896@tvnag.unkk.fr>
Subject: RE: libssh2 pubkey authentication with private key only
Date: Wed, 15 Dec 2010 17:25:00 -0600
Message-ID: <000601cb9caf$4c1bc7d0$e4535770$@com>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AcucrlXsxb4V4VTBTgepWuW1EdTyMQAAFNOw
Content-Language: en-us
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 16 Dec 2010 00:25:18 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 16 Dec 2010 00:25:12 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Daniel said:
>Are you looking for Mark Smith's patch perhaps?
>
>  http://www.libssh2.org/mail/libssh2-devel-archive-2010-12/0009.shtml

Whoa, I guess I missed that email.  
That looks like exactly what I need.

Thanks, Daniel and Mark S.

/mrr


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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec 16 00:57:33 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBFNvP5m012125;
	Thu, 16 Dec 2010 00:57:33 +0100
Received: from shell.lmi.net (shell.lmi.net [66.117.140.246])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBFNvMtw012105
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 16 Dec 2010 00:57:24 +0100
Received: from rcom-software.com (75-101-82-95.dsl2st.lmi.net [75.101.82.95])
	by shell.lmi.net (8.14.1/8.14.1) with ESMTP id oBFNvF1b084335
	for <libssh2-devel@cool.haxx.se>; Wed, 15 Dec 2010 15:57:16 -0800 (PST)
Message-ID: <4D09557F.E1B5E8FB@rcom-software.com>
Date: Wed, 15 Dec 2010 15:55:43 -0800
From: Paul Romero <paulr@rcom-software.com>
Organization: RCOM Communications Software
X-Mailer: Mozilla 4.77 [en] (Win95; U)
X-Accept-Language: en,es,de-DE,fr-FR
MIME-Version: 1.0
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: libssh2 pubkey authentication with private key only
References: <000f01cb9c82$257f4390$707dcab0$@com>
	<alpine.DEB.2.00.1012160014230.11896@tvnag.unkk.fr>
X-Scanned-By: MIMEDefang 2.37
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 16 Dec 2010 00:57:33 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 16 Dec 2010 00:57:24 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se



Daniel Stenberg wrote:

> On Wed, 15 Dec 2010, Mark Riordan wrote:
>
> > Is there a way in libssh2 to derive the public key from the private key, or
> > otherwise make it unnecessary for the user to have the public key file?
> > I've been reading the doc (and the code a bit) and haven't figured one out
> > yet.
>
> Are you looking for Mark Smith's patch perhaps?
>
>    http://www.libssh2.org/mail/libssh2-devel-archive-2010-12/0009.shtml
>
> We've been discussing on IRC recently how to proceed with this due to the
> missing gcrypt support, but I think I'm in favour of adding this feature for
> openssl-builds as a start even if nobody steps up to do the gcrypt side of it
> just yet.
>

Is this related to the fact the libgcrypt can't decode
passphrase encrypted private RSA keys ?


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

--
Paul Romero

RCOM Communications Software

Phone/Fax: (510)339-2628
E-Mail: paulr@rcom-software.com


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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec 16 07:39:33 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBG6dAI8007015;
	Thu, 16 Dec 2010 07:39:29 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id oBG6d8hM006997
	for <libssh2-devel@cool.haxx.se>; Thu, 16 Dec 2010 07:39:08 +0100
Received: (qmail 20318 invoked by uid 501); 16 Dec 2010 06:39:05 -0000
Message-ID: <20101216063905.20317.qmail@stuge.se>
Date: Thu, 16 Dec 2010 07:39:05 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: libssh2 pubkey authentication with private key only
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <000f01cb9c82$257f4390$707dcab0$@com>
	<alpine.DEB.2.00.1012160014230.11896@tvnag.unkk.fr>
	<4D09557F.E1B5E8FB@rcom-software.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <4D09557F.E1B5E8FB@rcom-software.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 16 Dec 2010 07:39:33 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 16 Dec 2010 07:39:08 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Paul Romero wrote:
> > We've been discussing on IRC recently how to proceed with this
> > due to the missing gcrypt support, but I think I'm in favour of
> > adding this feature for openssl-builds as a start even if nobody
> > steps up to do the gcrypt side of it just yet.
> 
> Is this related to the fact the libgcrypt can't decode
> passphrase encrypted private RSA keys ?

No, that's a separate issue. Deriving public key from an unencrypted
private key using libgcrypt should be much less of an effort than
supporting encrypted keys.


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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec 16 17:22:39 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBGGMN6w031194;
	Thu, 16 Dec 2010 17:22:36 +0100
Received: from shell.lmi.net (shell.lmi.net [66.117.140.246])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBGGMK3x031181
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Thu, 16 Dec 2010 17:22:22 +0100
Received: from rcom-software.com (75-101-82-95.dsl2st.lmi.net [75.101.82.95])
	by shell.lmi.net (8.14.1/8.14.1) with ESMTP id oBGGMCXk007518
	for <libssh2-devel@cool.haxx.se>; Thu, 16 Dec 2010 08:22:16 -0800 (PST)
Message-ID: <4D0A3C58.9CCFACFD@rcom-software.com>
Date: Thu, 16 Dec 2010 08:20:40 -0800
From: Paul Romero <paulr@rcom-software.com>
Organization: RCOM Communications Software
X-Mailer: Mozilla 4.77 [en] (Win95; U)
X-Accept-Language: en,es,de-DE,fr-FR
MIME-Version: 1.0
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: libssh2 pubkey authentication with private key only
References: <000f01cb9c82$257f4390$707dcab0$@com>
	<alpine.DEB.2.00.1012160014230.11896@tvnag.unkk.fr>
	<4D09557F.E1B5E8FB@rcom-software.com>
	<20101216063905.20317.qmail@stuge.se>
X-Scanned-By: MIMEDefang 2.37
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 16 Dec 2010 17:22:39 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 16 Dec 2010 17:22:22 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se



Peter Stuge wrote:

> Paul Romero wrote:
> > > We've been discussing on IRC recently how to proceed with this
> > > due to the missing gcrypt support, but I think I'm in favour of
> > > adding this feature for openssl-builds as a start even if nobody
> > > steps up to do the gcrypt side of it just yet.
> >
> > Is this related to the fact the libgcrypt can't decode
> > passphrase encrypted private RSA keys ?
>
> No, that's a separate issue. Deriving public key from an unencrypted
> private key using libgcrypt should be much less of an effort than
> supporting encrypted keys.

If my memory is right, the scope of the problem I mentioned
is limited to decrypting a key.  I looked at the code and the
task does not look technically complex. However, identifying
the relevant section of the standards is another matter.



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

--
Paul Romero

RCOM Communications Software

Phone/Fax: (510)339-2628
E-Mail: paulr@rcom-software.com


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

From libssh2-devel-bounces@cool.haxx.se  Fri Dec 17 07:16:44 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBH6GRG1002281;
	Fri, 17 Dec 2010 07:16:41 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id oBH6GPdo002264
	for <libssh2-devel@cool.haxx.se>; Fri, 17 Dec 2010 07:16:25 +0100
Received: (qmail 3146 invoked by uid 501); 17 Dec 2010 06:16:21 -0000
Message-ID: <20101217061621.3145.qmail@stuge.se>
Date: Fri, 17 Dec 2010 07:16:21 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: libssh2 master 5ee3870 ssh2_echo: Value stored to 'exitcode'
	is never read
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <20101215205903.1649.qmail@earth.stuge.se>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20101215205903.1649.qmail@earth.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Fri, 17 Dec 2010 07:16:44 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Fri, 17 Dec 2010 07:16:25 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

libssh2@git.stuge.se wrote:
> commit 2165ceacd37d266fecb3d1298ea260ce0e334267
> Author: Daniel Stenberg <daniel@haxx.se>
..
> +++ b/src/libssh2_priv.h
> @@ -340,7 +339,7 @@ struct _LIBSSH2_CHANNEL
>  
>      libssh2_channel_data local, remote;
>      /* Amount of bytes to be refunded to receive window (but not yet sent) */
> -    unsigned long adjust_queue;
> +    int adjust_queue;

Why make this signed? It's used in calculations in
_libssh2_channel_receive_window_adjust() where the other values
involved are always unsigned.


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

From libssh2-devel-bounces@cool.haxx.se  Sat Dec 18 02:11:25 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBI1B1NM021484;
	Sat, 18 Dec 2010 02:11:20 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id oBI1Ax26021465
	for <libssh2-devel@cool.haxx.se>; Sat, 18 Dec 2010 02:10:59 +0100
Received: (qmail 9629 invoked by uid 501); 18 Dec 2010 01:10:53 -0000
Message-ID: <20101218011053.9628.qmail@stuge.se>
Date: Sat, 18 Dec 2010 02:10:53 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: trac.libssh2.org / git.libssh2.org back online
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <20101215104746.3891.qmail@stuge.se>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <20101215104746.3891.qmail@stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sat, 18 Dec 2010 02:11:25 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sat, 18 Dec 2010 02:10:59 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Peter Stuge wrote:
> I expect no more than two hours of outage during the move,

Or so I thought..

The move started a bit late, and took a lot longer than anticipated             
(about four hours downtime, ca. 17-21 UTC) because of an access card            
issue. Many a snowflake later the server is running again.                      


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

From libssh2-devel-bounces@cool.haxx.se  Sun Dec 19 00:33:06 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBINWird028312;
	Sun, 19 Dec 2010 00:33:01 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBINWgpN028298
	for <libssh2-devel@cool.haxx.se>; Sun, 19 Dec 2010 00:32:42 +0100
Date: Sun, 19 Dec 2010 00:32:42 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: RE: Using libssh2_userauth_publickey_fromfile() when I don't have
	a public key
In-Reply-To: <D56EF17649304BB28EE7861D1847457B@internal.avcosystems.com>
Message-ID: <alpine.DEB.2.00.1012190030540.9552@tvnag.unkk.fr>
References: <899419.69857.qm@web45307.mail.sp1.yahoo.com><4CD3CA48.4060403@peut.org><702C2A8AA0DB49DE8D4C4A6456A05A1D@internal.avcosystems.com><AANLkTinJWbiGKfJLkDkMybC_ScszeWdi03VrTVaUFHpw@mail.gmail.com><0B0C709AC25D4C4BB7E760234B8591FD@internal.avcosystems.com><87r5ezzzjm.fsf@latte.josefsson.org><alpine.DEB.2.00.1011051420150.26143@tvnag.unkk.fr><4CD40598.2070606@SDlabs.se>
	<alpine.DEB.2.00.1011051426550.26143@tvnag.unkk.fr>
	<D56EF17649304BB28EE7861D1847457B@internal.avcosystems.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Sun, 19 Dec 2010 00:33:06 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Sun, 19 Dec 2010 00:32:42 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Thu, 2 Dec 2010, Mark Smith wrote:

> As previously discussed, I have completed the public key patch and 
> refactored it for 1.2.8 to split the openssl-specific code into openssl.c 
> (and .h) and put stubs into gcrypt.

I've committed and pushed this change now, with some minor edits by me.

I don't like that we currently don't support this feature for gcrypt-powered 
versions, but I don't want to limit the openssl version just because of this. 
I'll try to have a look at it myself.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Mon Dec 20 15:01:27 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBKE141K006864;
	Mon, 20 Dec 2010 15:01:23 +0100
Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com
	[209.85.214.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBKE10NL006761
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Mon, 20 Dec 2010 15:01:01 +0100
Received: by iwn39 with SMTP id 39so3749759iwn.41
	for <libssh2-devel@cool.haxx.se>; Mon, 20 Dec 2010 06:00:55 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:mime-version:received:from:date
	:message-id:subject:to:content-type;
	bh=+fBxMTiDoRKeEJQVsJiEA4flV48OBdNTc6QCO7uHCWA=;
	b=k8aCDC15ohXGo/+TqSeiVWsCY/qFD1vAyJv0WcD0G6Xo/1nQp0AKR0BNXbCBPcJWiK
	mawALeSUVXw8LEnOFCp6YPPYMkvzy9Xh0jGOcQGO+CZCM99tRosJvDEfhEPCaQLWXvXf
	qQFhcZIdQ1rL7ZeFrbIBU8mmLab8VezP/OAV4=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:from:date:message-id:subject:to:content-type;
	b=j3h6Ms5X4ea7VcaXyqGyms0hbP7uGKU3srX355viGvq20TmNEDAOCeHslCd3yDXzEj
	KYvExtkBEdN/sj6updEWValSRSx8RRBHq4i45f3349kjjiIZnHFqMxAezc4YRetF4+38
	F82F8vLBm2Nut0hG+ioasyQNT6JNS9SEWGfH8=
Received: by 10.231.15.132 with SMTP id k4mr4023883iba.60.1292853655021; Mon,
	20 Dec 2010 06:00:55 -0800 (PST)
MIME-Version: 1.0
Received: by 10.231.141.210 with HTTP; Mon, 20 Dec 2010 06:00:34 -0800 (PST)
From: Dmitry Teslenko <dteslenko@gmail.com>
Date: Mon, 20 Dec 2010 17:00:34 +0300
Message-ID: <AANLkTink_XQAa_DJ5uUvqMnwPqLS1thqygqwtYT9VSXs@mail.gmail.com>
Subject: Need advice using channels from high level c++ framework (qt)
To: libssh2-devel@cool.haxx.se
Content-Type: multipart/mixed; boundary=00221534d3b3daab3f0497d7f2f5
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Mon, 20 Dec 2010 15:01:26 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Mon, 20 Dec 2010 15:01:01 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--00221534d3b3daab3f0497d7f2f5
Content-Type: text/plain; charset=UTF-8

Hello!
I need help on using libssh2 for forwading ports in c++ application
with high-level framework (qt4).
Currently I'm usging 1.2.6 libssh2 version.
I've started with direct_tcpip.c example and come with following:
1) establishing connection, setting up libssh2 session and authenticating
2) setting up listening tcp socket and starting framework event loop
3) on incoming connection setting up libssh2 channel
4) every second iterating over channel list and for each one
	reading data from socket and writing to libssh2 channel and vice versa
5) closing and freeing channel on socket disconnect

Source that can be compiled and run attached to message.
Here's example with libssh2 function calls:

	//authentication from example
	int libssh2_error = libssh2_init(0);
	...
	LIBSSH2_SESSION *session = libssh2_session_init();
	QTcpSocket socket;
	socket.connectToHost(...);
	if(!socket.waitForConnected())
	...
	libssh2_error = libssh2_session_startup(session, socket.socketDescriptor());
	...
	libssh2_userauth_list(session, ...);
	if(libssh2_userauth_password(...)
	...
	//setup local tcp socket

	//on incoming connection
	void openConnection()
	{
		QTcpServer *server = ...;
		QTcpSocket *socket = server->nextPendingConnection();

		libssh2_session_set_blocking(m_session, 1);
		LIBSSH2_CHANNEL *channel = libssh2_channel_direct_tcpip_ex(
			m_session,
			tunnel.m_host.toLocal8Bit().constData(),
        	tunnel.m_hostPort,
			server->serverAddress().toString().toLocal8Bit().constData(),
			server->serverPort()	
		);
	...
	//reading and writing data
	void transmit()
	{
		char buffer[4096];
		libssh2_session_set_blocking(m_session, 1);

		QTcpSocket *socket = ...;
		LIBSSH2_CHANNEL *channel = ...;

				int read = socket->read(buffer, sizeof(buffer));
				int written = 0;
				int i = 0;
				if(read > 0)
				{
					do
					{
						i = libssh2_channel_write(
							channel,
							buffer,
							read
						);
						if(i < 0)
						{
							...
						}

						written += i;
					} while (i > 0 && written < read);
				}
				while(true)
				{
					read = libssh2_channel_read(channel, buffer, sizeof(buffer));
					if(LIBSSH2_ERROR_EAGAIN == read)
					{
						break;
					}
					else if(read  < 0)
					{
						...
					}
					written = 0;
					while(written < read)
					{
						i = socket->write(buffer + written, read - written);
						if(i < 0)
						{
							...
						}
					}
					i = libssh2_channel_eof(channel);
					if(i)
					{
						...
					}

				}

	...
	//closing connection
		LIBSSH2_CHANNEL *channel = ...;
		if(channel)
		{
			//there's no libssh2_channel_close close in example
			//should I close channel on socket disconnect or not?
			//libssh2_channel_close(channel);
			//libssh2_channel_wait_closed(channel);
			libssh2_channel_free(channel);
		}

	...
	//cleanup
	socket.disconnectFromHost();
	libssh2_session_disconnect(session, "Client disconnecting normally");
	libssh2_session_free(session);
	libssh2_exit();


Example says all channel IO should go in unblocked mode, but in this mode
no data transfered without select()/poll() which I cant use in high
level networking API.
And in unblocked mode I can't setup new channel.

In blocking mode some data transferred, for example I can get html via
http with curl
through forwarded port but I have to wait about 15 seconds till
libssh2_channel_read
timeout. Using, say, ssh shell through forwarded port is unusable
because there's plenty of
timeouts to wait.

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

--00221534d3b3daab3f0497d7f2f5
Content-Type: text/x-c++src; charset=US-ASCII; name="qt.cpp"
Content-Disposition: attachment; filename="qt.cpp"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_ghxfn5v30

I2luY2x1ZGUgPFFBcHBsaWNhdGlvbj4NCg0KI2luY2x1ZGUgPFFEaWFsb2c+DQojaW5jbHVkZSA8
UVB1c2hidXR0b24+DQojaW5jbHVkZSA8UUxheW91dD4NCiNpbmNsdWRlIDxRTGFiZWw+DQojaW5j
bHVkZSA8UUxpbmVFZGl0Pg0KI2luY2x1ZGUgPFFTcGluYm94Pg0KI2luY2x1ZGUgPFFNZXNzYWdl
Qm94Pg0KI2luY2x1ZGUgPFFGb3JtTGF5b3V0Pg0KI2luY2x1ZGUgPFFMaXN0Vmlldz4NCiNpbmNs
dWRlIDxRU3RyaW5nTGlzdE1vZGVsPg0KI2luY2x1ZGUgPFFJbnB1dERpYWxvZz4NCiNpbmNsdWRl
IDxRU2V0dGluZ3M+DQoNCiNpbmNsdWRlIDxRVGNwU2VydmVyPg0KI2luY2x1ZGUgPFFUY3BTb2Nr
ZXQ+DQojaW5jbHVkZSA8UVRpbWVyPg0KI2luY2x1ZGUgPFFGaWxlPg0KDQojaW5jbHVkZSA8UU1h
cD4NCiNpbmNsdWRlIDxRTGlzdD4NCiNpbmNsdWRlIDxRU3RyaW5nPg0KI2luY2x1ZGUgPFFEYXRl
VGltZT4NCg0KI2luY2x1ZGUgImxpYnNzaDJfY29uZmlnLmgiDQojaW5jbHVkZSA8bGlic3NoMi5o
Pg0KI2luY2x1ZGUgPGxpYnNzaDJfc2Z0cC5oPg0KDQpzdHJ1Y3QgVHVubmVsSW5mbw0Kew0KCVFT
dHJpbmcgbV9iaW5kQWRkcmVzczsNCglpbnQgbV9wb3J0Ow0KCVFTdHJpbmcgbV9ob3N0Ow0KCWlu
dCBtX2hvc3RQb3J0Ow0KfTsNCg0KY2xhc3MgQ29ubmVjdERpYWxvZzogcHVibGljIFFEaWFsb2cg
DQp7DQoJUV9PQkpFQ1QNCnB1YmxpYzoNCg0KCUNvbm5lY3REaWFsb2coKSA6IFFEaWFsb2coMCkN
Cgl7DQoJCXNldHVwVWkoKTsNCgl9DQoNCglRU3RyaW5nIHVzZXIoKSBjb25zdCB7IHJldHVybiBt
X3VzZXI7IH0NCglRU3RyaW5nIHBhc3MoKSBjb25zdCB7IHJldHVybiBtX3Bhc3M7IH0NCglpbnQg
cG9ydCgpIGNvbnN0IHsgcmV0dXJuIG1fcG9ydDsgfQ0KCVFTdHJpbmcgaG9zdCgpIGNvbnN0IHsg
cmV0dXJuIG1faG9zdDsgfQ0KDQoJUUxpc3Q8VHVubmVsSW5mbz4gbG9jYWxUdW5uZWxzKCkgeyBy
ZXR1cm4gbV9sb2NhbFR1bm5lbHM7IH07DQoNCnB1YmxpYyBzbG90czoNCgl2b2lkIHNldFVzZXIo
Y29uc3QgUVN0cmluZyAmdXNlcikgeyBtX3VzZXIgPSB1c2VyOyBtX3NldHRpbmdzLnNldFZhbHVl
KCJ1c2VyIiwgdXNlcik7IH0NCgl2b2lkIHNldFBhc3MoY29uc3QgUVN0cmluZyAmcGFzcykgeyBt
X3Bhc3MgPSBwYXNzOyBtX3NldHRpbmdzLnNldFZhbHVlKCJwYXNzIiwgcGFzcyk7IH0NCgl2b2lk
IHNldFBvcnQoaW50IHBvcnQpIHsgbV9wb3J0ID0gcG9ydDsgbV9zZXR0aW5ncy5zZXRWYWx1ZSgi
cG9ydCIsIHBvcnQpOyB9DQoJdm9pZCBzZXRIb3N0KGNvbnN0IFFTdHJpbmcgJmhvc3QpIHsgbV9o
b3N0ID0gaG9zdDsgbV9zZXR0aW5ncy5zZXRWYWx1ZSgiaG9zdCIsIGhvc3QpOyB9DQoJdm9pZCBh
ZGRMb2NhbFR1bm5lbCgpIA0KCXsNCgkJUVN0cmluZyBzID0gUUlucHV0RGlhbG9nOjpnZXRUZXh0
KA0KCQkJdGhpcywNCgkJCXRyKCJBZGQgdHVubmVsIiksDQoJCQl0cigiRm9ybWF0OiBbYmluZF9h
ZGRyZXNzOl1wb3J0Omhvc3Q6aG9zdHBvcnQiKQ0KCQkpOw0KDQoJCVFTdHJpbmdMaXN0IGwgPSBz
LnNwbGl0KCI6IiwgUVN0cmluZzo6U2tpcEVtcHR5UGFydHMpOw0KCQlpZihsLnNpemUoKSA8IDMg
fHwgbC5zaXplKCkgPiA0KQ0KCQl7DQoJCQlRTWVzc2FnZUJveDo6Y3JpdGljYWwodGhpcywgdHIo
IkFkZCB0dW5uZWwiKSwgdHIoIkludmFsaWQgZm9ybWF0IikpOw0KCQkJcmV0dXJuOw0KCQl9DQoN
CgkJVHVubmVsSW5mbyBsdDsNCgkJaWYobC5zaXplKCkgPT0gNCkNCgkJew0KCQkJbHQubV9iaW5k
QWRkcmVzcyA9IGwudGFrZUZpcnN0KCk7DQoJCX0NCgkJbHQubV9wb3J0ID0gbC50YWtlRmlyc3Qo
KS50b0ludCgpOw0KCQlsdC5tX2hvc3QgPSBsLnRha2VGaXJzdCgpOw0KCQlsdC5tX2hvc3RQb3J0
ID0gbC50YWtlRmlyc3QoKS50b0ludCgpOw0KCQltX2xvY2FsVHVubmVscyA8PCBsdDsNCg0KCQlt
X2xvY2FsVHVubmVsc01vZGVsLnNldFN0cmluZ0xpc3QoDQoJCQltX2xvY2FsVHVubmVsc01vZGVs
LnN0cmluZ0xpc3QoKSA8PCBzDQoJCSk7DQoJfQ0KcHJpdmF0ZToNCgl2b2lkIHNldHVwVWkoKQ0K
CXsNCgkJUVZCb3hMYXlvdXQgKmxheW91dCA9IG5ldyBRVkJveExheW91dCh0aGlzKTsNCgkJUUZv
cm1MYXlvdXQgKmNvbnRyb2xzTGF5b3V0ID0gbmV3IFFGb3JtTGF5b3V0Ow0KDQoJCVFMaW5lRWRp
dCAqdXNlckVkaXQgPSBuZXcgUUxpbmVFZGl0KHRoaXMpOw0KCQljb25uZWN0KHVzZXJFZGl0LCBT
SUdOQUwodGV4dENoYW5nZWQoY29uc3QgUVN0cmluZyAmKSksIA0KCQkJdGhpcywgU0xPVChzZXRV
c2VyKGNvbnN0IFFTdHJpbmcgJikpKTsNCgkJY29udHJvbHNMYXlvdXQtPmFkZFJvdyh0cigiVXNl
cm5hbWUiKSwgdXNlckVkaXQpOyANCgkJdXNlckVkaXQtPnNldFRleHQobV9zZXR0aW5ncy52YWx1
ZSgidXNlciIpLnRvU3RyaW5nKCkpOw0KDQoJCVFMaW5lRWRpdCAqcGFzc0VkaXQgPSBuZXcgUUxp
bmVFZGl0KHRoaXMpOw0KCQlwYXNzRWRpdC0+c2V0RWNob01vZGUoUUxpbmVFZGl0OjpQYXNzd29y
ZCk7DQoJCWNvbm5lY3QocGFzc0VkaXQsIFNJR05BTCh0ZXh0Q2hhbmdlZChjb25zdCBRU3RyaW5n
ICYpKSwgDQoJCQl0aGlzLCBTTE9UKHNldFBhc3MoY29uc3QgUVN0cmluZyAmKSkpOw0KCQljb250
cm9sc0xheW91dC0+YWRkUm93KHRyKCJQYXNzd29yZCIpLCBwYXNzRWRpdCk7DQoJCXBhc3NFZGl0
LT5zZXRUZXh0KG1fc2V0dGluZ3MudmFsdWUoInBhc3MiKS50b1N0cmluZygpKTsNCg0KCQlRTGlu
ZUVkaXQgKmhvc3RFZGl0ID0gbmV3IFFMaW5lRWRpdCh0aGlzKTsNCgkJY29ubmVjdChob3N0RWRp
dCwgU0lHTkFMKHRleHRDaGFuZ2VkKGNvbnN0IFFTdHJpbmcgJikpLCANCgkJCXRoaXMsIFNMT1Qo
c2V0SG9zdChjb25zdCBRU3RyaW5nICYpKSk7DQoJCWNvbnRyb2xzTGF5b3V0LT5hZGRSb3codHIo
Ikhvc3QiKSwgaG9zdEVkaXQpOw0KCQlob3N0RWRpdC0+c2V0VGV4dChtX3NldHRpbmdzLnZhbHVl
KCJob3N0IikudG9TdHJpbmcoKSk7DQoNCgkJUVNwaW5Cb3ggKnBvcnRFZGl0ID0gbmV3IFFTcGlu
Qm94KHRoaXMpOw0KCQlwb3J0RWRpdC0+c2V0TWluaW11bSgxKTsNCgkJcG9ydEVkaXQtPnNldE1h
eGltdW0oNTAwMDApOw0KDQoJCWNvbm5lY3QocG9ydEVkaXQsIFNJR05BTCh2YWx1ZUNoYW5nZWQo
aW50KSksDQoJCQl0aGlzLCBTTE9UKHNldFBvcnQoaW50KSkpOw0KCQljb250cm9sc0xheW91dC0+
YWRkUm93KHRyKCJQb3J0IiksIHBvcnRFZGl0KTsNCgkJbGF5b3V0LT5hZGRMYXlvdXQoY29udHJv
bHNMYXlvdXQpOw0KCQlwb3J0RWRpdC0+c2V0VmFsdWUobV9zZXR0aW5ncy52YWx1ZSgicG9ydCIp
LnRvSW50KCkpOw0KDQoJCVFMaXN0VmlldyAqbGlzdFZpZXcgPSBuZXcgUUxpc3RWaWV3Ow0KCQls
aXN0Vmlldy0+c2V0TW9kZWwoJm1fbG9jYWxUdW5uZWxzTW9kZWwpOw0KCQlsYXlvdXQtPmFkZFdp
ZGdldChsaXN0Vmlldyk7DQoNCgkJUUhCb3hMYXlvdXQgKmJ1dHRvbkxheW91dCA9IG5ldyBRSEJv
eExheW91dDsNCgkJUVB1c2hCdXR0b24gKmFkZExvY2FsVHVubmVsQnV0dG9uID0gbmV3IFFQdXNo
QnV0dG9uKHRyKCJBZGQgdHVubmVsIikpOw0KCQljb25uZWN0KGFkZExvY2FsVHVubmVsQnV0dG9u
LCBTSUdOQUwoY2xpY2tlZCgpKSwgdGhpcywgU0xPVChhZGRMb2NhbFR1bm5lbCgpKSk7DQoJCWJ1
dHRvbkxheW91dC0+YWRkV2lkZ2V0KGFkZExvY2FsVHVubmVsQnV0dG9uKTsNCgkJYnV0dG9uTGF5
b3V0LT5hZGRTdHJldGNoKCk7DQoJCVFQdXNoQnV0dG9uICpva0J1dHRvbiA9IG5ldyBRUHVzaEJ1
dHRvbih0cigiT2siKSk7DQoJCWNvbm5lY3Qob2tCdXR0b24sIFNJR05BTChjbGlja2VkKCkpLCB0
aGlzLCBTTE9UKGFjY2VwdCgpKSk7DQoJCW9rQnV0dG9uLT5zZXREZWZhdWx0KHRydWUpOw0KCQli
dXR0b25MYXlvdXQtPmFkZFdpZGdldChva0J1dHRvbik7DQoJCVFQdXNoQnV0dG9uICpjYW5jZWxC
dXR0b24gPSBuZXcgUVB1c2hCdXR0b24odHIoIkNhbmNlbCIpKTsNCgkJY29ubmVjdChjYW5jZWxC
dXR0b24sIFNJR05BTChjbGlja2VkKCkpLCB0aGlzLCBTTE9UKHJlamVjdCgpKSk7DQoJCWJ1dHRv
bkxheW91dC0+YWRkV2lkZ2V0KGNhbmNlbEJ1dHRvbik7DQoJCWxheW91dC0+YWRkTGF5b3V0KGJ1
dHRvbkxheW91dCk7DQoNCgkJcmVzaXplKDMwMCwgMjAwKTsNCgl9DQpwcml2YXRlOg0KCVFTdHJp
bmcgbV91c2VyLCBtX3Bhc3MsIG1faG9zdDsNCglpbnQgbV9wb3J0Ow0KCVFMaXN0PFR1bm5lbElu
Zm8+IG1fbG9jYWxUdW5uZWxzOwkNCglRU3RyaW5nTGlzdE1vZGVsIG1fbG9jYWxUdW5uZWxzTW9k
ZWw7DQoJUVNldHRpbmdzIG1fc2V0dGluZ3M7DQp9Ow0KDQpjbGFzcyBMb2NhbFR1bm5lbE1hbmFn
ZXIgOiBwdWJsaWMgUU9iamVjdA0Kew0KCVFfT0JKRUNUDQpwdWJsaWM6DQoJTG9jYWxUdW5uZWxN
YW5hZ2VyKExJQlNTSDJfU0VTU0lPTiAqc2Vzc2lvbiwgY29uc3QgUUxpc3Q8VHVubmVsSW5mbz4g
Jmxpc3QpIA0KCQk6bV9zZXNzaW9uKHNlc3Npb24pIA0KCXsNCgkJZm9yKFFMaXN0PFR1bm5lbElu
Zm8+Ojpjb25zdF9pdGVyYXRvciBpdCA9IGxpc3QuYmVnaW4oKTsgaXQgIT0gbGlzdC5lbmQoKTsg
KytpdCkNCgkJew0KCQkJc2V0dXBMb2NhbFNlcnZlcigqaXQpOw0KCQl9DQoJfQ0KcHVibGljIHNs
b3RzOg0KCXZvaWQgdHJhbnNtaXQoKQ0KCXsNCg0KCQlxRGVidWcoIkxvY2FsVHVubmVsTWFuYWdl
cjogdHJhbnNtaXQoKSA+Pj4gJWkgY2hhbm5lbHMiLCBtX3NvY2tldENoYW5uZWxNYXAuc2l6ZSgp
KTsNCgkJY2hhciBidWZmZXJbNDA5Nl07DQoNCgkJLyoNCgkJd2hpbGUodHJ1ZSkNCgkJew0KCQkJ
Ki8NCg0KCQkJLy9RQXBwbGljYXRpb246OnByb2Nlc3NFdmVudHMoKTsNCg0KCQkJLyoNCgkJCWlm
KG1fc29ja2V0Q2hhbm5lbE1hcC5pc0VtcHR5KCkpDQoJCQl7DQoJCQkJYnJlYWs7DQoJCQl9Ki8N
Cg0KCQkJCWxpYnNzaDJfc2Vzc2lvbl9zZXRfYmxvY2tpbmcobV9zZXNzaW9uLCAxKTsNCgkJCWZv
cihTb2NrZXRDaGFubmVsTWFwOjppdGVyYXRvciBpdCA9IG1fc29ja2V0Q2hhbm5lbE1hcC5iZWdp
bigpOyANCgkJCQlpdCAhPSBtX3NvY2tldENoYW5uZWxNYXAuZW5kKCk7ICsraXQpDQoJCQl7DQoN
CgkJCQlRVGNwU29ja2V0ICpzb2NrZXQgPSBpdC5rZXkoKTsNCgkJCQlMSUJTU0gyX0NIQU5ORUwg
KmNoYW5uZWwgPSBpdC52YWx1ZSgpOw0KDQoNCgkJCQlxRGVidWcoIkxvY2FsVHVubmVsTWFuYWdl
cjogc29ja2V0LT5yZWFkKCkgPj4+Iik7DQoJCQkJaW50IHJlYWQgPSBzb2NrZXQtPnJlYWQoYnVm
ZmVyLCBzaXplb2YoYnVmZmVyKSk7DQoJCQkJUUJ5dGVBcnJheSBkZWJ1ZyA9IFFCeXRlQXJyYXko
YnVmZmVyLCByZWFkKTsNCgkJCQlxRGVidWcoIkxvY2FsVHVubmVsTWFuYWdlcjogc29ja2V0LT5y
ZWFkKCkgPDw8ICVpXG4lcyIsIHJlYWQsIGRlYnVnLmNvbnN0RGF0YSgpKTsNCgkJCQlpbnQgd3Jp
dHRlbiA9IDA7DQoJCQkJaW50IGkgPSAwOw0KCQkJCWlmKHJlYWQgPiAwKQ0KCQkJCXsNCgkJCQkJ
ZG8NCgkJCQkJew0KCQkJCQkJcURlYnVnKCJMb2NhbFR1bm5lbE1hbmFnZXI6IGxpYnNzaDJfY2hh
bm5lbF93cml0ZSgpID4+PiIpOw0KCQkJCQkJLyoNCgkJCQkJCWludCBpID0gbGlic3NoMl9jaGFu
bmVsX3dyaXRlKA0KCQkJCQkJCWNoYW5uZWwsIA0KCQkJCQkJCWJ1ZmZlciArIHdyaXR0ZW4sIA0K
CQkJCQkJCXJlYWQgLSB3cml0dGVuDQoJCQkJCQkpOw0KCQkJCQkJKi8NCgkJCQkJCWkgPSBsaWJz
c2gyX2NoYW5uZWxfd3JpdGUoDQoJCQkJCQkJY2hhbm5lbCwgDQoJCQkJCQkJYnVmZmVyLCANCgkJ
CQkJCQlyZWFkDQoJCQkJCQkpOw0KCQkJCQkJcURlYnVnKCJMb2NhbFR1bm5lbE1hbmFnZXI6IGxp
YnNzaDJfY2hhbm5lbF93cml0ZSgpIDw8PCAlaSIsIGkpOw0KCQkJCQkJaWYoaSA8IDApDQoJCQkJ
CQl7DQoJCQkJCQkJcURlYnVnKCAibGlic3NoMl9jaGFubmVsX3dyaXRlOiAlZFxuIiwgaSk7DQoJ
CQkJCQkJc2h1dGRvd25Db25uZWN0aW9uKHNvY2tldCwgY2hhbm5lbCk7DQoJCQkJCQkJZ290byBu
ZXh0X3NvY2tldDsNCgkJCQkJCX0NCgkJCQkJCXdyaXR0ZW4gKz0gaTsNCgkJCQkJfSB3aGlsZSAo
aSA+IDAgJiYgd3JpdHRlbiA8IHJlYWQpOw0KDQoJCQkJCXFEZWJ1ZygiTG9jYWxUdW5uZWxNYW5h
Z2VyOiA+Pj4gJWkiLCByZWFkKTsNCgkJCQl9DQoNCgkJCQl3aGlsZSh0cnVlKQ0KCQkJCXsNCgkJ
CQkJcURlYnVnKCJMb2NhbFR1bm5lbE1hbmFnZXI6IGxpYnNzaDJfY2hhbm5lbF9yZWFkKCkgPj4+
Iik7DQoJCQkJCXJlYWQgPSBsaWJzc2gyX2NoYW5uZWxfcmVhZChjaGFubmVsLCBidWZmZXIsIHNp
emVvZihidWZmZXIpKTsNCgkJCQkJUUJ5dGVBcnJheSBkZWJ1ZyA9IFFCeXRlQXJyYXkoYnVmZmVy
LCByZWFkKTsNCgkJCQkJcURlYnVnKCJMb2NhbFR1bm5lbE1hbmFnZXI6IGxpYnNzaDJfY2hhbm5l
bF9yZWFkKCkgPDw8ICVpXG4lcyIsIHJlYWQsIGRlYnVnLmNvbnN0RGF0YSgpKTsNCgkJCQkJaWYo
TElCU1NIMl9FUlJPUl9FQUdBSU4gPT0gcmVhZCkNCgkJCQkJew0KCQkJCQkJcURlYnVnKCJMb2Nh
bFR1bm5lbE1hbmFnZXI6IExJQlNTSDJfRVJST1JfRUFHQUlOIik7DQoJCQkJCQlicmVhazsNCgkJ
CQkJfQ0KCQkJCQllbHNlIGlmKHJlYWQgIDwgMCkNCgkJCQkJew0KCQkJCQkJcURlYnVnKCJMb2Nh
bFR1bm5lbE1hbmFnZXI6IGVycm9yIHJlYWRpbmcgZnJvbSBjaGFubmVsIik7DQoJCQkJCQlzaHV0
ZG93bkNvbm5lY3Rpb24oc29ja2V0LCBjaGFubmVsKTsNCgkJCQkJCWdvdG8gbmV4dF9zb2NrZXQ7
DQoJCQkJCX0NCgkJCQkJd3JpdHRlbiA9IDA7DQoJCQkJCXdoaWxlKHdyaXR0ZW4gPCByZWFkKQ0K
CQkJCQl7DQoJCQkJCQlxRGVidWcoIkxvY2FsVHVubmVsTWFuYWdlcjogc29ja2V0LT53cml0ZSgp
ID4+PiIpOw0KCQkJCQkJaSA9IHNvY2tldC0+d3JpdGUoYnVmZmVyICsgd3JpdHRlbiwgcmVhZCAt
IHdyaXR0ZW4pOw0KCQkJCQkJcURlYnVnKCJMb2NhbFR1bm5lbE1hbmFnZXI6IHNvY2tldC0+d3Jp
dGUoKSA8PDwgJWkiLCBpKTsNCgkJCQkJCWlmKGkgPCAwKQ0KCQkJCQkJew0KCQkJCQkJCXFEZWJ1
ZygiTG9jYWxUdW5uZWxNYW5hZ2VyOiBlcnJvciB3cml0aW5nIHRvIHNvY2tldCIpOw0KCQkJCQkJ
CXNodXRkb3duQ29ubmVjdGlvbihzb2NrZXQsIGNoYW5uZWwpOw0KCQkJCQkJCWdvdG8gbmV4dF9z
b2NrZXQ7DQoJCQkJCQl9DQoJCQkJCQl3cml0dGVuICs9IGkgOw0KCQkJCQl9DQoNCgkJCQkJcURl
YnVnKCJMb2NhbFR1bm5lbE1hbmFnZXI6IDw8PCAlaSIsIHJlYWQpOw0KDQoJCQkJCWkgPSBsaWJz
c2gyX2NoYW5uZWxfZW9mKGNoYW5uZWwpOw0KCQkJCQlpZihpKSANCgkJCQkJew0KCQkJCQkJcURl
YnVnKCJMb2NhbFR1bm5lbE1hbmFnZXI6IGxpYnNzaDJfY2hhbm5lbF9lb2YgJWkiLCBpKTsNCgkJ
CQkJCXNodXRkb3duQ29ubmVjdGlvbihzb2NrZXQsIGNoYW5uZWwpOw0KCQkJCQkJZ290byBuZXh0
X3NvY2tldDsNCgkJCQkJfQ0KCQkJCX0NCgluZXh0X3NvY2tldDoNCgkJCQljb250aW51ZTsNCg0K
DQoJCQl9DQoJCQkJbGlic3NoMl9zZXNzaW9uX3NldF9ibG9ja2luZyhtX3Nlc3Npb24sIDEpOw0K
DQoJCQkvKg0KCQl9DQoJCSovDQoNCg0KCQlxRGVidWcoIkxvY2FsVHVubmVsTWFuYWdlcjogdHJh
bnNtaXQoKSA8PDwiKTsNCgl9DQpwcm90ZWN0ZWQgc2xvdHM6DQoJdm9pZCBvcGVuQ29ubmVjdGlv
bigpDQoJew0KCQlxRGVidWcoIkxvY2FsVHVubmVsTWFuYWdlcjogb3BlbkNvbm5lY3Rpb24oKSA+
Pj4iKTsNCg0KCQlRVGNwU2VydmVyICpzZXJ2ZXIgPSBzdGF0aWNfY2FzdDxRVGNwU2VydmVyICo+
KHNlbmRlcigpKTsNCgkJUVRjcFNvY2tldCAqc29ja2V0ID0gc2VydmVyLT5uZXh0UGVuZGluZ0Nv
bm5lY3Rpb24oKTsNCgkJY29ubmVjdChzb2NrZXQsIFNJR05BTChkaXNjb25uZWN0ZWQoKSksIHRo
aXMsIFNMT1QoY2xvc2VDb25uZWN0aW9uKCkpKTsNCgkJaWYoIXNvY2tldCB8fCAhbV9zZXJ2ZXJU
dW5uZWxJbmZvTWFwLmNvbnRhaW5zKHNlcnZlcikpDQoJCXsNCgkJCXFEZWJ1ZygiTG9jYWxUdW5u
ZWxNYW5hZ2VyOiBlcnJvciBvcGVuaW5nIGNvbm5lY3Rpb24iKTsNCgkJCXJldHVybjsNCgkJfQ0K
CQlUdW5uZWxJbmZvIHR1bm5lbCA9IG1fc2VydmVyVHVubmVsSW5mb01hcFtzZXJ2ZXJdOw0KDQoN
CgkJCQkvL2xpYnNzaDJfc2Vzc2lvbl9zZXRfYmxvY2tpbmcobV9zZXNzaW9uLCAxKTsNCgkJTElC
U1NIMl9DSEFOTkVMICpjaGFubmVsID0gbGlic3NoMl9jaGFubmVsX2RpcmVjdF90Y3BpcF9leCgN
CgkJCW1fc2Vzc2lvbiwgDQoJCQl0dW5uZWwubV9ob3N0LnRvTG9jYWw4Qml0KCkuY29uc3REYXRh
KCksDQogICAgICAgIAl0dW5uZWwubV9ob3N0UG9ydCwgDQoJCQlzZXJ2ZXItPnNlcnZlckFkZHJl
c3MoKS50b1N0cmluZygpLnRvTG9jYWw4Qml0KCkuY29uc3REYXRhKCksIA0KCQkJc2VydmVyLT5z
ZXJ2ZXJQb3J0KCkJDQoJCSk7DQoNCg0KCQlpZighY2hhbm5lbCkNCgkJew0KCQkJcURlYnVnKCAi
Q291bGQgbm90IG9wZW4gdGhlIGRpcmVjdC10Y3BpcCBjaGFubmVsIVxuIg0KCQkJCQkiKE5vdGUg
dGhhdCB0aGlzIGNhbiBiZSBhIHByb2JsZW0gYXQgdGhlIHNlcnZlciEiDQoJCQkJCSIgUGxlYXNl
IHJldmlldyB0aGUgc2VydmVyIGxvZ3MuKVxuIik7DQoJCQlzb2NrZXQtPmRlbGV0ZUxhdGVyKCk7
DQoJCQlyZXR1cm47DQoJCX0NCg0KCQkNCgkJbV9zb2NrZXRDaGFubmVsTWFwW3NvY2tldF0gPSBj
aGFubmVsOw0KDQoJCXFEZWJ1ZygiTG9jYWxUdW5uZWxNYW5hZ2VyOiBvcGVuQ29ubmVjdGlvbigp
IDw8PCIpOw0KCX0NCgl2b2lkIGNsb3NlQ29ubmVjdGlvbigpDQoJew0KCQlxRGVidWcoIkxvY2Fs
VHVubmVsTWFuYWdlcjogY2xvc2VDb25uZWN0aW9uKCkgPj4+Iik7DQoNCgkJUVRjcFNvY2tldCAq
c29ja2V0ID0gc3RhdGljX2Nhc3Q8UVRjcFNvY2tldCAqPihzZW5kZXIoKSk7DQoJCUxJQlNTSDJf
Q0hBTk5FTCAqY2hhbm5lbCA9IG1fc29ja2V0Q2hhbm5lbE1hcFtzb2NrZXRdOw0KDQoJCXNodXRk
b3duQ29ubmVjdGlvbihzb2NrZXQsIGNoYW5uZWwpOw0KDQoJCXFEZWJ1ZygiTG9jYWxUdW5uZWxN
YW5hZ2VyOiBjbG9zZUNvbm5lY3Rpb24oKSA8PDwiKTsNCgl9DQpwcml2YXRlOg0KCXZvaWQgc2h1
dGRvd25Db25uZWN0aW9uKFFUY3BTb2NrZXQgKnNvY2tldCwgTElCU1NIMl9DSEFOTkVMICpjaGFu
bmVsKQ0KCXsNCgkJaWYoc29ja2V0LT5pc09wZW4oKSkNCgkJew0KCQkJc29ja2V0LT53YWl0Rm9y
Qnl0ZXNXcml0dGVuKCk7DQoJCQlzb2NrZXQtPmNsb3NlKCk7DQoJCX0NCgkJbV9zb2NrZXRDaGFu
bmVsTWFwLnJlbW92ZShzb2NrZXQpOw0KCQlzb2NrZXQtPmRlbGV0ZUxhdGVyKCk7DQoNCgkJaWYo
Y2hhbm5lbCkNCgkJew0KCQkJLypsaWJzc2gyX2NoYW5uZWxfY2xvc2UoY2hhbm5lbCk7DQoJCQls
aWJzc2gyX2NoYW5uZWxfd2FpdF9jbG9zZWQoY2hhbm5lbCk7Ki8NCgkJCWxpYnNzaDJfY2hhbm5l
bF9mcmVlKGNoYW5uZWwpOw0KCQl9DQoNCgl9DQoJdm9pZCBzZXR1cExvY2FsU2VydmVyKGNvbnN0
IFR1bm5lbEluZm8gJnR1bm5lbCkNCgl7DQoJCVFUY3BTZXJ2ZXIgKnNlcnZlciA9IG5ldyBRVGNw
U2VydmVyOw0KCQljb25uZWN0KHNlcnZlciwgU0lHTkFMKG5ld0Nvbm5lY3Rpb24oKSksIHRoaXMs
IFNMT1Qob3BlbkNvbm5lY3Rpb24oKSkpOw0KCQlpZighc2VydmVyLT5saXN0ZW4oUUhvc3RBZGRy
ZXNzKHR1bm5lbC5tX2JpbmRBZGRyZXNzKSwgdHVubmVsLm1fcG9ydCkpDQoJCXsNCgkJCXFEZWJ1
ZygiTG9jYWxUdW5uZWxNYW5hZ2VyOiBmYWlsIHRvIGxpc3RlbiBvbiAlczolaSIsIA0KCQkJCXR1
bm5lbC5tX2JpbmRBZGRyZXNzLnRvTG9jYWw4Qml0KCkuY29uc3REYXRhKCksIA0KCQkJCXR1bm5l
bC5tX3BvcnQpOw0KCQkJZGVsZXRlIHNlcnZlcjsNCgkJfQ0KCQlxRGVidWcoIkxvY2FsVHVubmVs
TWFuYWdlcjogbGlzdGVuaW5nIG9uICVzOiVpIiwNCgkJCQl0dW5uZWwubV9iaW5kQWRkcmVzcy50
b0xvY2FsOEJpdCgpLmNvbnN0RGF0YSgpLCANCgkJCQl0dW5uZWwubV9wb3J0KTsNCgkJbV9zZXJ2
ZXJUdW5uZWxJbmZvTWFwW3NlcnZlcl0gPSB0dW5uZWw7DQoJfQ0KcHJpdmF0ZToNCglMSUJTU0gy
X1NFU1NJT04gKm1fc2Vzc2lvbjsNCgl0eXBlZGVmIFFNYXA8UVRjcFNvY2tldCAqLCBMSUJTU0gy
X0NIQU5ORUwgKj4gU29ja2V0Q2hhbm5lbE1hcDsNCgl0eXBlZGVmIFFNYXA8UVRjcFNlcnZlciAq
LCBUdW5uZWxJbmZvPiBTZXJ2ZXJUdW5uZWxJbmZvTWFwOw0KCVNvY2tldENoYW5uZWxNYXAgbV9z
b2NrZXRDaGFubmVsTWFwOw0KCVNlcnZlclR1bm5lbEluZm9NYXAgbV9zZXJ2ZXJUdW5uZWxJbmZv
TWFwOw0KfTsNCg0KDQp2b2lkIG15TWVzc2FnZU91dHB1dChRdE1zZ1R5cGUgdHlwZSwgY29uc3Qg
Y2hhciAqbXNnKQ0Kew0KCXN0YXRpYyBRRmlsZSAqcExvZyA9IDA7DQoJaWYoIXBMb2cpDQoJew0K
CQlwTG9nID0gbmV3IFFGaWxlKCJsb2cudHh0IiwgUUNvcmVBcHBsaWNhdGlvbjo6aW5zdGFuY2Uo
KSk7DQoJCXBMb2ctPm9wZW4oUUlPRGV2aWNlOjpXcml0ZU9ubHkgfCBRSU9EZXZpY2U6OkFwcGVu
ZCB8IFFJT0RldmljZTo6VGV4dCk7DQoJfQ0KDQoJUVN0cmluZyBzOw0KDQoJc3dpdGNoICh0eXBl
KSB7DQoJY2FzZSBRdERlYnVnTXNnOg0KCQlzLnNwcmludGYoIkRlYnVnOiAlc1xuIiwgbXNnKTsN
CgkJYnJlYWs7DQoJY2FzZSBRdFdhcm5pbmdNc2c6DQoJCXMuc3ByaW50ZigiV2FybmluZzogJXNc
biIsIG1zZyk7DQoJCWJyZWFrOw0KCWNhc2UgUXRDcml0aWNhbE1zZzoNCgkJcy5zcHJpbnRmKCJD
cml0aWNhbDogJXNcbiIsIG1zZyk7DQoJCWJyZWFrOw0KCWNhc2UgUXRGYXRhbE1zZzoNCgkJcy5z
cHJpbnRmKCJGYXRhbDogJXNcbiIsIG1zZyk7DQoJCWFib3J0KCk7DQoJfQ0KDQoJcyA9IFFEYXRl
VGltZTo6Y3VycmVudERhdGVUaW1lKCkudG9TdHJpbmcoUXQ6OklTT0RhdGUpICsgIiAiICsgczsN
CglmcHJpbnRmKHN0ZGVyciwgcy50b0xvY2FsOEJpdCgpLmNvbnN0RGF0YSgpKTsNCglwTG9nLT53
cml0ZShzLnRvTG9jYWw4Qml0KCkpOw0KCXBMb2ctPmZsdXNoKCk7DQp9DQoNCmludCBtYWluKGlu
dCBhcmdjLCBjaGFyICphcmd2W10pDQp7DQoJUUFwcGxpY2F0aW9uIGFwcChhcmdjLCBhcmd2KTsN
Cg0KCXFJbnN0YWxsTXNnSGFuZGxlcihteU1lc3NhZ2VPdXRwdXQpOw0KDQoJUUNvcmVBcHBsaWNh
dGlvbjo6c2V0T3JnYW5pemF0aW9uTmFtZSgiRm90by5ydSIpOw0KCVFDb3JlQXBwbGljYXRpb246
OnNldE9yZ2FuaXphdGlvbkRvbWFpbigiZm90by5ydSIpOw0KCVFDb3JlQXBwbGljYXRpb246OnNl
dEFwcGxpY2F0aW9uTmFtZSgibGlic3NoMiIpOw0KDQoJQ29ubmVjdERpYWxvZyBkbGc7DQoJaWYo
ZGxnLmV4ZWMoKSAhPSBRRGlhbG9nOjpBY2NlcHRlZCkNCgl7DQoJCXJldHVybiAtMTsNCgl9DQoN
CglpbnQgbGlic3NoMl9lcnJvciA9IGxpYnNzaDJfaW5pdCgwKTsNCglpZihsaWJzc2gyX2Vycm9y
KQ0KCXsNCgkJcURlYnVnKCJsaWJzc2gyX2luaXQoKSBlcnJvcjogJWQiLCBsaWJzc2gyX2Vycm9y
KTsNCgkJcmV0dXJuIC0yOw0KCX0NCg0KCVFUY3BTb2NrZXQgc29ja2V0Ow0KCXNvY2tldC5jb25u
ZWN0VG9Ib3N0KGRsZy5ob3N0KCksIGRsZy5wb3J0KCkpOw0KCWlmKCFzb2NrZXQud2FpdEZvckNv
bm5lY3RlZCgpKQ0KCXsNCgkJcURlYnVnKCJFcnJvciBjb25uZWN0aW5nIHRvIGhvc3QgJXMiLCBk
bGcuaG9zdCgpLnRvTG9jYWw4Qml0KCkuY29uc3REYXRhKCkpOw0KCQlyZXR1cm4gLTE7DQoJfQ0K
DQoJTElCU1NIMl9TRVNTSU9OICpzZXNzaW9uID0gbGlic3NoMl9zZXNzaW9uX2luaXQoKTsNCglp
Zighc2Vzc2lvbikNCgl7DQoJCXFEZWJ1ZygibGlic3NoMl9zZXNzaW9uX2luaXQoKSBmYWlsZWQi
KTsNCgkJcmV0dXJuIC0yOw0KCX0NCg0KCWxpYnNzaDJfZXJyb3IgPSBsaWJzc2gyX3Nlc3Npb25f
c3RhcnR1cChzZXNzaW9uLCBzb2NrZXQuc29ja2V0RGVzY3JpcHRvcigpKTsNCglpZihsaWJzc2gy
X2Vycm9yKQ0KCXsNCgkJcURlYnVnKCJsaWJzc2gyX3Nlc3Npb25fc3RhcnR1cCgpIGVycm9yOiAl
ZCIsIGxpYnNzaDJfZXJyb3IpOw0KCQlyZXR1cm4gLTM7DQoJfQ0KDQoJew0KICAgIC8qIEF0IHRo
aXMgcG9pbnQgd2UgaGF2bid0IHlldCBhdXRoZW50aWNhdGVkLiAgVGhlIGZpcnN0IHRoaW5nIHRv
IGRvDQogICAgICogaXMgY2hlY2sgdGhlIGhvc3RrZXkncyBmaW5nZXJwcmludCBhZ2FpbnN0IG91
ciBrbm93biBob3N0cyBZb3VyIGFwcA0KICAgICAqIG1heSBoYXZlIGl0IGhhcmQgY29kZWQsIG1h
eSBnbyB0byBhIGZpbGUsIG1heSBwcmVzZW50IGl0IHRvIHRoZQ0KICAgICAqIHVzZXIsIHRoYXQn
cyB5b3VyIGNhbGwNCiAgICAgKi8NCiAgICBjb25zdCBjaGFyICpmaW5nZXJwcmludCA9IGxpYnNz
aDJfaG9zdGtleV9oYXNoKHNlc3Npb24sIExJQlNTSDJfSE9TVEtFWV9IQVNIX1NIQTEpOw0KICAg
IHFEZWJ1ZyggIkZpbmdlcnByaW50OiAiKTsNCiAgICBmb3IoaW50IGkgPSAwOyBpIDwgMjA7IGkr
KykNCiAgICAgICAgcURlYnVnKCAiJTAyWCAiLCAodW5zaWduZWQgY2hhcilmaW5nZXJwcmludFtp
XSk7DQogICAgcURlYnVnKCAiXG4iKTsNCgl9DQoNCglxRGVidWcoIlBhc3N3b3JkIGF1dGhlbnRp
Y2F0aW9uOiBbJXNdIFslc10iLCBkbGcudXNlcigpLnRvTG9jYWw4Qml0KCkuY29uc3REYXRhKCks
IGRsZy5wYXNzKCkudG9Mb2NhbDhCaXQoKS5jb25zdERhdGEoKSk7DQoJbGlic3NoMl91c2VyYXV0
aF9saXN0KHNlc3Npb24sIGRsZy51c2VyKCkudG9Mb2NhbDhCaXQoKS5jb25zdERhdGEoKSwgZGxn
LnVzZXIoKS50b0xvY2FsOEJpdCgpLmxlbmd0aCgpKTsNCglpZihsaWJzc2gyX3VzZXJhdXRoX3Bh
c3N3b3JkKA0KCQlzZXNzaW9uLCANCgkJZGxnLnVzZXIoKS50b0xvY2FsOEJpdCgpLmNvbnN0RGF0
YSgpLCANCgkJZGxnLnBhc3MoKS50b0xvY2FsOEJpdCgpLmNvbnN0RGF0YSgpDQoJKSkNCgl7DQoJ
CXFEZWJ1ZygiUGFzc3dvcmQgYXV0aGVudGljYXRpb24gZmFpbGVkIik7DQoJCXJldHVybiAtNDsN
Cgl9DQoNCglMb2NhbFR1bm5lbE1hbmFnZXIgbWFuYWdlcihzZXNzaW9uLCBkbGcubG9jYWxUdW5u
ZWxzKCkpOw0KCVFUaW1lciB0aW1lcjsNCglRT2JqZWN0Ojpjb25uZWN0KCZ0aW1lciwgU0lHTkFM
KHRpbWVvdXQoKSksICZtYW5hZ2VyLCBTTE9UKHRyYW5zbWl0KCkpKTsNCgl0aW1lci5zdGFydCgx
MDAwKTsNCgkvL1FUaW1lcjo6c2luZ2xlU2hvdCgxMDAsICZtYW5hZ2VyLCBTTE9UKHRyYW5zbWl0
KCkpKTsNCglhcHAuZXhlYygpOw0KDQoJc29ja2V0LmRpc2Nvbm5lY3RGcm9tSG9zdCgpOw0KDQoJ
bGlic3NoMl9zZXNzaW9uX2Rpc2Nvbm5lY3Qoc2Vzc2lvbiwgIkNsaWVudCBkaXNjb25uZWN0aW5n
IG5vcm1hbGx5Iik7DQoJbGlic3NoMl9zZXNzaW9uX2ZyZWUoc2Vzc2lvbik7DQoJbGlic3NoMl9l
eGl0KCk7DQoNCglyZXR1cm4gMDsNCn0NCg0KI2luY2x1ZGUgInF0Lm1vYyINCg==
--00221534d3b3daab3f0497d7f2f5
Content-Type: application/octet-stream; name="example.pro"
Content-Disposition: attachment; filename="example.pro"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_ghxfnjvl1

IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj
IyMjIyMjIyMjIyMjIw0KIyBBdXRvbWF0aWNhbGx5IGdlbmVyYXRlZCBieSBxbWFrZSAoMS4wN2Ep
ID8/IDUuID8/PyAxNzo1Mzo1MyAyMDEwDQojIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj
IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjDQoNClRFTVBMQVRFID0gYXBw
DQpDT05GSUcgLT0gbW9jDQpDT05GSUcgKz0gY29uc29sZQ0KSU5DTFVERVBBVEggKz0gLiAuLi9p
bmNsdWRlIC4uL3dpbjMyDQpERUZJTkVTICs9IExJQlNTSDJfV0lOMzIgDQoNCkxJQlBBVEggKz0g
Li4gIkM6XG9wdFx6bGliLTEuMi4zXGxpYiINCkxJQlMgKz0gLWxsaWJzc2gyIC1semxpYiAtbHdz
Ml8zMg0KDQojIElucHV0DQpTT1VSQ0VTICs9IFwNCiAgICAgICAgICAgcXQuY3BwIA0KCQkgICAj
ZGlyZWN0X3RjcGlwLmMNCiNUaGUgZm9sbG93aW5nIGxpbmUgd2FzIGluc2VydGVkIGJ5IHF0M3Rv
NA0KUVQgKz0gIG5ldHdvcmsNCg==
--00221534d3b3daab3f0497d7f2f5
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

--00221534d3b3daab3f0497d7f2f5--

From libssh2-devel-bounces@cool.haxx.se  Tue Dec 21 10:37:33 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBL9bHaq032448;
	Tue, 21 Dec 2010 10:37:30 +0100
Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com
	[209.85.210.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBL9bFnU032429
	for <libssh2-devel@cool.haxx.se>; Tue, 21 Dec 2010 10:37:16 +0100
Received: by iyb26 with SMTP id 26so3454297iyb.41
	for <libssh2-devel@cool.haxx.se>; Tue, 21 Dec 2010 01:37:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:mime-version:received:from:date
	:message-id:subject:to:content-type;
	bh=BtvHmQ6UdSK+mesrjEwASqePnDifqT74DsVSPaXDLhw=;
	b=YVSuNOD3HksyINo3Vo18K0naVKl3rRaVuLIONeMkusSByMGGCuEOIbATWoNQ/GAQTU
	OxOk5QKSo7usF5CtNJ1TOGW2a14+dgms2Wn2j3rgKGbgWFFUOrpTodRjQZ9z1kyW2CDr
	kZpbcx39+YFfFHruFNINhdOMkWg3sqqQw+ry4=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:from:date:message-id:subject:to:content-type;
	b=aJ+7qieRo008gfRz8o35HWwfMiH95SJu6PgGPczVDHpdMy+jOAGQzqYKP/Kv0gCQXR
	pEmhFukWFAD/AbibISH2WYoEXFnWezuJHFyBS1ctWiC9YxAC8tYBJtBnxHcQyfbvVcwl
	qU0CzbE0s0eS9UO7RCzi8YTyIjHumG5zxBgCU=
Received: by 10.231.206.80 with SMTP id ft16mr5212123ibb.110.1292924229149;
	Tue, 21 Dec 2010 01:37:09 -0800 (PST)
MIME-Version: 1.0
Received: by 10.231.141.210 with HTTP; Tue, 21 Dec 2010 01:36:49 -0800 (PST)
From: Dmitry Teslenko <dteslenko@gmail.com>
Date: Tue, 21 Dec 2010 12:36:49 +0300
Message-ID: <AANLkTim85vTnR6Rri5OsGVB5ScND0eh4x62Fv8xJLfTM@mail.gmail.com>
Subject: Multiple channels and blocking question
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 21 Dec 2010 10:37:33 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 21 Dec 2010 10:37:16 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hello!
I want to establish and close multiple channels in one ssh session.
How to init and properly shutdown them? Because way it shown
in examles does not work.

direct_tcpip.c example do it this way:

1) creating new channel
	libssh2_session_set_blocking(session, 1);
	LIBSSH2_CHANNEL *channel = libssh2_channel_direct_tcpip_ex(
	...);

2) channel read-write
	libssh2_channel_set_blocking(channel, 0);
	//read-write here

3) shutting down channel
	libssh2_channel_free(channel);

But this way I can't start channel on second connection. libssh2 says:
Could not open the direct-tcpip channel!
(Note that this can be a problem at the server! Please review the server logs.)

Also I get LIBSSH2_ERROR_EAGAIN error all the time in unblocking mode.

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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 22 10:38:39 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBM9bEdX020925;
	Wed, 22 Dec 2010 10:38:35 +0100
Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com
	[209.85.210.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBM9bDp3020825
	for <libssh2-devel@cool.haxx.se>; Wed, 22 Dec 2010 10:37:13 +0100
Received: by iyb26 with SMTP id 26so4526643iyb.41
	for <libssh2-devel@cool.haxx.se>; Wed, 22 Dec 2010 01:37:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:mime-version:received:in-reply-to
	:references:from:date:message-id:subject:to:cc:content-type;
	bh=hTRQL2pYAujmsNkIrfMVn6PG/Od0PcKBglYbqY8kRKs=;
	b=Y87T5vabeuTaJy5R2No1Qp3aGFMuSldTJIBrvCeqHGDnNXUxWixankN796vr4Y8xZq
	EpWWxdmN4A7jYN7mvNYQHxECLdVgPZg2SvAAlfkJYBhtpp1vBmbMXcUOCqWB4TkqinHk
	QmmF6pZe7iBaeJFjJljMJfvzvWlRlJA55YhF8=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type;
	b=iXX9pw65vH1V7x6A2BuyOZ8BcFHn3MbDKIfEi2qHdCFnSZi66bDyBpt/igdC0c2Y4V
	EaEmT7ltO0xcD3613AbOJQtAw4n3uoBnr5uAYX/LPmR9xnAlK9rSrYdj5huIQ/eylf1r
	9S2RvslI1SzjuRtZM8HymzxzRwSlhASi/rgMM=
Received: by 10.231.19.131 with SMTP id a3mr6530803ibb.85.1293010625737; Wed,
	22 Dec 2010 01:37:05 -0800 (PST)
MIME-Version: 1.0
Received: by 10.231.141.210 with HTTP; Wed, 22 Dec 2010 01:36:45 -0800 (PST)
In-Reply-To: <alpine.DEB.2.00.1006012252110.26666@tvnag.unkk.fr>
References: <87zkzttp7v.fsf@exys.org> <20100521170615.5817.qmail@stuge.se>
	<8739xfg8qf.fsf@exys.org>
	<alpine.DEB.2.00.1006012252110.26666@tvnag.unkk.fr>
From: Dmitry Teslenko <dteslenko@gmail.com>
Date: Wed, 22 Dec 2010 12:36:45 +0300
Message-ID: <AANLkTi=LELDdZDAvnLHVNeZsw9zPb7G+oK+dq9Ds1FLw@mail.gmail.com>
Subject: Re: [Patch] add read/write user callbacks
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 22 Dec 2010 10:38:39 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 22 Dec 2010 10:37:13 +0100 (CET)
Cc: aep@exys.org
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hello!

On Wed, Jun 2, 2010 at 00:55, Daniel Stenberg <daniel@haxx.se> wrote:
> On Tue, 25 May 2010, Arvid Picciani wrote:
>
>>> Finally I'd like some documentation about the send and recv callbacks
>>> to explain what they can do and what they can not do.
>>
>> uuh... I have no idea how to write manpages, but i can try when i find
>> some free time.
>
> It's not that hard and there are MANY examples to compare with and mostly
> just copy and paste from. And you don't have to make it fancy, just get the
> info in!
>
>> oops
>
> Will you provide an updated patch that adresses the concerns Peter raised?
>

Please, tell me why this callbacks could help integrate libssh2 with
"high level socket tools"?

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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 22 14:46:08 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBMDjpQK016951;
	Wed, 22 Dec 2010 14:46:05 +0100
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBMDjno0016921
	for <libssh2-devel@cool.haxx.se>; Wed, 22 Dec 2010 14:45:50 +0100
Received: by qwj9 with SMTP id 9so5521264qwj.41
	for <libssh2-devel@cool.haxx.se>; Wed, 22 Dec 2010 05:45:42 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:content-type:content-transfer-encoding;
	bh=i4Asd53hzcrAMUmVpdXuwX6e92lXCmlOcMqVPs6WkFc=;
	b=oKmk2Vziano9Ks0zziWH/Tu4yVljUyBVbbv4xhubkiDgjU0AGelsCu5F0fD/XSCX93
	0o5RY4tujPGyAapOH57MKzMnJtkXorsm6GyZULyBCkzLoSEU/dWIHsnDzcH+V5WwzwJU
	wrclUmSfBlzjDoOQm3eUxGKu5JCzE+tRrjvZU=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:content-type
	:content-transfer-encoding;
	b=STymDj2fjtN8DAikwz5Wvs3TvW738nY2+V9ehjxO996K3BcU0z4d4CJzrImICEDO/i
	ougpZV5H3cE5IJjT4jrRRhhgfIRxQrgouXeGeWibFGJyPQUhuQYIqfvKaqh07xv1UoLS
	eLIN/9NGVpjVXu7ETa7wRvTu339w9R2FAXKV0=
MIME-Version: 1.0
Received: by 10.229.141.78 with SMTP id l14mr5961901qcu.295.1293025542502;
	Wed, 22 Dec 2010 05:45:42 -0800 (PST)
Received: by 10.229.85.202 with HTTP; Wed, 22 Dec 2010 05:45:42 -0800 (PST)
In-Reply-To: <20101222134239.24709.qmail@earth.stuge.se>
References: <20101222134239.24709.qmail@earth.stuge.se>
Date: Wed, 22 Dec 2010 13:45:42 +0000
X-Google-Sender-Auth: d_kf6yFHX_WCN9EVtiOlvwKyRGY
Message-ID: <AANLkTi=AqPmMhtSm+4Ghjd-07mJuReQfjt=iD2B661bh@mail.gmail.com>
Subject: Re: libssh2 master 326f741 Updated OpenSSL version.
From: Alexander Lamaison <swish@lammy.co.uk>
To: libssh2-devel@cool.haxx.se
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 22 Dec 2010 14:46:08 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 22 Dec 2010 14:45:50 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On 22 December 2010 13:42, <libssh2@git.stuge.se> wrote:
>
> - Log -----------------------------------------------------------------
> commit 326f741a52b825fd58dcedef95f4b41ad4d1a15f
> Author: Guenter Knauf <lists@gknw.net>
> Commit: Guenter Knauf <lists@gknw.net>
>
> =A0 =A0Updated OpenSSL version.
>
> diff --git a/nw/Makefile.netware b/nw/Makefile.netware
> index 2633239..54cd220 100644
> --- a/nw/Makefile.netware
> +++ b/nw/Makefile.netware
> @@ -19,7 +19,7 @@ endif
>
> =A0# Edit the path below to point to the base of your OpenSSL package.
> =A0ifndef OPENSSL_PATH
> -OPENSSL_PATH =3D ../../openssl-0.9.8o
> +OPENSSL_PATH =3D ../../openssl-0.9.8q
> =A0endif
... snip

Why are we hardcoding an OpenSSL version?

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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 22 15:31:16 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBMEV6Mj014461;
	Wed, 22 Dec 2010 15:31:14 +0100
Received: from dns-factory.at (mx03.dns-factory.at [194.242.35.75])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBMEV4vU014427
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <libssh2-devel@cool.haxx.se>; Wed, 22 Dec 2010 15:31:05 +0100
Received: from [172.17.100.7] lists@gknw.net [84.63.11.57]
	by dns-factory.at with NetMail SMTP Agent $Revision: 8582 $ on Novell
	NetWare via secured & encrypted transport (TLS);
	Wed, 22 Dec 2010 15:30:55 +0100
Message-ID: <4D120B6C.2050702@gknw.net>
Date: Wed, 22 Dec 2010 15:30:04 +0100
From: Guenter <lists@gknw.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de;
	rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7
MIME-Version: 1.0
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: libssh2 master 326f741 Updated OpenSSL version.
References: <20101222134239.24709.qmail@earth.stuge.se>
	<AANLkTi=AqPmMhtSm+4Ghjd-07mJuReQfjt=iD2B661bh@mail.gmail.com>
In-Reply-To: <AANLkTi=AqPmMhtSm+4Ghjd-07mJuReQfjt=iD2B661bh@mail.gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 22 Dec 2010 15:31:16 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 22 Dec 2010 15:31:05 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hi,
Am 22.12.2010 14:45, schrieb Alexander Lamaison:
> On 22 December 2010 13:42,<libssh2@git.stuge.se>  wrote:
>>   ifndef OPENSSL_PATH
>> -OPENSSL_PATH =3D ../../openssl-0.9.8o
>> +OPENSSL_PATH =3D ../../openssl-0.9.8q
>>   endif
> ... snip
>
> Why are we hardcoding an OpenSSL version?
it is not hardcoded but at any time overwritable - see the 'ifndef' just =

before; so its just a fallback default, and I want to default to minimum =

current 0.9.8 version.

G=FCnter.


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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 22 23:59:33 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBMMxIWH028581;
	Wed, 22 Dec 2010 23:59:31 +0100
Received: from imail.ipswitch.com (imail.ipswitch.com [156.21.1.5])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBMMxGwg028565
	for <libssh2-devel@cool.haxx.se>; Wed, 22 Dec 2010 23:59:17 +0100
DKIM-Signature: q=dns/txt; v=1; c=relaxed/relaxed; s=ipswitch;
	d=ipswitch.com; a=rsa-sha1;
	h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:
	Content-Transfer-Encoding;
	b=WILsA/T/CVSZWJuEbCKc/0ponxjqIKptlflD7hCs3yG4Bjj80M7pJZzRlOiag+6749
	V+0c7+7VpQu0sbVEL3YYNAfRXKGyDyKrXGEAvo9FsXXrxVrC2xUiG4p/mRFs2xvN0IN1
	vxd4gVJxIn0TN+8weikCFlvRFofwiLDkozx3w=;
	bh=sqhRwcIbvF0Tj+zljnQOwtaxcUk=; t=1293058747;
Received: from mrrnt [66.170.5.130] by ipswitch.com with ESMTP
	(SMTPD-11.03) id 08d20033ba3aefb1; Wed, 22 Dec 2010 17:59:06 -0500
From: "Mark Riordan" <mriordan@ipswitch.com>
To: "'libssh2 development'" <libssh2-devel@cool.haxx.se>
Subject: libssh2 - public key and/or password auth methods
Date: Wed, 22 Dec 2010 16:59:06 -0600
Message-ID: <000f01cba22b$d64d3a70$82e7af50$@com>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
thread-index: AcuiK9XdLIZwxsqcR9CJX+S+XXgQ7A==
Content-Language: en-us
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 22 Dec 2010 23:59:33 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 22 Dec 2010 23:59:18 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

How should an application determine whether both public key
and password authentication methods are required?
I'm not sure how to determine the difference between a server
that requires both, or will take either one.

I was kind of expecting functions like libssh2_userauth_publickey_fromfile
and libssh2_userauth_password to have a return code that says
"successful so far, but more authentication is required".

Thanks.

Mark R


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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec 23 00:45:28 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBMNjIaf015866;
	Thu, 23 Dec 2010 00:45:27 +0100
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBMNjFJN015846
	for <libssh2-devel@cool.haxx.se>; Thu, 23 Dec 2010 00:45:16 +0100
Received: by qwj9 with SMTP id 9so6107496qwj.41
	for <libssh2-devel@cool.haxx.se>; Wed, 22 Dec 2010 15:45:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	bh=zczmRKe460ZUTUzkQP48/LYMqWR9acGj2GmOGEa8LKc=;
	b=NC94I6U26CXJGSJkBs+8y3B09xeARM11HXxPOKRUE5nYq6WkRnpx3vg6DTm+2KYSBn
	XvpsZCgW70WthtwxguLqf+RrjWDGvPD0hfcXQAW2anmctdCwHTKul+Fgl5iFk/hZFa4G
	5P47sITu5ZlaZA5yc7oJcSbowd79plhb1vgqQ=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:content-type;
	b=XPYTBfUpquoxrfGcRM6MQ1yliw/9jGON9TqYS4Lib6KF54rqM0c93N22mBN9i8V9OB
	US+l4Tr68BlwVFqoPx+pU5j61i5ao9jSez5R/5N0VBXs8q4CQ2Y75Kkkh1mA3BqVylbx
	V1I6S1HCyw9EgCRbgJQFVQIgbhPYLy4ICT/CE=
MIME-Version: 1.0
Received: by 10.229.181.9 with SMTP id bw9mr6478661qcb.143.1293061506816; Wed,
	22 Dec 2010 15:45:06 -0800 (PST)
Received: by 10.229.85.202 with HTTP; Wed, 22 Dec 2010 15:45:06 -0800 (PST)
In-Reply-To: <000f01cba22b$d64d3a70$82e7af50$@com>
References: <000f01cba22b$d64d3a70$82e7af50$@com>
Date: Wed, 22 Dec 2010 23:45:06 +0000
X-Google-Sender-Auth: JBCmuAQCSdBS2KRS2HKdauX37FI
Message-ID: <AANLkTi=r90d5C8LGvC2LqiD5VkFOr+1FUmTU8MifovZN@mail.gmail.com>
Subject: Re: libssh2 - public key and/or password auth methods
From: Alexander Lamaison <swish@lammy.co.uk>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 23 Dec 2010 00:45:28 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 23 Dec 2010 00:45:16 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On 22 December 2010 22:59, Mark Riordan <mriordan@ipswitch.com> wrote:
> How should an application determine whether both public key
> and password authentication methods are required?
> I'm not sure how to determine the difference between a server
> that requires both, or will take either one.
>
> I was kind of expecting functions like libssh2_userauth_publickey_fromfile
> and libssh2_userauth_password to have a return code that says
> "successful so far, but more authentication is required".

I've not checked the spec lately so can't swear to it but I don't
think a server is allowed to _require_ multiple authentication
methods.  What it is allowed to do is say that it supports a method
but then fail to honour that.  When the first attempt returns failure,
you handle this by trying the next available method.

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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec 23 03:03:49 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBN23TMD031575;
	Thu, 23 Dec 2010 03:03:45 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id oBN23Rfe031531
	for <libssh2-devel@cool.haxx.se>; Thu, 23 Dec 2010 03:03:27 +0100
Received: (qmail 5294 invoked by uid 501); 23 Dec 2010 02:03:20 -0000
Message-ID: <20101223020320.5293.qmail@stuge.se>
Date: Thu, 23 Dec 2010 03:03:20 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: libssh2 - public key and/or password auth methods
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <000f01cba22b$d64d3a70$82e7af50$@com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <000f01cba22b$d64d3a70$82e7af50$@com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 23 Dec 2010 03:03:49 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 23 Dec 2010 03:03:28 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Mark Riordan wrote:
> How should an application determine whether both public key
> and password authentication methods are required?

libssh2 currently does not support that. It takes any insufficient
authentication to mean complete failure. Ie. libssh2 ignores the
"partial success" field in SSH_MSG_USERAUTH_FAILURE responses.


> I'm not sure how to determine the difference between a server
> that requires both, or will take either one.
> 
> I was kind of expecting functions like
> libssh2_userauth_publickey_fromfile and libssh2_userauth_password
> to have a return code that says "successful so far, but more
> authentication is required".

That sounds good. Can you make a patch?


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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec 23 03:15:35 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBN27330012792;
	Thu, 23 Dec 2010 03:07:05 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [213.88.146.6])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id oBN271O3012592
	for <libssh2-devel@cool.haxx.se>; Thu, 23 Dec 2010 03:07:01 +0100
Received: (qmail 5885 invoked by uid 501); 23 Dec 2010 02:06:57 -0000
Message-ID: <20101223020657.5884.qmail@stuge.se>
Date: Thu, 23 Dec 2010 03:06:57 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: libssh2 - public key and/or password auth methods
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <000f01cba22b$d64d3a70$82e7af50$@com>
	<AANLkTi=r90d5C8LGvC2LqiD5VkFOr+1FUmTU8MifovZN@mail.gmail.com>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <AANLkTi=r90d5C8LGvC2LqiD5VkFOr+1FUmTU8MifovZN@mail.gmail.com>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 23 Dec 2010 03:07:05 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 23 Dec 2010 03:07:02 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Alexander Lamaison wrote:
> I've not checked the spec lately so can't swear to it but I don't
> think a server is allowed to _require_ multiple authentication
> methods.

It is. Check RFC 4252 5.1, the partial success field.


> What it is allowed to do is say that it supports a method
> but then fail to honour that.

Well.. No, the method must be accepted, but there could be policy
that means that it will always fail.


> When the first attempt returns failure, you handle this by trying
> the next available method.

Yes, although clients might not bother. But partial success should be
treated simply as a "all good so far, carry on".. In a way similar to
the previous method just not being supported.


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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec 23 04:36:11 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBN344GA017008;
	Thu, 23 Dec 2010 04:04:18 +0100
Received: from imail.ipswitch.com (imail.ipswitch.com [156.21.1.5])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBN3427N016016
	for <libssh2-devel@cool.haxx.se>; Thu, 23 Dec 2010 04:04:02 +0100
DKIM-Signature: q=dns/txt; v=1; c=relaxed/relaxed; s=ipswitch;
	d=ipswitch.com; a=rsa-sha1;
	h=To:Cc:Date:Mime-Version:From:Subject:Content-Type:
	Content-Transfer-Encoding:Message-Id;
	b=K2z2pMiD4I5bfPs8KbI+FR3w2AuXefTxEr3VtVWNFknabNX/iiuhpcrtqbs8VO26Ek
	ooDcFpJ+pnFQWROSkjFm6EqvtIp/VHR5w/0/Vo5kjzE1COedfYTDiHl3eU6Fk3qwwOSR
	iuJrEw7PflXRxZHTNSgTmoFzRRb5AgkrLiXKo=;
	bh=J3+ot3iWHe27O+cCvM+yrfarz4c=; t=1293073436;
Received: from [156.21.1.5] [156.21.1.5] by ipswitch.com with ESMTP
	(SMTPD-11.03) id 76ca0033e0ef9cb4; Wed, 22 Dec 2010 22:03:55 -0500
To: "libssh2 development" <libssh2-devel@cool.haxx.se>
Cc: 
Date: Thu, 23 Dec 2010 03:03:55 GMT
Mime-Version: 1.0
From: "Mark Riordan" <mriordan@ipswitch.com>
Subject: Re: libssh2 - public key and/or password auth methods
Message-Id: <201012222203809.SM3399919@[156.21.1.5]>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 23 Dec 2010 04:04:20 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 23 Dec 2010 04:04:03 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

>> I was kind of expecting functions like
>> libssh2_userauth_publickey_fromfile and libssh2_userauth_password
>> to have a return code that says "successful so far, but more
>> authentication is required".

>That sounds good. Can you make a patch?

I'll give it a shot...

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

From libssh2-devel-bounces@cool.haxx.se  Fri Dec 24 03:45:17 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBO2isQB012102;
	Fri, 24 Dec 2010 03:45:13 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBO2irP5012069
	for <libssh2-devel@cool.haxx.se>; Fri, 24 Dec 2010 03:44:53 +0100
Received: (qmail 23524 invoked from network); 24 Dec 2010 02:44:47 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 24 Dec 2010 02:44:47 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Fri, 24 Dec 2010 02:44:46 -0000
X-URL: http://trac.libssh2.org/
Subject: [libssh2] #204: Enhance authentication to return partial success codes
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/204
Message-ID: <045.73f5346bcf876dd86404e34a72fb003e@libssh2.stuge.se>
X-Trac-Ticket-ID: 204
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Fri, 24 Dec 2010 03:45:17 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Fri, 24 Dec 2010 03:44:53 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

#204: Enhance authentication to return partial success codes
-----------------------------+----------------------------------------------
  Reporter:  riordanmr       |       Owner:       
      Type:  enhancement     |      Status:  new  
  Priority:  normal          |   Milestone:  1.2.8
 Component:  API             |     Version:  1.2.7
  Keywords:  authentication  |      Blocks:       
Blocked By:                  |  
-----------------------------+----------------------------------------------
 Let's enhance libssh2_userauth_password_ex and libssh2_userauth_publickey
 (and friends) to return a code to indicate that the password or public key
 was successful, but that more authentication is required by the server.
 This would make it easier to deal with servers that require both password
 and public key.

 Likely this would be done by defining a new error code,
 LIBSSH2_ERROR_AUTHENTICATION_PARTIAL_SUCCESS.

 As mentioned by Peter Stuge, this would entail looking at the "partial
 success" field in SSH_MSG_USERAUTH_FAILURE responses.

 I plan on taking a stab at this.

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

From libssh2-devel-bounces@cool.haxx.se  Fri Dec 24 08:30:07 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBO7TjAh001980;
	Fri, 24 Dec 2010 08:30:03 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBO7ThV7001963
	for <libssh2-devel@cool.haxx.se>; Fri, 24 Dec 2010 08:29:43 +0100
Received: (qmail 10686 invoked from network); 24 Dec 2010 07:29:42 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 24 Dec 2010 07:29:42 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Fri, 24 Dec 2010 07:29:42 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #204: Enhance authentication to return partial
	success codes
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/204#comment:1
Message-ID: <060.34df2b084e29a262673784bab324b23b@libssh2.stuge.se>
References: <045.73f5346bcf876dd86404e34a72fb003e@libssh2.stuge.se>
X-Trac-Ticket-ID: 204
In-Reply-To: <045.73f5346bcf876dd86404e34a72fb003e@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Fri, 24 Dec 2010 08:30:07 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Fri, 24 Dec 2010 08:29:43 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

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


Comment:

 Good stuff! I like the new return code name. I think it will be fairly
 easy to do; all changes will be in userauth.c and there aren't too many
 sites that handle USERAUTH_FAILURE, I think it's enough to add a check for
 partial success there. A new partial_success field may also have to be
 added to some struct.

 Thanks for looking into it! You get the ticket. :) Just change it if
 you're no longer working on it.

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

From libssh2-devel-bounces@cool.haxx.se  Tue Dec 28 02:04:52 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBS14Yss019400;
	Tue, 28 Dec 2010 02:04:50 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBS14Xic019352
	for <libssh2-devel@cool.haxx.se>; Tue, 28 Dec 2010 02:04:33 +0100
Received: (qmail 9921 invoked from network); 28 Dec 2010 01:04:27 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 28 Dec 2010 01:04:27 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Tue, 28 Dec 2010 01:04:27 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #204: Enhance authentication to return partial
	success codes
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/204#comment:2
Message-ID: <060.85a0baefa40b0ec477deb7ba1178ab5d@libssh2.stuge.se>
References: <045.73f5346bcf876dd86404e34a72fb003e@libssh2.stuge.se>
X-Trac-Ticket-ID: 204
In-Reply-To: <045.73f5346bcf876dd86404e34a72fb003e@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Tue, 28 Dec 2010 02:04:52 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Tue, 28 Dec 2010 02:04:33 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

Comment (by riordanmr):

 I coded this, but I'm having a tough time testing it due to the difficulty
 of finding a suitable server.  It seems that few servers both implement
 the ability to require multiple authentication methods, AND correctly set
 the "partial success" flag.
 Other clients seem to get around this by ignoring the "partial success"
 flag and trying additional authentication methods regardless of failure.
 So this whole exercise seems kind of pointless.

 Nevertheless, on my fifth server brand, I seem to have located one
 (Tectia, from ssh.com).  I'm reading up on Tectia "Authentication chains"
 and will try this eventually.

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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 29 01:13:29 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBT0DCfa007661;
	Wed, 29 Dec 2010 01:13:25 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBT0CNr9007331; Wed, 29 Dec 2010 01:12:23 +0100
Date: Wed, 29 Dec 2010 01:12:23 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libcurl development <curl-library@cool.haxx.se>
Subject: Re: libcurl + libssh2: strange error on Win64 (compiled using VS 2008)
In-Reply-To: <405218.27007.qm@web112011.mail.gq1.yahoo.com>
Message-ID: <alpine.DEB.2.00.1012290108460.12863@tvnag.unkk.fr>
References: <405218.27007.qm@web112011.mail.gq1.yahoo.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 29 Dec 2010 01:13:29 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 29 Dec 2010 01:12:23 +0100 (CET)
Cc: libssh2 development <libssh2-devel@cool.haxx.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Tue, 28 Dec 2010, S.Gopi wrote:

I'm CC'ing this to the libssh2 list as well. First mail is found here: 
http://curl.haxx.se/mail/lib-2010-12/0400.html

[both lists only allow subscribers to post, so if you cross-post you should 
be aware]

> In scp_recv function in ssh.c, libssh2_channel_read function is called which 
> returns ERROR_EAGAIN which is stored in variable 'nread'. This variable 
> nread is declared ssize_t (typedef __int64 for Windows 64 in 
> config-win32.h). For reason which I don't know of, nread has an arbitrary 
> current value of 4294967259 instead of expected -37 (ERROR_EAGAIN).

> BTW, when I declared ssize_t as int  (instead of __int64) in config_win32.h, 
> then the problem goes away and the file gets downloaded successfully.

In the public libssh2.h header the ssize_t is typedef'ed to an int. Isn't that 
causing this problem?

I would expect that libssh2 needs something similar to this to start with:

diff --git a/include/libssh2.h b/include/libssh2.h
index e011d49..1347b74 100644
--- a/include/libssh2.h
+++ b/include/libssh2.h
@@ -122,7 +122,11 @@ typedef unsigned int uint32_t;
  typedef unsigned __int64 libssh2_uint64_t;
  typedef __int64 libssh2_int64_t;
  # ifndef _SSIZE_T_DEFINED
+#ifdef _WIN64
+typedef __int64 ssize_t;
+#else
  typedef int ssize_t;
+#endif
  # define _SSIZE_T_DEFINED
  #endif
  #else




-- 

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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 29 02:12:21 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBT1CBVD018947;
	Wed, 29 Dec 2010 02:12:19 +0100
Received: from imail.ipswitch.com (imail.ipswitch.com [156.21.1.5])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBT1C9fp018901
	for <libssh2-devel@cool.haxx.se>; Wed, 29 Dec 2010 02:12:10 +0100
DKIM-Signature: q=dns/txt; v=1; c=relaxed/relaxed; s=ipswitch;
	d=ipswitch.com; a=rsa-sha1;
	h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:
	Content-Transfer-Encoding;
	b=AFuen7KjWvVloorrMBNUTYCM0jC2JoTkrnkenKQD9dL4Do47fTefc36COWklUhHbn5
	Min7kO1sdGf0ybAFvDiUpAT9yaBf5JwSQfYb2na3KWFPz7BJrAfKzEPfYty2lVHjCGtP
	efb3ZUiagL+18PZWAjt/XcBtUCUgTTlIF6r5w=;
	bh=k3skwgpbp7obtlLWTwpAqp2sRnE=; t=1293585120;
Received: from mrrnt [66.170.5.130] by ipswitch.com with ESMTP
	(SMTPD-11.03) id ed98003b3f252b00; Tue, 28 Dec 2010 20:11:59 -0500
From: "Mark Riordan" <mriordan@ipswitch.com>
To: "'libssh2 development'" <libssh2-devel@cool.haxx.se>
Subject: Regression: Unable to send FXP_CLOSE command
Date: Tue, 28 Dec 2010 19:11:59 -0600
Message-ID: <001f01cba6f5$6508e070$2f1aa150$@com>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: Acum9WSkQIzyeNYnSu2KbZNGKJMoIw==
Content-Language: en-us
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 29 Dec 2010 02:12:21 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 29 Dec 2010 02:12:10 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

The latest libssh2 often returns the error
"Unable to send FXP_CLOSE command"
from libssh2_sftp_close(sftp_handle) when it's called after a download.
This is because in sftp_close_handle, after this line:

        rc = _libssh2_channel_write(channel, 0, handle->close_packet,
                                    packet_len);

the code sees that rc is greater than packet_len.

In all cases that I've seen, the file been downloaded correctly.

This seems to be a timing problem because, unfortunately, 
I haven't been able to reproduce the problem with full tracing.

I have been able to reproduce it with limited tracing; my trace ends with:

[libssh2] 1.851175 SFTP: Received packet 103 (len 2009)
[libssh2] 1.851175 SFTP: recv packet
[libssh2] 1.851175 Conn: channel_read() got 4 of data from 0/0/0
[libssh2] 1.851175 SFTP: Data begin - Packet Length: 2009
[libssh2] 1.851175 Conn: 160 bytes packet_add() for 0/0/0
[libssh2] 1.851175 Conn: 160 bytes packet_add() for 0/0/0
[libssh2] 1.851175 Conn: 160 bytes packet_add() for 0/0/0
[libssh2] 1.851175 Conn: 160 bytes packet_add() for 0/0/0
[libssh2] 1.851175 Conn: 160 bytes packet_add() for 0/0/0
[libssh2] 1.851175 Conn: channel_read() got 2009 of data from 0/0/0
[libssh2] 1.851175 SFTP: Received packet 103 (len 2009)
[libssh2] 1.851175 SFTP: recv packet
[libssh2] 1.851175 Conn: channel_read() got 4 of data from 0/0/0
[libssh2] 1.851175 SFTP: Data begin - Packet Length: 2009
[libssh2] 1.851175 Conn: channel_read() got 2009 of data from 0/0/0
[libssh2] 1.851175 SFTP: Received packet 103 (len 2009)
[libssh2] 1.851175 SFTP: recv packet
[libssh2] 1.851175 Conn: channel_read() got 4 of data from 0/0/0
[libssh2] 1.851175 SFTP: Data begin - Packet Length: 2009
[libssh2] 1.851175 Conn: channel_read() got 1506 of data from 0/0/0 [ul]
[libssh2] 1.851175 Conn: channel_read() got 503 of data from 0/0/0
[libssh2] 1.851175 SFTP: Received packet 103 (len 2009)
[libssh2] 1.851175 SFTP: recv packet
[libssh2] 1.851175 Conn: channel_read() got 4 of data from 0/0/0
[libssh2] 1.851175 SFTP: Data begin - Packet Length: 2009
[libssh2] 1.851175 Conn: channel_read() got 2009 of data from 0/0/0
[libssh2] 1.851175 SFTP: Received packet 103 (len 2009)
[libssh2] 1.851175 SFTP: recv packet
[libssh2] 1.851175 Conn: channel_read() got 4 of data from 0/0/0
[libssh2] 1.851175 SFTP: Data begin - Packet Length: 2009
[libssh2] 1.851175 Conn: channel_read() got 2009 of data from 0/0/0
[libssh2] 1.851175 SFTP: Received packet 103 (len 2009)
[libssh2] 1.851175 SFTP: recv packet
[libssh2] 1.851175 Conn: channel_read() got 4 of data from 0/0/0
[libssh2] 1.851175 SFTP: Data begin - Packet Length: 2009
[libssh2] 1.851175 Conn: channel_read() got 2009 of data from 0/0/0
[libssh2] 1.851175 SFTP: Received packet 103 (len 2009)
[libssh2] 1.851175 SFTP: recv packet
[libssh2] 1.851175 Conn: channel_read() got 4 of data from 0/0/0
[libssh2] 1.851175 SFTP: Data begin - Packet Length: 2009
[libssh2] 1.851175 Conn: channel_read() got 2009 of data from 0/0/0
[libssh2] 1.851175 SFTP: Received packet 103 (len 2009)
[libssh2] 1.851175 SFTP: recv packet
[libssh2] 1.851175 Conn: channel_read() got 4 of data from 0/0/0
[libssh2] 1.851175 SFTP: Data begin - Packet Length: 1645
[libssh2] 1.851175 Conn: channel_read() got 1645 of data from 0/0/0
[libssh2] 1.851175 SFTP: Received packet 103 (len 1645)
[libssh2] 1.851175 SFTP: recv packet
[libssh2] 1.851175 Conn: channel_read() got 4 of data from 0/0/0
[libssh2] 1.851175 SFTP: Data begin - Packet Length: 28
[libssh2] 1.851175 Conn: channel_read() got 28 of data from 0/0/0
[libssh2] 1.851175 SFTP: Received packet 101 (len 28)
[libssh2] 1.851175 SFTP: Closing handle
[libssh2] 1.851175 Failure Event: -7 - Unable to send FXP_CLOSE command
[libssh2] 1.851175 Conn: Freeing channel 0/0 resources
[libssh2] 1.851175 Conn: Sending EOF on channel 0/0
[libssh2] 1.851175 Conn: Closing channel 0/0
[libssh2] 1.851175 Conn: 128 bytes packet_add() for 0/0/0

(It's interesting that the "Received packet" messages nearly always
list packet 103.  The only exceptions are the first, second, and last.)

Should I log a bug in Trac, even though the problem doesn't occur
in the released version?

Let me know what additional info you want.

Thanks.

Mark R



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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 29 18:05:24 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBTH56mj017202;
	Wed, 29 Dec 2010 18:05:22 +0100
Received: from nm16-vm1.bullet.mail.sp2.yahoo.com
	(nm16-vm1.bullet.mail.sp2.yahoo.com [98.139.91.211])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id oBTH53ba016658
	for <libssh2-devel@cool.haxx.se>; Wed, 29 Dec 2010 18:05:04 +0100
Received: from [98.139.91.68] by nm16.bullet.mail.sp2.yahoo.com with NNFMP;
	29 Dec 2010 17:04:54 -0000
Received: from [98.139.91.40] by tm8.bullet.mail.sp2.yahoo.com with NNFMP;
	29 Dec 2010 17:04:54 -0000
Received: from [127.0.0.1] by omp1040.mail.sp2.yahoo.com with NNFMP;
	29 Dec 2010 17:04:54 -0000
X-Yahoo-Newman-Property: ymail-5
X-Yahoo-Newman-Id: 914130.14412.bm@omp1040.mail.sp2.yahoo.com
Received: (qmail 94567 invoked by uid 60001); 29 Dec 2010 17:04:54 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024;
	t=1293642294; bh=0FgFt4EyfM4O0KmKw7/9x7jp0Z87TB6U93UlcrdRc7k=;
	h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type;
	b=L6LndhayrhcTS+1TnaB/yILo+qqFfyR8Q8ADHXogEI7mZ+482Va2yfM25gDab6lvh9JbvbMVOLKiAK/w9l+48CsePLSKLXqAOqfvNqFcIOC16hDn21LtM/EGvi5tv/Ux3323UpeM2BpG0kaEl5flJ4xd2nfrooQC12KeGJo6OV4=
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com;
	h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type;
	b=k4voJVmTajIWj76JtbOYckf46Px/w2ClfiQOMm/rsCsfPLo2Lym+H1jDjETdJwcf7lsUuXZBXdkSTG3kwP84wUstG+PAKF2DBx0vGAj3IcxOMovCoXOAHiS8jMN874hXCmbu8qjtFLU/XRmGf5EhoKDbKAplvr5HoH/suNYi6x4=;
Message-ID: <368131.88012.qm@web112010.mail.gq1.yahoo.com>
X-YMail-OSG: _bEGX.8VM1nofREomwqgiLL6u._ovBetHsFoJGlkL3BIRyb
	BPN3s6SBYLt99RLdFkQWMPVyK.YbmMMul4gPKb5AXzUCcW.rQLtHxAnQ7Vy6
	YSE5o4egHwdFKRW58xdTl3xOn53luJ.M4B2.69_NS6guJlBkhMF6AulOl3Sm
	AG8QoEkVeyLyGIFyT2hjqX_AjyLcV2w.h_thCkqy4VGGMx5IXobNnmFQQHvZ
	SlxqvsAaRAf9K79xezgdqUfPJGuEBd5jirxeZpbv7EfDYj_e_w16vIbrSTIg
	SXuRLeDZL_QqibNo30CC.oYy2pQ3raqaFeyXWmC8jv0HcuaLBZTGu8StPRUG
	QOwh4AIdqE34CAN_hmJNAha4bxtMfNHoaAgiGwA2XZyPLYpJRCYarbdrVSYB
	E7jLubcncTCU-
Received: from [15.203.233.211] by web112010.mail.gq1.yahoo.com via HTTP;
	Wed, 29 Dec 2010 09:04:54 PST
X-Mailer: YahooMailRC/553 YahooMailWebService/0.8.107.285259
Date: Wed, 29 Dec 2010 09:04:54 -0800 (PST)
From: "S.Gopi" <sekargopi@yahoo.com>
Subject: Re: libcurl + libssh2: strange error on Win64 (compiled using VS 2008)
To: curl-library-request@cool.haxx.se, libssh2-devel@cool.haxx.se
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 29 Dec 2010 18:05:24 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 29 Dec 2010 18:05:05 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0964608312=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============0964608312==
Content-Type: multipart/alternative; boundary="0-1077601511-1293642294=:88012"

--0-1077601511-1293642294=:88012
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

=0AHi All,=0A=0A  Sorry for not replying quickly. For some reason my subscr=
iption to the list is =0Aset to digest mode and I didn't receive any of you=
r mails (and my digest mail =0Awent to spam folder)=0A=0ATo reply all your =
questions:=0A=0A* I don't have a simple code to just demonstrate this, but =
if you guys insist on =0Athis then I can work on that. =0A=0A=0A* As I unde=
rstand, the problem is libssh2 is returning a unsigned int (int) =0Awhich l=
ibcurl typecasts in to __int64. Am I correct ? If yes, I expect the =0Aactu=
al fix should be at libssh2, is that correct  ? (I am CC'ing this to =0Alib=
ssh2-devel list as well)=0A=0A* I don't want to reinvest my time to get thi=
s work in mingw-w64. I spent a good =0Afew days to get this whole thing set=
up and I wish to avoid that (and any other =0Aproblem that may come out of =
mingw-w64).=0A=0A* Also what is the guarantee that the same issue won't hap=
pen if I use mingw-w64 =0A? is it because ssize_t is declared correctly in =
mingw-w64 ?=0A=0AThanks,=0A-Gopi=0A=0A
--0-1077601511-1293642294=:88012
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head><style type=3D"text/css"><!-- DIV {margin:0px;} --></style></he=
ad><body><div style=3D"font-family:arial,helvetica,sans-serif;font-size:10p=
t"><div><br>Hi All,<br><br>&nbsp; Sorry for not replying quickly. For some =
reason my subscription to the list is set to digest mode and I didn't recei=
ve any of your mails (and my digest mail went to spam folder)<br><br>To rep=
ly all your questions:<br><br>* I don't have a simple code to just demonstr=
ate this, but if you guys insist on this then I can work on that. <br><br>*=
 As I understand, the problem is libssh2 is returning a unsigned int (int) =
which libcurl typecasts in to __int64. Am I correct ? If yes, I expect the =
actual fix should be at libssh2, is that correct&nbsp; ? (I am CC'ing this =
to libssh2-devel list as well)<br><br>* I don't want to reinvest my time to=
 get this work in mingw-w64. I spent a good few days to get this whole thin=
g setup and I wish to avoid that (and any other problem that may come
 out of mingw-w64).<br><br>* Also what is the guarantee that the same issue=
 won't happen if I use mingw-w64 ? is it because ssize_t is declared correc=
tly in mingw-w64 ?<br><br>Thanks,<br>-Gopi<br><br><br><br><br></div>=0A</di=
v><br></body></html>
--0-1077601511-1293642294=:88012--

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

--===============0964608312==--

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 29 18:28:05 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBTHS12E028460;
	Wed, 29 Dec 2010 18:28:04 +0100
Received: from nm24-vm1.bullet.mail.ne1.yahoo.com
	(nm24-vm1.bullet.mail.ne1.yahoo.com [98.138.90.45])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id oBTHR76s027939
	for <libssh2-devel@cool.haxx.se>; Wed, 29 Dec 2010 18:27:07 +0100
Received: from [98.138.90.52] by nm24.bullet.mail.ne1.yahoo.com with NNFMP;
	29 Dec 2010 17:26:58 -0000
Received: from [98.138.87.7] by tm5.bullet.mail.ne1.yahoo.com with NNFMP;
	29 Dec 2010 17:26:58 -0000
Received: from [127.0.0.1] by omp1007.mail.ne1.yahoo.com with NNFMP;
	29 Dec 2010 17:26:58 -0000
X-Yahoo-Newman-Property: ymail-5
X-Yahoo-Newman-Id: 664013.60137.bm@omp1007.mail.ne1.yahoo.com
Received: (qmail 7521 invoked by uid 60001); 29 Dec 2010 17:26:58 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024;
	t=1293643617; bh=SUrkFHaz4YHt63SA+7HkXhJjYoRcLJ9GmS2DxBn5/Hc=;
	h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type;
	b=rz5tIyCPgOvN7OTl/9l5uCwvosbQ7mRZt9u4/2NiY2VskuP1nQ2yhONzl4hhYJfRaxJVoGwQJoSe8w76DmHxYA+fWBPuRaCd0HGPI8Dq0jNJ4BiHEZtqxASmFV9IVT0zgsoqRBjzumfMUX44kj2ZJGXVRjxk0uRPw7MaOBMEecE=
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com;
	h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type;
	b=0zyp+8OT0uE4Yt47/MO2K8DmtyTuJbOIT3oIbkGBptV+Rp8s09C3Ek/Zqe/2M7Ra1eRaA+dO3R3nUxVG4vFNGZKUlFtMfH/1pvfyZsv9Ie/dWGqMfXYficsoffKYUlxN+Bcd14KWh/TixLHbEBdq87BUrA3Ix0To8JPxNRoJR/A=;
Message-ID: <984366.3325.qm@web112010.mail.gq1.yahoo.com>
X-YMail-OSG: Lot_YdsVM1mcIvSSiieTxPTESYUDF5qQg581F_uLOMOuFjL
	6ziz68d.JGPxZUvskaJAY5R41LFty5v6fE.6KfHa7GMj0LxMCrScRmudz3BU
	HyE.hvqQy0ufi6wHE0qJ_ZbYznDjvos8dVmbuQBcTbaLmUR6cFVzZ79cxRMa
	2VScMXCJc4iU1xDuZKx975dKKfqqnZEaVa14RM6hDL_LUzlj5bdxdwTeU8EA
	v_PozuTNF9OPUjhAQeR5Etq_mDkqiHpacXTJn14ug1d1k2.7GPrzMhWMyH6E
	KQXUdyE8vggKGibklSSJdQoZ.CL3qkK0ZoPUt3sciCsZVXyvk2jPpeywwrLN
	SCIg7mwNpGvTEhisI55fFN0h3l9t2c.rJERCwyyb0dNwikIArnKvWCJ4VPUL
	jfrsq6wEcAsI-
Received: from [15.203.233.211] by web112010.mail.gq1.yahoo.com via HTTP;
	Wed, 29 Dec 2010 09:26:57 PST
X-Mailer: YahooMailRC/553 YahooMailWebService/0.8.107.285259
Date: Wed, 29 Dec 2010 09:26:57 -0800 (PST)
From: "S.Gopi" <sekargopi@yahoo.com>
Subject: libcurl + libssh2: strange error on Win64 (compiled using VS 2008)
To: curl-library@cool.haxx.se, libssh2-devel@cool.haxx.se
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 29 Dec 2010 18:28:05 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 29 Dec 2010 18:27:08 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1427835242=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============1427835242==
Content-Type: multipart/alternative; boundary="0-2030647496-1293643617=:3325"

--0-2030647496-1293643617=:3325
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

=0A=0A=0A=0A=0AHi All,=0A=0A  Sorry for not replying quickly. For some reas=
on my subscription to the list is =0Aset to digest mode and I didn't receiv=
e any of your mails (and my digest mail =0Awent to spam folder)=0A=0ATo rep=
ly all your questions:=0A=0A* I don't have a simple code to just demonstrat=
e this, but if you guys insist on =0Athis then I can work on that. =0A=0A=
=0A* As I understand, the problem is libssh2 is returning a unsigned int (i=
nt) =0Awhich libcurl typecasts in to __int64. Am I correct ? If yes, I expe=
ct the =0Aactual fix should be at libssh2, is that correct  ? (I am CC'ing =
this to =0Alibssh2-devel list as well)=0A=0A* I don't want to reinvest my t=
ime to get this work in mingw-w64. I spent a good =0Afew days to get this w=
hole thing setup and I wish to avoid that (and any other =0Aproblem that ma=
y come  out of mingw-w64).=0A=0A* Also what is the guarantee that the same =
issue won't happen if I use mingw-w64 =0A? is it because ssize_t is declare=
d correctly in mingw-w64 ?=0A=0AThanks,=0A-Gopi=0A=0A
--0-2030647496-1293643617=:3325
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head><style type=3D"text/css"><!-- DIV {margin:0px;} --></style></he=
ad><body><div style=3D"font-family:arial,helvetica,sans-serif;font-size:10p=
t"><div><br></div><div style=3D"font-family: arial,helvetica,sans-serif; fo=
nt-size: 10pt;"><br><div style=3D"font-family: times new roman,new york,tim=
es,serif; font-size: 12pt;"><div style=3D"font-family: arial,helvetica,sans=
-serif; font-size: 10pt;"><div><br>Hi All,<br><br>&nbsp; Sorry for not repl=
ying quickly. For some reason my subscription to the list is set to digest =
mode and I didn't receive any of your mails (and my digest mail went to spa=
m folder)<br><br>To reply all your questions:<br><br>* I don't have a simpl=
e code to just demonstrate this, but if you guys insist on this then I can =
work on that. <br><br>* As I understand, the problem is libssh2 is returnin=
g a unsigned int (int) which libcurl typecasts in to __int64. Am I correct =
? If yes, I expect the actual fix should be at libssh2, is that correct&nbs=
p;
 ? (I am CC'ing this to libssh2-devel list as well)<br><br>* I don't want t=
o reinvest my time to get this work in mingw-w64. I spent a good few days t=
o get this whole thing setup and I wish to avoid that (and any other proble=
m that may come=0A out of mingw-w64).<br><br>* Also what is the guarantee t=
hat the same issue won't happen if I use mingw-w64 ? is it because ssize_t =
is declared correctly in mingw-w64 ?<br><br>Thanks,<br>-Gopi<br><br><br><br=
><br></div>=0A</div><br></div></div>=0A</div><br></body></html>
--0-2030647496-1293643617=:3325--

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

--===============1427835242==--

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 29 18:56:43 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBTHuaGU016708;
	Wed, 29 Dec 2010 18:56:42 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBTHuYtU016699
	for <libssh2-devel@cool.haxx.se>; Wed, 29 Dec 2010 18:56:34 +0100
Date: Wed, 29 Dec 2010 18:56:34 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: libcurl + libssh2: strange error on Win64 (compiled using VS 2008)
In-Reply-To: <368131.88012.qm@web112010.mail.gq1.yahoo.com>
Message-ID: <alpine.DEB.2.00.1012291853030.13353@tvnag.unkk.fr>
References: <368131.88012.qm@web112010.mail.gq1.yahoo.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 29 Dec 2010 18:56:43 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 29 Dec 2010 18:56:34 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Wed, 29 Dec 2010, S.Gopi wrote:

> * As I understand, the problem is libssh2 is returning a unsigned int (int) 
> which libcurl typecasts in to __int64. Am I correct ? If yes, I expect the 
> actual fix should be at libssh2, is that correct ? (I am CC'ing this to 
> libssh2-devel list as well)

Yes, I'm convinced this problem exists in libssh2. The warnings Pierre showed 
us prove that we have work to do before we're good on 64bit.

> * Also what is the guarantee that the same issue won't happen if I use 
> mingw-w64 ? is it because ssize_t is declared correctly in mingw-w64 ?

It isn't. I'm on the contrary putting my money on that we have the same 
problems with mingw-w64.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 29 19:21:08 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBTIL0Yq002173;
	Wed, 29 Dec 2010 19:21:07 +0100
Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com
	[209.85.213.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBTIKMPj001394; Wed, 29 Dec 2010 19:20:22 +0100
Received: by yxh35 with SMTP id 35so5252289yxh.41
	for <multiple recipients>; Wed, 29 Dec 2010 10:20:14 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:received:in-reply-to
	:references:date:message-id:subject:from:to:cc:content-type;
	bh=UNz3OrMxin5T+6I1oZkGzfGoNoIYnmnAJTnizITpVqg=;
	b=m/biO/Ai32gppWB7fmF95Bb3o77BLEMkMMVrNizAzptdzKImkw3c+Z7f0oKVyANZjU
	yIHUAYHj1dceu8GLXkMiiaKVGwqL1xD+oqV2isO3mEptoQdB9PmPqO4tX1W3mvSShdZk
	vtVUIN+KrgmpQXvxenKY183iGJqb02u5niJwc=
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
	:cc:content-type;
	b=I4wK8WeZThC6iy5fimgyUIu/pkHkWf6HZAavkK9oM5E7OHGeIJoBnpJ9oVULSyAIs2
	0U/gOmFIi4gKtMU5K0JtxwiowlHviXiuX+YCHRMbWtW6RQU+BE0JcGyee8MVNu5cega8
	nQ5PS5v+5I3UEzY6wNVoQ4Ztzii7pFEEJgAos=
MIME-Version: 1.0
Received: by 10.236.110.164 with SMTP id u24mr24043561yhg.98.1293646814375;
	Wed, 29 Dec 2010 10:20:14 -0800 (PST)
Received: by 10.236.108.139 with HTTP; Wed, 29 Dec 2010 10:20:14 -0800 (PST)
In-Reply-To: <984366.3325.qm@web112010.mail.gq1.yahoo.com>
References: <984366.3325.qm@web112010.mail.gq1.yahoo.com>
Date: Wed, 29 Dec 2010 19:20:14 +0100
Message-ID: <AANLkTi=2fA5yS5G9cWWzKprGkBuN6EyPgrXMKgrZbkAR@mail.gmail.com>
Subject: Re: libcurl + libssh2: strange error on Win64 (compiled using VS 2008)
From: Vincent Torri <vincent.torri@gmail.com>
To: libcurl development <curl-library@cool.haxx.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 29 Dec 2010 19:21:08 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 29 Dec 2010 19:20:23 +0100 (CET)
Cc: libssh2-devel@cool.haxx.se
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============1741125037=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============1741125037==
Content-Type: multipart/alternative; boundary=0023547c8a21d5f0c20498909e84

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

On Wed, Dec 29, 2010 at 6:26 PM, S.Gopi <sekargopi@yahoo.com> wrote:

>
>
>
> Hi All,
>
>   Sorry for not replying quickly. For some reason my subscription to the
> list is set to digest mode and I didn't receive any of your mails (and my
> digest mail went to spam folder)
>
> To reply all your questions:
>
> * I don't have a simple code to just demonstrate this, but if you guys
> insist on this then I can work on that.
>
> * As I understand, the problem is libssh2 is returning a unsigned int (int)
> which libcurl typecasts in to __int64. Am I correct ? If yes, I expect the
> actual fix should be at libssh2, is that correct  ? (I am CC'ing this to
> libssh2-devel list as well)
>
> * I don't want to reinvest my time to get this work in mingw-w64. I spent a
> good few days to get this whole thing setup and I wish to avoid that (and
> any other problem that may come out of mingw-w64).
>
> * Also what is the guarantee that the same issue won't happen if I use
> mingw-w64 ? is it because ssize_t is declared correctly in mingw-w64 ?
>

look into io.h to see ho ssize_t is declared in mingw-w64 headers. But as
another poster mentioned it, use SSIZE_T on Windows:

http://msdn.microsoft.com/en-us/library/aa383751%28v=vs.85%29.aspx

Vincent Torri

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

<br><br><div class=3D"gmail_quote">On Wed, Dec 29, 2010 at 6:26 PM, S.Gopi =
<span dir=3D"ltr">&lt;<a href=3D"mailto:sekargopi@yahoo.com">sekargopi@yaho=
o.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"m=
argin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); paddin=
g-left: 1ex;">
<div><div style=3D"font-family: arial,helvetica,sans-serif; font-size: 10pt=
;"><div><br></div><div style=3D"font-family: arial,helvetica,sans-serif; fo=
nt-size: 10pt;"><br><div style=3D"font-family: times new roman,new york,tim=
es,serif; font-size: 12pt;">
<div style=3D"font-family: arial,helvetica,sans-serif; font-size: 10pt;"><d=
iv><br>Hi All,<br><br>=A0 Sorry for not replying quickly. For some reason m=
y subscription to the list is set to digest mode and I didn&#39;t receive a=
ny of your mails (and my digest mail went to spam folder)<br>
<br>To reply all your questions:<br><br>* I don&#39;t have a simple code to=
 just demonstrate this, but if you guys insist on this then I can work on t=
hat. <br><br>* As I understand, the problem is libssh2 is returning a unsig=
ned int (int) which libcurl typecasts in to __int64. Am I correct ? If yes,=
 I expect the actual fix should be at libssh2, is that correct=A0
 ? (I am CC&#39;ing this to libssh2-devel list as well)<br><br>* I don&#39;=
t want to reinvest my time to get this work in mingw-w64. I spent a good fe=
w days to get this whole thing setup and I wish to avoid that (and any othe=
r problem that may come
 out of mingw-w64).<br><br>* Also what is the guarantee that the same issue=
 won&#39;t happen if I use mingw-w64 ? is it because ssize_t is declared co=
rrectly in mingw-w64 ?<br></div></div></div></div></div></div></blockquote>
<div>=A0<br>look into io.h to see ho ssize_t is declared in mingw-w64 heade=
rs. But as another poster mentioned it, use SSIZE_T on Windows:<br><br><a h=
ref=3D"http://msdn.microsoft.com/en-us/library/aa383751%28v=3Dvs.85%29.aspx=
">http://msdn.microsoft.com/en-us/library/aa383751%28v=3Dvs.85%29.aspx</a><=
br>
<br>Vincent Torri<br></div></div>

--0023547c8a21d5f0c20498909e84--

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

--===============1741125037==--

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 29 19:29:18 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBTITB59008051;
	Wed, 29 Dec 2010 19:29:17 +0100
Received: from nm28-vm0.bullet.mail.sp2.yahoo.com
	(nm28-vm0.bullet.mail.sp2.yahoo.com [98.139.91.234])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id oBTIT7tB008006
	for <libssh2-devel@cool.haxx.se>; Wed, 29 Dec 2010 19:29:08 +0100
Received: from [98.139.91.65] by nm28.bullet.mail.sp2.yahoo.com with NNFMP;
	29 Dec 2010 18:28:59 -0000
Received: from [98.139.91.26] by tm5.bullet.mail.sp2.yahoo.com with NNFMP;
	29 Dec 2010 18:28:59 -0000
Received: from [127.0.0.1] by omp1026.mail.sp2.yahoo.com with NNFMP;
	29 Dec 2010 18:28:59 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 578898.35862.bm@omp1026.mail.sp2.yahoo.com
Received: (qmail 7365 invoked by uid 60001); 29 Dec 2010 18:28:59 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024;
	t=1293647339; bh=ncc/NsV9cj4Xvj8/XD7d3MeYqJmsxIr31VzYBQqxAwk=;
	h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type;
	b=qTzjqvee3vWnTQikrnaGaP45fkdgrsHhQHJGnS3Fi3ka6t8UX0V5zvyy4TnwZ4Ap3dz0/yWX4Jb67XuPx1KKnKfDYPFp7bB+jkXUhBLxxI3+4BYBei7yoMj8XykjUSN9mCa9C67YPYE5VmY/zWVjRxwR0ILXLex/MvR97tm7rGg=
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com;
	h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type;
	b=gG+OZJNuP43USZ6oTl8a2ubGygLde2k1F8VvhJmpvZXNSAbFaMyhImOCYmjaVETKrPbw8nSGFunXA3PZTYyuStdJZ+Wt4BIrXOxANVap1XJt0NbDZsdcPR3GKeFuXShQYL4qknxDPpJ76PPgb6Pw1hkyNXT+rZ/Wi6mRdoWR6T8=;
Message-ID: <45504.6233.qm@web112017.mail.gq1.yahoo.com>
X-YMail-OSG: VzD5Mi0VM1ljKq9Tkb54L6156hGkCZLm0MOhKAm7eMAEfo9
	s8j_C.vzlI4AbPAm6QIDuIQdd4nu93YIaurrv44OOPnzh.klZBZv2y5TKZcz
	8Nt9UvaW.UCl.ciLjmJEEoAy.CxhtHorD6UnQRgO7tP9.PyRsTjnJ55rtu1Y
	zau_rZi0BfKovqFds4N0JgA4Rh_cYOwrmT4HiiHOFb9bWhWd4UbfvySJernZ
	dCWaI3ODwEyYjzQNmWNLCllHrIboyrsvhTlcS7FgsKqLIE6ClOVYj0lZYYfm
	4qMgqTSt1Dqyco22vWQTcCybEw7Od9yzQNUoD8jIwoxE1flaQTfJ2fJsed5g
	YSyAOoWjNNqEJrlqvlxq4wMiV5PfhpTRap8_j9D8Qiv3BGaVmWbr350ZGbdj
	vDTwW8vShCRc-
Received: from [15.203.233.211] by web112017.mail.gq1.yahoo.com via HTTP;
	Wed, 29 Dec 2010 10:28:58 PST
X-Mailer: YahooMailRC/553 YahooMailWebService/0.8.107.285259
References: <984366.3325.qm@web112010.mail.gq1.yahoo.com>
	<AANLkTi=2fA5yS5G9cWWzKprGkBuN6EyPgrXMKgrZbkAR@mail.gmail.com>
Date: Wed, 29 Dec 2010 10:28:58 -0800 (PST)
From: "S.Gopi" <sekargopi@yahoo.com>
Subject: Re: libcurl + libssh2: strange error on Win64 (compiled using VS 2008)
To: libssh2 development <libssh2-devel@cool.haxx.se>,
        libcurl development <curl-library@cool.haxx.se>
In-Reply-To: <AANLkTi=2fA5yS5G9cWWzKprGkBuN6EyPgrXMKgrZbkAR@mail.gmail.com>
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 29 Dec 2010 19:29:18 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 29 Dec 2010 19:29:09 +0100 (CET)
Cc: libssh2-devel@cool.haxx.se
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0284238337=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============0284238337==
Content-Type: multipart/alternative; boundary="0-562117979-1293647338=:6233"

--0-562117979-1293647338=:6233
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

=0AIf it is defined in Windows then what is the reason for not using it ins=
tead of =0Adefining ssize_it (as __int64 or int) in libcurl ?  =0A=0A=0A-Go=
pi=0A=0A=0A=0A=0A=0A________________________________=0AFrom: Vincent Torri =
<vincent.torri@gmail.com>=0ATo: libcurl development <curl-library@cool.haxx=
.se>=0ACc: libssh2-devel@cool.haxx.se=0ASent: Wed, 29 December, 2010 12:20:=
14 PM=0ASubject: Re: libcurl + libssh2: strange error on Win64 (compiled us=
ing VS 2008)=0A=0A=0A=0A=0AOn Wed, Dec 29, 2010 at 6:26 PM, S.Gopi <sekargo=
pi@yahoo.com> wrote:=0A=0A=0A>=0A>=0A>=0A>=0A>Hi All,=0A>=0A>  Sorry for no=
t replying quickly. For some reason my subscription to the list is =0A>set =
to digest mode and I didn't receive any of your mails (and my digest mail =
=0A>went to spam folder)=0A>=0A>To reply all your questions:=0A>=0A>* I don=
't have a simple code to just demonstrate this, but if you guys insist on =
=0A>this then I can work on that. =0A>=0A>=0A>* As I understand, the proble=
m is libssh2 is returning a unsigned int (int) =0A>which libcurl typecasts =
in to __int64. Am I correct ? If yes, I expect the =0A>actual fix should be=
 at libssh2, is that correct   ? (I am CC'ing this to =0A>libssh2-devel lis=
t as well)=0A>=0A>* I don't want to reinvest my time to get this work in mi=
ngw-w64. I spent a good =0A>few days to get this whole thing setup and I wi=
sh to avoid that (and any other =0A>problem that may come  out of mingw-w64=
).=0A>=0A>* Also what is the guarantee that the same issue won't happen if =
I use mingw-w64 =0A>? is it because ssize_t is declared correctly in mingw-=
w64 ?=0A>=0A =0Alook into io.h to see ho ssize_t is declared in mingw-w64 h=
eaders. But as =0Aanother poster mentioned it, use SSIZE_T on Windows:=0A=
=0Ahttp://msdn.microsoft.com/en-us/library/aa383751%28v=3Dvs.85%29.aspx=0A=
=0AVincent Torri=0A=0A=0A
--0-562117979-1293647338=:6233
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head><style type=3D"text/css"><!-- DIV {margin:0px;} --></style></he=
ad><body><div style=3D"font-family:arial,helvetica,sans-serif;font-size:10p=
t"><div><br>If it is defined in Windows then what is the reason for not usi=
ng it instead of defining ssize_it (as __int64 or int) in libcurl ?&nbsp; <=
br><br>-Gopi<br><br></div><div style=3D"font-family: arial,helvetica,sans-s=
erif; font-size: 10pt;"><br><div style=3D"font-family: times new roman,new =
york,times,serif; font-size: 12pt;"><font size=3D"2" face=3D"Tahoma"><hr si=
ze=3D"1"><b><span style=3D"font-weight: bold;">From:</span></b> Vincent Tor=
ri &lt;vincent.torri@gmail.com&gt;<br><b><span style=3D"font-weight: bold;"=
>To:</span></b> libcurl development &lt;curl-library@cool.haxx.se&gt;<br><b=
><span style=3D"font-weight: bold;">Cc:</span></b> libssh2-devel@cool.haxx.=
se<br><b><span style=3D"font-weight: bold;">Sent:</span></b> Wed, 29 Decemb=
er, 2010 12:20:14 PM<br><b><span style=3D"font-weight: bold;">Subject:</spa=
n></b> Re:
 libcurl + libssh2: strange error on Win64 (compiled using VS 2008)<br></fo=
nt><br><br><br><div class=3D"gmail_quote">On Wed, Dec 29, 2010 at 6:26 PM, =
S.Gopi <span dir=3D"ltr">&lt;<a rel=3D"nofollow" ymailto=3D"mailto:sekargop=
i@yahoo.com" target=3D"_blank" href=3D"mailto:sekargopi@yahoo.com">sekargop=
i@yahoo.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" styl=
e=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); =
padding-left: 1ex;">=0A<div><div style=3D"font-family: arial,helvetica,sans=
-serif; font-size: 10pt;"><div><br></div><div style=3D"font-family: arial,h=
elvetica,sans-serif; font-size: 10pt;"><br><div style=3D"font-family: times=
 new roman,new york,times,serif; font-size: 12pt;">=0A<div style=3D"font-fa=
mily: arial,helvetica,sans-serif; font-size: 10pt;"><div><br>Hi All,<br><br=
>&nbsp; Sorry for not replying quickly. For some reason my subscription to =
the list is set to digest mode and I didn't receive any of your mails (and =
my digest mail went to spam folder)<br>=0A<br>To reply all your questions:<=
br><br>* I don't have a simple code to just demonstrate this, but if you gu=
ys insist on this then I can work on that. <br><br>* As I understand, the p=
roblem is libssh2 is returning a unsigned int (int) which libcurl typecasts=
 in to __int64. Am I correct ? If yes, I expect the actual fix should be at=
 libssh2, is that correct&nbsp;=0A ? (I am CC'ing this to libssh2-devel lis=
t as well)<br><br>* I don't want to reinvest my time to get this work in mi=
ngw-w64. I spent a good few days to get this whole thing setup and I wish t=
o avoid that (and any other problem that may come=0A out of mingw-w64).<br>=
<br>* Also what is the guarantee that the same issue won't happen if I use =
mingw-w64 ? is it because ssize_t is declared correctly in mingw-w64 ?<br><=
/div></div></div></div></div></div></blockquote>=0A<div>&nbsp;<br>look into=
 io.h to see ho ssize_t is declared in mingw-w64 headers. But as another po=
ster mentioned it, use SSIZE_T on Windows:<br><br><a rel=3D"nofollow" targe=
t=3D"_blank" href=3D"http://msdn.microsoft.com/en-us/library/aa383751%28v=
=3Dvs.85%29.aspx">http://msdn.microsoft.com/en-us/library/aa383751%28v=3Dvs=
.85%29.aspx</a><br>=0A<br>Vincent Torri<br></div></div>=0A</div></div>=0A</=
div><br></body></html>
--0-562117979-1293647338=:6233--

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

--===============0284238337==--

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 29 19:29:53 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBTITpxD008390;
	Wed, 29 Dec 2010 19:29:52 +0100
Received: from nm24.bullet.mail.ne1.yahoo.com (nm24.bullet.mail.ne1.yahoo.com
	[98.138.90.87])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with SMTP id oBTIT8R6008009
	for <libssh2-devel@cool.haxx.se>; Wed, 29 Dec 2010 19:29:08 +0100
Received: from [98.138.90.50] by nm24.bullet.mail.ne1.yahoo.com with NNFMP;
	29 Dec 2010 18:29:00 -0000
Received: from [98.138.87.11] by tm3.bullet.mail.ne1.yahoo.com with NNFMP;
	29 Dec 2010 18:29:00 -0000
Received: from [127.0.0.1] by omp1011.mail.ne1.yahoo.com with NNFMP;
	29 Dec 2010 18:29:00 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 118016.14903.bm@omp1011.mail.ne1.yahoo.com
Received: (qmail 7365 invoked by uid 60001); 29 Dec 2010 18:28:59 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024;
	t=1293647339; bh=ncc/NsV9cj4Xvj8/XD7d3MeYqJmsxIr31VzYBQqxAwk=;
	h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type;
	b=qTzjqvee3vWnTQikrnaGaP45fkdgrsHhQHJGnS3Fi3ka6t8UX0V5zvyy4TnwZ4Ap3dz0/yWX4Jb67XuPx1KKnKfDYPFp7bB+jkXUhBLxxI3+4BYBei7yoMj8XykjUSN9mCa9C67YPYE5VmY/zWVjRxwR0ILXLex/MvR97tm7rGg=
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com;
	h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type;
	b=gG+OZJNuP43USZ6oTl8a2ubGygLde2k1F8VvhJmpvZXNSAbFaMyhImOCYmjaVETKrPbw8nSGFunXA3PZTYyuStdJZ+Wt4BIrXOxANVap1XJt0NbDZsdcPR3GKeFuXShQYL4qknxDPpJ76PPgb6Pw1hkyNXT+rZ/Wi6mRdoWR6T8=;
Message-ID: <45504.6233.qm@web112017.mail.gq1.yahoo.com>
X-YMail-OSG: VzD5Mi0VM1ljKq9Tkb54L6156hGkCZLm0MOhKAm7eMAEfo9
	s8j_C.vzlI4AbPAm6QIDuIQdd4nu93YIaurrv44OOPnzh.klZBZv2y5TKZcz
	8Nt9UvaW.UCl.ciLjmJEEoAy.CxhtHorD6UnQRgO7tP9.PyRsTjnJ55rtu1Y
	zau_rZi0BfKovqFds4N0JgA4Rh_cYOwrmT4HiiHOFb9bWhWd4UbfvySJernZ
	dCWaI3ODwEyYjzQNmWNLCllHrIboyrsvhTlcS7FgsKqLIE6ClOVYj0lZYYfm
	4qMgqTSt1Dqyco22vWQTcCybEw7Od9yzQNUoD8jIwoxE1flaQTfJ2fJsed5g
	YSyAOoWjNNqEJrlqvlxq4wMiV5PfhpTRap8_j9D8Qiv3BGaVmWbr350ZGbdj
	vDTwW8vShCRc-
Received: from [15.203.233.211] by web112017.mail.gq1.yahoo.com via HTTP;
	Wed, 29 Dec 2010 10:28:58 PST
X-Mailer: YahooMailRC/553 YahooMailWebService/0.8.107.285259
References: <984366.3325.qm@web112010.mail.gq1.yahoo.com>
	<AANLkTi=2fA5yS5G9cWWzKprGkBuN6EyPgrXMKgrZbkAR@mail.gmail.com>
Date: Wed, 29 Dec 2010 10:28:58 -0800 (PST)
From: "S.Gopi" <sekargopi@yahoo.com>
Subject: Re: libcurl + libssh2: strange error on Win64 (compiled using VS 2008)
To: libssh2 development <libssh2-devel@cool.haxx.se>,
        libcurl development <curl-library@cool.haxx.se>
In-Reply-To: <AANLkTi=2fA5yS5G9cWWzKprGkBuN6EyPgrXMKgrZbkAR@mail.gmail.com>
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 29 Dec 2010 19:29:53 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 29 Dec 2010 19:29:09 +0100 (CET)
Cc: libssh2-devel@cool.haxx.se
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============0310243005=="
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

--===============0310243005==
Content-Type: multipart/alternative; boundary="0-562117979-1293647338=:6233"

--0-562117979-1293647338=:6233
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

=0AIf it is defined in Windows then what is the reason for not using it ins=
tead of =0Adefining ssize_it (as __int64 or int) in libcurl ?  =0A=0A=0A-Go=
pi=0A=0A=0A=0A=0A=0A________________________________=0AFrom: Vincent Torri =
<vincent.torri@gmail.com>=0ATo: libcurl development <curl-library@cool.haxx=
.se>=0ACc: libssh2-devel@cool.haxx.se=0ASent: Wed, 29 December, 2010 12:20:=
14 PM=0ASubject: Re: libcurl + libssh2: strange error on Win64 (compiled us=
ing VS 2008)=0A=0A=0A=0A=0AOn Wed, Dec 29, 2010 at 6:26 PM, S.Gopi <sekargo=
pi@yahoo.com> wrote:=0A=0A=0A>=0A>=0A>=0A>=0A>Hi All,=0A>=0A>  Sorry for no=
t replying quickly. For some reason my subscription to the list is =0A>set =
to digest mode and I didn't receive any of your mails (and my digest mail =
=0A>went to spam folder)=0A>=0A>To reply all your questions:=0A>=0A>* I don=
't have a simple code to just demonstrate this, but if you guys insist on =
=0A>this then I can work on that. =0A>=0A>=0A>* As I understand, the proble=
m is libssh2 is returning a unsigned int (int) =0A>which libcurl typecasts =
in to __int64. Am I correct ? If yes, I expect the =0A>actual fix should be=
 at libssh2, is that correct   ? (I am CC'ing this to =0A>libssh2-devel lis=
t as well)=0A>=0A>* I don't want to reinvest my time to get this work in mi=
ngw-w64. I spent a good =0A>few days to get this whole thing setup and I wi=
sh to avoid that (and any other =0A>problem that may come  out of mingw-w64=
).=0A>=0A>* Also what is the guarantee that the same issue won't happen if =
I use mingw-w64 =0A>? is it because ssize_t is declared correctly in mingw-=
w64 ?=0A>=0A =0Alook into io.h to see ho ssize_t is declared in mingw-w64 h=
eaders. But as =0Aanother poster mentioned it, use SSIZE_T on Windows:=0A=
=0Ahttp://msdn.microsoft.com/en-us/library/aa383751%28v=3Dvs.85%29.aspx=0A=
=0AVincent Torri=0A=0A=0A
--0-562117979-1293647338=:6233
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><head><style type=3D"text/css"><!-- DIV {margin:0px;} --></style></he=
ad><body><div style=3D"font-family:arial,helvetica,sans-serif;font-size:10p=
t"><div><br>If it is defined in Windows then what is the reason for not usi=
ng it instead of defining ssize_it (as __int64 or int) in libcurl ?&nbsp; <=
br><br>-Gopi<br><br></div><div style=3D"font-family: arial,helvetica,sans-s=
erif; font-size: 10pt;"><br><div style=3D"font-family: times new roman,new =
york,times,serif; font-size: 12pt;"><font size=3D"2" face=3D"Tahoma"><hr si=
ze=3D"1"><b><span style=3D"font-weight: bold;">From:</span></b> Vincent Tor=
ri &lt;vincent.torri@gmail.com&gt;<br><b><span style=3D"font-weight: bold;"=
>To:</span></b> libcurl development &lt;curl-library@cool.haxx.se&gt;<br><b=
><span style=3D"font-weight: bold;">Cc:</span></b> libssh2-devel@cool.haxx.=
se<br><b><span style=3D"font-weight: bold;">Sent:</span></b> Wed, 29 Decemb=
er, 2010 12:20:14 PM<br><b><span style=3D"font-weight: bold;">Subject:</spa=
n></b> Re:
 libcurl + libssh2: strange error on Win64 (compiled using VS 2008)<br></fo=
nt><br><br><br><div class=3D"gmail_quote">On Wed, Dec 29, 2010 at 6:26 PM, =
S.Gopi <span dir=3D"ltr">&lt;<a rel=3D"nofollow" ymailto=3D"mailto:sekargop=
i@yahoo.com" target=3D"_blank" href=3D"mailto:sekargopi@yahoo.com">sekargop=
i@yahoo.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" styl=
e=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); =
padding-left: 1ex;">=0A<div><div style=3D"font-family: arial,helvetica,sans=
-serif; font-size: 10pt;"><div><br></div><div style=3D"font-family: arial,h=
elvetica,sans-serif; font-size: 10pt;"><br><div style=3D"font-family: times=
 new roman,new york,times,serif; font-size: 12pt;">=0A<div style=3D"font-fa=
mily: arial,helvetica,sans-serif; font-size: 10pt;"><div><br>Hi All,<br><br=
>&nbsp; Sorry for not replying quickly. For some reason my subscription to =
the list is set to digest mode and I didn't receive any of your mails (and =
my digest mail went to spam folder)<br>=0A<br>To reply all your questions:<=
br><br>* I don't have a simple code to just demonstrate this, but if you gu=
ys insist on this then I can work on that. <br><br>* As I understand, the p=
roblem is libssh2 is returning a unsigned int (int) which libcurl typecasts=
 in to __int64. Am I correct ? If yes, I expect the actual fix should be at=
 libssh2, is that correct&nbsp;=0A ? (I am CC'ing this to libssh2-devel lis=
t as well)<br><br>* I don't want to reinvest my time to get this work in mi=
ngw-w64. I spent a good few days to get this whole thing setup and I wish t=
o avoid that (and any other problem that may come=0A out of mingw-w64).<br>=
<br>* Also what is the guarantee that the same issue won't happen if I use =
mingw-w64 ? is it because ssize_t is declared correctly in mingw-w64 ?<br><=
/div></div></div></div></div></div></blockquote>=0A<div>&nbsp;<br>look into=
 io.h to see ho ssize_t is declared in mingw-w64 headers. But as another po=
ster mentioned it, use SSIZE_T on Windows:<br><br><a rel=3D"nofollow" targe=
t=3D"_blank" href=3D"http://msdn.microsoft.com/en-us/library/aa383751%28v=
=3Dvs.85%29.aspx">http://msdn.microsoft.com/en-us/library/aa383751%28v=3Dvs=
.85%29.aspx</a><br>=0A<br>Vincent Torri<br></div></div>=0A</div></div>=0A</=
div><br></body></html>
--0-562117979-1293647338=:6233--

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

--===============0310243005==--

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 29 22:21:07 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBTLKptY030601;
	Wed, 29 Dec 2010 22:21:04 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBTLKYv3030479; Wed, 29 Dec 2010 22:20:34 +0100
Date: Wed, 29 Dec 2010 22:20:34 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libcurl development <curl-library@cool.haxx.se>
Subject: Re: libcurl + libssh2: strange error on Win64 (compiled using VS 2008)
In-Reply-To: <AANLkTik2hsN-8iu_-n4znKLq6m3VYEUPdVQP0b4J5vDt@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1012292217050.22137@tvnag.unkk.fr>
References: <405218.27007.qm@web112011.mail.gq1.yahoo.com>
	<alpine.DEB.2.00.1012290108460.12863@tvnag.unkk.fr>
	<AANLkTik2hsN-8iu_-n4znKLq6m3VYEUPdVQP0b4J5vDt@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 29 Dec 2010 22:21:07 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 29 Dec 2010 22:20:34 +0100 (CET)
Cc: libssh2 development <libssh2-devel@cool.haxx.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Wed, 29 Dec 2010, Pierre Joye wrote:

> I would say SSIZE_T, always on Windows. Both int or __int64 can be wrong.

I don't disagree that SSIZE_T might be the right answer, but I do have two 
questions about that:

A) what header(s) would we need to include to be sure SSIZE_T is typedef'ed 
and will those headers be the same on all known Windows compilers?

B) in which case is both int and __int64 wrong for ssize_t ?

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 29 22:42:57 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBTLgsAN010758;
	Wed, 29 Dec 2010 22:42:57 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBTLgkOf010463; Wed, 29 Dec 2010 22:42:46 +0100
Date: Wed, 29 Dec 2010 22:42:46 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libcurl development <curl-library@cool.haxx.se>
Subject: Re: libcurl + libssh2: strange error on Win64 (compiled using VS 2008)
In-Reply-To: <AANLkTi=4-X_6AN5+aXmj2gfwhnG8B18ka3LAWLOHvLKu@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1012292234440.22137@tvnag.unkk.fr>
References: <405218.27007.qm@web112011.mail.gq1.yahoo.com>
	<alpine.DEB.2.00.1012290108460.12863@tvnag.unkk.fr>
	<AANLkTik2hsN-8iu_-n4znKLq6m3VYEUPdVQP0b4J5vDt@mail.gmail.com>
	<alpine.DEB.2.00.1012292217050.22137@tvnag.unkk.fr>
	<AANLkTi=4-X_6AN5+aXmj2gfwhnG8B18ka3LAWLOHvLKu@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 29 Dec 2010 22:42:57 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 29 Dec 2010 22:42:46 +0100 (CET)
Cc: libssh2 development <libssh2-devel@cool.haxx.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Wed, 29 Dec 2010, Pierre Joye wrote:

>> A) what header(s) would we need to include to be sure SSIZE_T is typedef'ed 
>> and will those headers be the same on all known Windows compilers?
>
> BaseTsd.h, patch attached. Mingw should have it too or should have size_t 
> already defined in sys/types.h, at least any decent version (after 2008 or 
> so).

Right, but it is that "should" part that makes me concerned and what makes me 
less reluctant to switch to SSIZE_T like that. It suddenty puts us in a cat 
and mouse race where we need to make sure that we include the correct headers 
in the correct order for the compilers people want to use.

>> B) in which case is both int and __int64 wrong for ssize_t ?
>
> All, there are no guaranties that ssize_t is an integer (or long for what 
> matters), same for size_t.

Sorry, but you can't play that pedantic card on us. Quite clearly *every* 
32bit windows installation that ever tried libssh2 or libcurl work fine with 
ssize_t set to int. To my knowledge, all win64 installations work fine with 
ssize_t set to __int64 (we've used that in libcurl for quite some time 
already and I'm not aware of any problems caused by that).

Nobody can on a whim change those types on existing platforms to something 
else.

Which Windows systems don't use int or __int64 for ssize_t?

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Wed Dec 29 23:16:12 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBTMG6nQ008342;
	Wed, 29 Dec 2010 23:16:10 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBTMG46f008331; Wed, 29 Dec 2010 23:16:04 +0100
Date: Wed, 29 Dec 2010 23:16:04 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: libcurl + libssh2: strange error on Win64 (compiled using VS 2008)
In-Reply-To: <AANLkTinFR0rGGoKXsSPOs5XBbYohQx7cpBL1sYV+-grD@mail.gmail.com>
Message-ID: <alpine.DEB.2.00.1012292314400.22137@tvnag.unkk.fr>
References: <405218.27007.qm@web112011.mail.gq1.yahoo.com>
	<alpine.DEB.2.00.1012290108460.12863@tvnag.unkk.fr>
	<AANLkTik2hsN-8iu_-n4znKLq6m3VYEUPdVQP0b4J5vDt@mail.gmail.com>
	<alpine.DEB.2.00.1012292217050.22137@tvnag.unkk.fr>
	<AANLkTi=4-X_6AN5+aXmj2gfwhnG8B18ka3LAWLOHvLKu@mail.gmail.com>
	<alpine.DEB.2.00.1012292234440.22137@tvnag.unkk.fr>
	<AANLkTinFR0rGGoKXsSPOs5XBbYohQx7cpBL1sYV+-grD@mail.gmail.com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Wed, 29 Dec 2010 23:16:12 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Wed, 29 Dec 2010 23:16:04 +0100 (CET)
Cc: Pierre Joye <pierre.php@gmail.com>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Wed, 29 Dec 2010, Pierre Joye wrote:

(dropped the libcurl list from Cc)

> It is about being pedantic. The type exists and should be used instead of 
> guessing what is behind it.

Ah, I just noticed that the existing logic was already for VC only so I'm fine 
with the new suggested patch. Sorry for the extra noise!

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec 30 16:50:49 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBUFoQas011964;
	Thu, 30 Dec 2010 16:50:44 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBUFoPGY011959
	for <libssh2-devel@cool.haxx.se>; Thu, 30 Dec 2010 16:50:25 +0100
Date: Thu, 30 Dec 2010 16:50:25 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Regression: Unable to send FXP_CLOSE command
In-Reply-To: <001f01cba6f5$6508e070$2f1aa150$@com>
Message-ID: <alpine.DEB.2.00.1012301646530.19226@tvnag.unkk.fr>
References: <001f01cba6f5$6508e070$2f1aa150$@com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 30 Dec 2010 16:50:48 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 30 Dec 2010 16:50:25 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

On Tue, 28 Dec 2010, Mark Riordan wrote:

> The latest libssh2 often returns the error
> "Unable to send FXP_CLOSE command"
> from libssh2_sftp_close(sftp_handle) when it's called after a download.
> This is because in sftp_close_handle, after this line:
>
>        rc = _libssh2_channel_write(channel, 0, handle->close_packet,
>                                    packet_len);
>
> the code sees that rc is greater than packet_len.

Is rc really greater than packet_len and not just "different than" ?

> I have been able to reproduce it with limited tracing

Can you show us a little example code that can reproduce it?

> Should I log a bug in Trac, even though the problem doesn't occur in the 
> released version?

Please do, I like having the issues there so that we don't accidentally drop 
any. The fact that the problem hasn't been found in a released version doesn't 
change that I think.

-- 

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

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

#205: "Error waiting for FXP_READ ACK" during large download on Windows
------------------------+---------------------------------------------------
  Reporter:  riordanmr  |       Owner:       
      Type:  defect     |      Status:  new  
  Priority:  normal     |   Milestone:  1.2.8
 Component:  API        |     Version:  1.2.7
  Keywords:             |      Blocks:       
Blocked By:             |  
------------------------+---------------------------------------------------
 Occasionally during large downloads, libssh2_sftp_read returns -25, with
 error text "Error waiting for FXP_READ ACK".
 This problem seems to occur only on Windows, and not too often (only about
 1 of 5 attempts to download a 64 MB file).  I'm using a 100 Mbit/second
 low-latency LAN.

 This occurs on the version in git as of 2010-12-28.

 The problem doesn't seem to occur when tracing is set to a high level. I
 have been able to reproduce the problem with tracing set to
 LIBSSH2_TRACE_CONN | LIBSSH2_TRACE_SFTP | LIBSSH2_TRACE_ERROR.
 The attached file contains the source to my test program, the trace
 output, and the program's output.

 When libssh2_sftp_read fails, the subsequent call to libssh2_sftp_close
 hangs indefinitely.
 ----------------------------------------------
 Interestingly, the problem originally manifested itself as the call to
 libssh2_sftp_close failing after a successful download.  However, I can no
 longer reproduce that symptom, for reasons I don't understand.  Here's my
 description, as posted to the mailing list on 2010-12-28 (USA time):

 The latest libssh2 often returns the error
 "Unable to send FXP_CLOSE command"
 from libssh2_sftp_close(sftp_handle) when it's called after a download.
 This is because in sftp_close_handle, after this line:

         rc = _libssh2_channel_write(channel, 0, handle->close_packet,
                                     packet_len);

 the code sees that rc is greater than packet_len.  (At the time, I was
 able to step through this in the debugger and it was greater, not just not
 equal.  It was about 20 bytes larger than packet_len.)

 In all cases that I've seen, the file been downloaded correctly.

 This seems to be a timing problem because, unfortunately,
 I haven't been able to reproduce the problem with full tracing.

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

From libssh2-devel-bounces@cool.haxx.se  Thu Dec 30 19:31:06 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBUIUx3A014839;
	Thu, 30 Dec 2010 19:31:05 +0100
Received: from earth.stuge.se (earth.stuge.se [212.116.89.126])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBUIUvn7014824
	for <libssh2-devel@cool.haxx.se>; Thu, 30 Dec 2010 19:30:57 +0100
Received: (qmail 24396 invoked from network); 30 Dec 2010 18:30:54 -0000
Received: from unknown (HELO earth.stuge.se) (127.0.0.1)
	by localhost with SMTP; 30 Dec 2010 18:30:54 -0000
MIME-Version: 1.0
From: "libssh2 Trac" <trac@libssh2.stuge.se>
X-Trac-Version: 0.12
Precedence: bulk
Cc: libssh2-devel@cool.haxx.se
Auto-Submitted: auto-generated
X-Mailer: Trac 0.12, by Edgewall Software
X-Trac-Project: libssh2
Date: Thu, 30 Dec 2010 18:30:54 -0000
X-URL: http://trac.libssh2.org/
Subject: Re: [libssh2] #205: "Error waiting for FXP_READ ACK" during large
	download on Windows
X-Trac-Ticket-URL: http://trac.libssh2.org/ticket/205#comment:1
Message-ID: <060.76d9c306b28167d578a631de186eae5a@libssh2.stuge.se>
References: <045.22cd8a9b7f08a7953dd719389d002842@libssh2.stuge.se>
X-Trac-Ticket-ID: 205
In-Reply-To: <045.22cd8a9b7f08a7953dd719389d002842@libssh2.stuge.se>
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Thu, 30 Dec 2010 19:31:05 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Thu, 30 Dec 2010 19:30:57 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Reply-To: trac@libssh2.stuge.se,
        libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

IzIwNTogIkVycm9yIHdhaXRpbmcgZm9yIEZYUF9SRUFEIEFDSyIgZHVyaW5nIGxhcmdlIGRvd25s
b2FkIG9uIFdpbmRvd3MKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KICBSZXBvcnRlcjogIHJpb3JkYW5t
ciAgfCAgICAgICAgT3duZXI6ICAgICAgIA0KICAgICAgVHlwZTogIGRlZmVjdCAgICAgfCAgICAg
ICBTdGF0dXM6ICBuZXcgIA0KICBQcmlvcml0eTogIG5vcm1hbCAgICAgfCAgICBNaWxlc3RvbmU6
ICAxLjIuOA0KIENvbXBvbmVudDogIEFQSSAgICAgICAgfCAgICAgIFZlcnNpb246ICAxLjIuNw0K
UmVzb2x1dGlvbjogICAgICAgICAgICAgfCAgICAgS2V5d29yZHM6ICAgICAgIA0KICAgIEJsb2Nr
czogICAgICAgICAgICAgfCAgIEJsb2NrZWQgQnk6ICAgICAgIA0KLS0tLS0tLS0tLS0tLS0tLS0t
LS0tLS0tKy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t
LQoKQ29tbWVudCAoYnkgcmlvcmRhbm1yKToKCiAxLiAgV2hpbGUgdHJ5aW5nIHRvIHJlcHJvZHVj
ZSB0aGlzIHdpdGggdGhlIGRlYnVnZ2VyIHJ1bm5pbmcsIEkgZmluYWxseQ0KIGRpZCBjYXRjaCB0
aGUgcHJvZ3JhbSBhdCBzZnRwLmM6c2Z0cF9wYWNrZXRfcmVhZDoNCiAgaWYgKHBhY2tldF9sZW4g
PiBMSUJTU0gyX1NGVFBfUEFDS0VUX01BWExFTikNCiByZXR1cm4gX2xpYnNzaDJfZXJyb3Ioc2Vz
c2lvbiwNCiBMSUJTU0gyX0VSUk9SX0NIQU5ORUxfUEFDS0VUX0VYQ0VFREVELA0KICJTRlRQIHBh
Y2tldCB0b28gbGFyZ2UiKTsNCiBjYWxsIHN0YWNrOg0KID4gc2Z0cDJzbWFsbC5leGUhc2Z0cF9w
YWNrZXRfcmVhZChfTElCU1NIMl9TRlRQICogc2Z0cD0weDAwYTBlNGIwKSBMaW5lDQogMjEwIEMN
CiBzZnRwMnNtYWxsLmV4ZSFzZnRwX3BhY2tldF9yZXF1aXJldihfTElCU1NIMl9TRlRQICogc2Z0
cD0weDAwYTBlNGIwLCBpbnQNCiBudW1fdmFsaWRfcmVzcG9uc2VzPTIsIGNvbnN0IHVuc2lnbmVk
IGNoYXIgKiB2YWxpZF9yZXNwb25zZXM9MHgwMDQ5ODk4YywNCiB1bnNpZ25lZCBpbnQgcmVxdWVz
dF9pZD0yMjczMywgdW5zaWduZWQgY2hhciAqICogZGF0YT0weDAwMTFmNzUwLCB1bnNpZ25lZA0K
IGludCAqIGRhdGFfbGVuPTB4MDAxMWY3NDQpIExpbmUgNDAzICsgMHg5IGJ5dGVzIEMNCiBzZnRw
MnNtYWxsLmV4ZSFzZnRwX3JlYWQoX0xJQlNTSDJfU0ZUUF9IQU5ETEUgKiBoYW5kbGU9MHgwMGEw
ZjAyOCwgY2hhciAqDQogYnVmZmVyPTB4MDAxMWZhODgsIHVuc2lnbmVkIGludCBidWZmZXJfc2l6
ZT02NTUzNikgTGluZSAxMTk4ICsgMHgyNSBieXRlcw0KIEMNCiBzZnRwMnNtYWxsLmV4ZSFsaWJz
c2gyX3NmdHBfcmVhZChfTElCU1NIMl9TRlRQX0hBTkRMRSAqIGhuZD0weDAwYTBmMDI4LA0KIGNo
YXIgKiBidWZmZXI9MHgwMDExZmE4OCwgdW5zaWduZWQgaW50IGJ1ZmZlcl9tYXhsZW49NjU1MzYp
IExpbmUgMTMwNSArDQogMHgxMSBieXRlcyBDDQoNCiBIZXJlJ3MgYSBkdW1wIG9mIHNvbWUgdmFy
aWFibGVzLiAgc2Z0cC0+cGFydGlhbF9zaXplIGxvb2tzIGJhZC4gIFRoZQ0KIHNlcnZlciBpcyBy
dW5uaW5nIE9wZW5TU0guICBJdCdzIHRoZSBzYW1lLCB1bm1vZGlmaWVkIHNlcnZlciB0aGF0IEkn
dmUNCiBiZWVuIHVzaW5nIGZvciBtb250aHMgbm93LCBzbyBJIGRvdWJ0IGl0J3MgcmV0dXJuaW5n
IGEgYm9ndXMgcmVzcG9uc2UuDQoNCiA/IHBhY2tldA0KIDB4Y2NjY2NjY2MgPEJhZCBQdHI+DQog
PyByYw0KIDQNCiA/IHBhY2tldF9sZW4NCiAxNzI4MDUzMzM2DQogPyBzZnRwDQogMHgwMGEwZTRi
MCB7Y2hhbm5lbD0weDAwM2JlYWQwIHJlcXVlc3RfaWQ9MjI3OTkgdmVyc2lvbj0zIC4uLn0NCiBj
aGFubmVsOiAweDAwM2JlYWQwIHtub2RlPXsuLi59IGNoYW5uZWxfdHlwZT0weDAwYTBmNWE4DQog
InNlc3Npb27DvcO9w73DvcKrwqvCq8KrwqvCq8KrwqvDvsOuw77DrsO+IiBjaGFubmVsX3R5cGVf
bGVuPTcgLi4ufQ0KIHJlcXVlc3RfaWQ6IDIyNzk5DQogdmVyc2lvbjogMw0KIHBhY2tldHM6IHts
YXN0PTB4MDAwMDAwMDAgZmlyc3Q9MHgwMDAwMDAwMCB9DQogc2Z0cF9oYW5kbGVzOiB7bGFzdD0w
eDAwYTBmMDI4IGZpcnN0PTB4MDBhMGYwMjggfQ0KIGxhc3RfZXJybm86IDANCiBwYXJ0aWFsX3Np
emU6IDB4MDBhMGU0ZDAgImciDQogcGFydGlhbF9zaXplX2xlbjogNA0KIHBhcnRpYWxfcGFja2V0
OiAweDAwMDAwMDAwIDxCYWQgUHRyPg0KIHBhcnRpYWxfbGVuOiAyMDA5DQogcGFydGlhbF9yZWNl
aXZlZDogNjg3DQogcmVxdWlyZXZfc3RhcnQ6IDEyOTM3MzMwMzcNCiBvcGVuX3N0YXRlOiBsaWJz
c2gyX05CX3N0YXRlX2lkbGUNCiBvcGVuX3BhY2tldDogMHgwMDAwMDAwMCA8QmFkIFB0cj4NCiBv
cGVuX3BhY2tldF9sZW46IDM5DQogb3Blbl9wYWNrZXRfc2VudDogMzkNCiBvcGVuX3JlcXVlc3Rf
aWQ6IDANCiByZWFkX3N0YXRlOiBsaWJzc2gyX05CX3N0YXRlX2lkbGUNCiByZWFkX3BhY2tldDog
MHgwMDAwMDAwMCA8QmFkIFB0cj4NCiByZWFkX3JlcXVlc3RfaWQ6IDANCiByZWFkX3RvdGFsX3Jl
YWQ6IDANCiByZWFkZGlyX3N0YXRlOiBsaWJzc2gyX05CX3N0YXRlX2lkbGUNCiByZWFkZGlyX3Bh
Y2tldDogMHgwMDAwMDAwMCA8QmFkIFB0cj4NCiByZWFkZGlyX3JlcXVlc3RfaWQ6IDANCiBmc3Rh
dF9zdGF0ZTogbGlic3NoMl9OQl9zdGF0ZV9pZGxlDQogZnN0YXRfcGFja2V0OiAweDAwMDAwMDAw
IDxCYWQgUHRyPg0KIGZzdGF0X3JlcXVlc3RfaWQ6IDANCiB1bmxpbmtfc3RhdGU6IGxpYnNzaDJf
TkJfc3RhdGVfaWRsZQ0KIHVubGlua19wYWNrZXQ6IDB4MDAwMDAwMDAgPEJhZCBQdHI+DQogdW5s
aW5rX3JlcXVlc3RfaWQ6IDANCiByZW5hbWVfc3RhdGU6IGxpYnNzaDJfTkJfc3RhdGVfaWRsZQ0K
IHJlbmFtZV9wYWNrZXQ6IDB4MDAwMDAwMDAgPEJhZCBQdHI+DQogcmVuYW1lX3M6IDB4MDAwMDAw
MDAgPEJhZCBQdHI+DQogcmVuYW1lX3JlcXVlc3RfaWQ6IDANCiBmc3RhdHZmc19zdGF0ZTogbGli
c3NoMl9OQl9zdGF0ZV9pZGxlDQogZnN0YXR2ZnNfcGFja2V0OiAweDAwMDAwMDAwIDxCYWQgUHRy
Pg0KIGZzdGF0dmZzX3JlcXVlc3RfaWQ6IDANCiBzdGF0dmZzX3N0YXRlOiBsaWJzc2gyX05CX3N0
YXRlX2lkbGUNCiBzdGF0dmZzX3BhY2tldDogMHgwMDAwMDAwMCA8QmFkIFB0cj4NCiBzdGF0dmZz
X3JlcXVlc3RfaWQ6IDANCiBta2Rpcl9zdGF0ZTogbGlic3NoMl9OQl9zdGF0ZV9pZGxlDQogbWtk
aXJfcGFja2V0OiAweDAwMDAwMDAwIDxCYWQgUHRyPg0KIG1rZGlyX3JlcXVlc3RfaWQ6IDANCiBy
bWRpcl9zdGF0ZTogbGlic3NoMl9OQl9zdGF0ZV9pZGxlDQogcm1kaXJfcGFja2V0OiAweDAwMDAw
MDAwIDxCYWQgUHRyPg0KIHJtZGlyX3JlcXVlc3RfaWQ6IDANCiBzdGF0X3N0YXRlOiBsaWJzc2gy
X05CX3N0YXRlX2lkbGUNCiBzdGF0X3BhY2tldDogMHgwMDAwMDAwMCA8QmFkIFB0cj4NCiBzdGF0
X3JlcXVlc3RfaWQ6IDANCiBzeW1saW5rX3N0YXRlOiBsaWJzc2gyX05CX3N0YXRlX2lkbGUNCiBz
eW1saW5rX3BhY2tldDogMHgwMDAwMDAwMCA8QmFkIFB0cj4NCiBzeW1saW5rX3JlcXVlc3RfaWQ6
IDANCiA/IHBhY2tldF9yZWNlaXZlZA0KIDM0MzU5NzM4MzYNCiA/IHNmdHAtPnBhcnRpYWxfc2l6
ZVswXQ0KIDEwMyAnZycNCiA/IHNmdHAtPnBhcnRpYWxfc2l6ZVsxXQ0KIDANCiA/IHNmdHAtPnBh
cnRpYWxfc2l6ZVsyXQ0KIDANCiA/IHNmdHAtPnBhcnRpYWxfc2l6ZVszXQ0KIDg4ICdYJw0KDQog
LS0tLS0tDQogMi4gIEFsc28sIEkgZ290IHRoZSBwcm9ncmFtIHRvIGhhbmcgZHVyaW5nIHRoZSBk
b3dubG9hZCAob24gV2luZG93cykuICBUaGUNCiBkZWJ1Z2dlciByZXBvcnRlZCB0aGF0IG5vIHVz
ZXIgY29kZSB3YXMgcnVubmluZzsgdGhlIGxhc3QgY2FsbGVkIHVzZXINCiBmdW5jdGlvbiB3YXMg
YXBwYXJlbnRseSBsaWJzc2gyX2tlZXBhbGl2ZV9zZW5kLiAgVGhpcyBoYXBwZW5lZCBvbiB0d28N
CiBkaWZmZXJlbnQgcnVucy4KCi0tIApUaWNrZXQgVVJMOiA8aHR0cDovL3RyYWMubGlic3NoMi5v
cmcvdGlja2V0LzIwNSNjb21tZW50OjE+CmxpYnNzaDIgPGh0dHA6Ly90cmFjLmxpYnNzaDIub3Jn
Lz4KQyBsaWJyYXJ5IGZvciB3cml0aW5nIHBvcnRhYmxlIFNTSDIgY2xpZW50cwpfX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpsaWJzc2gyLWRldmVsIGh0dHA6
Ly9jb29sLmhheHguc2UvY2dpLWJpbi9tYWlsbWFuL2xpc3RpbmZvL2xpYnNzaDItZGV2ZWwK

From libssh2-devel-bounces@cool.haxx.se  Fri Dec 31 16:49:53 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBVFnTF9004206;
	Fri, 31 Dec 2010 16:49:48 +0100
Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com
	[74.125.82.182])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBVFnRpm004190
	for <libssh2-devel@cool.haxx.se>; Fri, 31 Dec 2010 16:49:27 +0100
Received: by wyf19 with SMTP id 19so12438636wyf.41
	for <libssh2-devel@cool.haxx.se>; Fri, 31 Dec 2010 07:49:18 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=gamma;
	h=domainkey-signature:received:received:from:to:subject:date
	:message-id:mime-version:content-type:content-transfer-encoding
	:x-mailer:thread-index:content-language;
	bh=LZpk9XAuxHG1V82I9MmKtIfgB6XPSWC/qGNuBQepE2E=;
	b=xxWp7U0Jw6XtMkn+aw/GGGh3ftBuYqEvv6XzMGj+Oqng0ZOup2tNprIfeJFEM9doX7
	AOxUvLCx/Dzroy4YkFxutfWgQNmuYTsL4ImXvFJt18/eEwEIODmv/rbA/nt8FXFWiZMm
	sS11Jxy5GfGrK3kfeWPrw25yrxCPzQGg/k7SA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma;
	h=from:to:subject:date:message-id:mime-version:content-type
	:content-transfer-encoding:x-mailer:thread-index:content-language;
	b=cuhIpLo44VKhQw1MXrhQaDZ9U33WHMg9f40EOJZ5+IOYe9CNG5yufhyXHm7fLDvorN
	blessBUGVJU6S0ULnmBDDjValyS8uDB3RDVsouGaXT+fD0HaYG5y41/K4zsA5nVREDNY
	60buehQieFceCRTG/b0WjmeB519Vuy7tdrk6g=
Received: by 10.216.188.67 with SMTP id z45mr5138376wem.7.1293810558551;
	Fri, 31 Dec 2010 07:49:18 -0800 (PST)
Received: from Arche (cpc2-pmth10-2-0-cust728.6-1.cable.virginmedia.com
	[81.97.2.217])
	by mx.google.com with ESMTPS id j49sm7131711wer.38.2010.12.31.07.49.17
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Fri, 31 Dec 2010 07:49:17 -0800 (PST)
From: "Steve Legg" <smlegg@googlemail.com>
To: <libssh2-devel@cool.haxx.se>
Subject: Bug in channel.c/channel_request_pty_size?
Date: Fri, 31 Dec 2010 15:48:53 -0000
Message-ID: <000501cba902$3b3be1c0$b1b3a540$@com>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AcupAjmGEkEQSiiNTYSC63+yZ3nvkA==
Content-Language: en-gb
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Fri, 31 Dec 2010 16:49:53 +0100 (CET)
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Fri, 31 Dec 2010 16:49:27 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

Hi,

In channel.c/channel_request_pty_size if the request to resize the pty is
successfully sent then channel->reqPTY_state ends up being set to
libssh2_NB_state_sent.  However, I believe this is wrong.  There doesn't
seem to be a way for reqPTY_state to ever be set back to idle after this so
the next call to libssh2_request_pty_size will fail (because the state is
still set to "sent") - the failure will cause the state to be set back to
idle, so the next call will succeed.

The upshot of this is that every odd call to libssh2_request_pty_size fails
and returns -1, every even call succeeds (and in fact - any other call that
uses reqPTY_state to track its state will also fail after a successful call
to libssh2_request_pty_size).

This bug is happening for me in libssh2-1.2.7 but looking at the repo,
although the code has been somewhat refactored, the same bug still appears
to be present.

A workaround for this bug is to simply call libssh2_request_pty_size again
if it returns -1:

	int r;
	if ((r=libssh2_request_pty_size(...))<0)
	{
		r=libssh2_request_pty_size(...);
	}

	.. normal error processing ...


But obviously that's not really very nice (and I'm not sure what evilness
will happen if a real error happens in the first call ;).

Am I wrong, and there is actually a way for reqPTY_state to be set back to
idle?  Or is this a real bug? (it looks to me like the code has been written
with asynchrony in mind, but never actually finished - the reqPTY_state code
appears to be mostly redundant).

Thanks,
Steve.

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

From libssh2-devel-bounces@cool.haxx.se  Fri Dec 31 23:37:40 2010
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id oBVMbOdF009388;
	Fri, 31 Dec 2010 23:37:37 +0100
Received: from giant.haxx.se (giant.haxx.se [80.67.6.50])
	by giant.haxx.se (8.14.3/8.14.3/Debian-9.1) with ESMTP id
	oBVMbMQJ009382
	for <libssh2-devel@cool.haxx.se>; Fri, 31 Dec 2010 23:37:22 +0100
Date: Fri, 31 Dec 2010 23:37:22 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: Bug in channel.c/channel_request_pty_size?
In-Reply-To: <000501cba902$3b3be1c0$b1b3a540$@com>
Message-ID: <alpine.DEB.2.00.1012312334570.25754@tvnag.unkk.fr>
References: <000501cba902$3b3be1c0$b1b3a540$@com>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED;
	BOUNDARY="1129329158-463301827-1293835042=:25754"
X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.3.5 (giant.haxx.se [127.0.0.1]); Fri, 31 Dec 2010 23:37:40 +0100 (CET)
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.5
	(giant.haxx.se [80.67.6.50]); Fri, 31 Dec 2010 23:37:22 +0100 (CET)
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
	<mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Sender: libssh2-devel-bounces@cool.haxx.se
Errors-To: libssh2-devel-bounces@cool.haxx.se

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

--1129329158-463301827-1293835042=:25754
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Fri, 31 Dec 2010, Steve Legg wrote:

> Am I wrong, and there is actually a way for reqPTY_state to be set back to 
> idle?  Or is this a real bug?

It looks like a real bug to me!

> (it looks to me like the code has been written with asynchrony in mind, but 
> never actually finished - the reqPTY_state code appears to be mostly 
> redundant).

Not entirely redundant since it avoids doing all that initing of the packet 
during situations when the transport layer returns LIBSSH2_ERROR_EAGAIN.

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

-- 

  / daniel.haxx.se
--1129329158-463301827-1293835042=:25754
Content-Type: TEXT/x-diff; name=channel_request_pty_size.patch
Content-Transfer-Encoding: BASE64
Content-ID: <alpine.DEB.2.00.1012312337220.25754@tvnag.unkk.fr>
Content-Description: 
Content-Disposition: attachment; filename=channel_request_pty_size.patch

ZGlmZiAtLWdpdCBhL3NyYy9jaGFubmVsLmMgYi9zcmMvY2hhbm5lbC5jDQpp
bmRleCBlNGEyM2MxLi5lMGFmMTRjIDEwMDY0NA0KLS0tIGEvc3JjL2NoYW5u
ZWwuYw0KKysrIGIvc3JjL2NoYW5uZWwuYw0KQEAgLTEwMDIsNiArMTAwMiw3
IEBAIGNoYW5uZWxfcmVxdWVzdF9wdHlfc2l6ZShMSUJTU0gyX0NIQU5ORUwg
KiBjaGFubmVsLCBpbnQgd2lkdGgsDQogICAgIExJQlNTSDJfU0VTU0lPTiAq
c2Vzc2lvbiA9IGNoYW5uZWwtPnNlc3Npb247DQogICAgIHVuc2lnbmVkIGNo
YXIgKnM7DQogICAgIGludCByYzsNCisgICAgaW50IHJldGNvZGUgPSBMSUJT
U0gyX0VSUk9SX1BST1RPOw0KIA0KICAgICBpZiAoY2hhbm5lbC0+cmVxUFRZ
X3N0YXRlID09IGxpYnNzaDJfTkJfc3RhdGVfaWRsZSkgew0KICAgICAgICAg
Y2hhbm5lbC0+cmVxUFRZX3BhY2tldF9sZW4gPSAzOTsNCkBAIC0xMDQ0LDE1
ICsxMDQ1LDExIEBAIGNoYW5uZWxfcmVxdWVzdF9wdHlfc2l6ZShMSUJTU0gy
X0NIQU5ORUwgKiBjaGFubmVsLCBpbnQgd2lkdGgsDQogICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICJVbmFibGUgdG8gc2VuZCB3aW5kb3ct
Y2hhbmdlIHBhY2tldCIpOw0KICAgICAgICAgfQ0KICAgICAgICAgX2xpYnNz
aDJfaHRvbnUzMihjaGFubmVsLT5yZXFQVFlfbG9jYWxfY2hhbm5lbCwgY2hh
bm5lbC0+bG9jYWwuaWQpOw0KLSAgICAgICAgY2hhbm5lbC0+cmVxUFRZX3N0
YXRlID0gbGlic3NoMl9OQl9zdGF0ZV9zZW50Ow0KLQ0KLSAgICAgICAgcmV0
dXJuIExJQlNTSDJfRVJST1JfTk9ORTsNCisgICAgICAgIHJldGNvZGUgPSBM
SUJTU0gyX0VSUk9SX05PTkU7DQogICAgIH0NCiANCiAgICAgY2hhbm5lbC0+
cmVxUFRZX3N0YXRlID0gbGlic3NoMl9OQl9zdGF0ZV9pZGxlOw0KLQ0KLSAg
ICAvKiByZWFjaGluZyB0aGlzIHBvaW50IGlzIGEgcHJvdG9jb2wgZXJyb3Ig
b2Ygc29tZSBzb3J0cyAqLw0KLSAgICByZXR1cm4gTElCU1NIMl9FUlJPUl9Q
Uk9UTzsNCisgICAgcmV0dXJuIHJldGNvZGU7DQogfQ0KIA0KIExJQlNTSDJf
QVBJIGludA0K

--1129329158-463301827-1293835042=:25754
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-463301827-1293835042=:25754--

