From libssh2-devel-bounces@cool.haxx.se  Tue Oct  6 23:51:44 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t96LpCja010275;
	Tue, 6 Oct 2015 23:51:39 +0200
Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com
 [209.85.220.48])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t96LpAiA010256
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Tue, 6 Oct 2015 23:51:11 +0200
Received: by pacex6 with SMTP id ex6so221815132pac.0
 for <libssh2-devel@cool.haxx.se>; Tue, 06 Oct 2015 14:51:05 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:subject:to:references:from:message-id:date
 :user-agent:mime-version:in-reply-to:content-type;
 bh=CecHSH8bzln9gPGgbjyTWMmqeN6hN85Hin4ZbTQ09ig=;
 b=kcIs5QWL7uPEBzGNLfFrWQ5TQ5qMzfmK1yRwS4hwotKER0JtXPzdGDj7nh9CneaGQ1
 JsfKwxHUvcBEV6YLvHQs+FNMww0ukOrq/9b20LCjyx+Amd8/AZW/n0OUYW9YIEnVkdxH
 zw46KYSMeUWyHPLmy4f0KpTtqGBJ7mX5kBjxvQZRHqhwbzbBsUUa5m/hfv6A9/XVfizd
 NyTAWtBkLqy9JHYxy3S8i6ICwmxNgMIGm/rbF2PO3blb7MDL+fzR924NWInUXv2qo2cy
 wfmJTr3hD6vo+XAfVwzfligNI8XTOdgguJ7wdJlu9XJ7FOhEzeIOq3fVVB+VpfadDhKS
 Ylkw==
X-Gm-Message-State: ALoCoQmCp2FjUinTA4WbkoJsUlB7XPqMHeNC8bBCNJr9gDguCThKszy8rOrL8xS/P5YSuVUSFFMa
X-Received: by 10.66.220.1 with SMTP id ps1mr202239pac.104.1444168265171;
 Tue, 06 Oct 2015 14:51:05 -0700 (PDT)
Received: from Michelles-MacBook-Pro-3.local (gw.aspera.us. [66.211.109.190])
 by smtp.googlemail.com with ESMTPSA id
 u3sm35331975pbs.33.2015.10.06.14.51.03
 for <libssh2-devel@cool.haxx.se>
 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 06 Oct 2015 14:51:03 -0700 (PDT)
Subject: unsubscribe
To: libssh2-devel@cool.haxx.se
References: <5601E2C1.1000205@dbyron.com>
 <alpine.DEB.2.11.1509230907380.27341@tvnag.unkk.fr>
 <mtu9su$gdf$1@ger.gmane.org>
 <alpine.DEB.2.11.1509242307450.27341@tvnag.unkk.fr>
 <249215AEF1B1471689B96612C92643C4@OwnerPC311012> <560504C8.4020100@gmail.com>
 <alpine.DEB.2.11.1509290950190.14530@tvnag.unkk.fr>
From: Michelle Munson <michelle@asperasoft.com>
Message-ID: <56144246.8030009@asperasoft.com>
Date: Tue, 6 Oct 2015 14:51:02 -0700
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0)
 Gecko/20100101 Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <alpine.DEB.2.11.1509290950190.14530@tvnag.unkk.fr>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: multipart/mixed; boundary="===============0328770628=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>

This is a multi-part message in MIME format.
--===============0328770628==
Content-Type: multipart/alternative;
 boundary="------------040300000101030904070605"

This is a multi-part message in MIME format.
--------------040300000101030904070605
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit



On 9/29/15 12:50 AM, Daniel Stenberg wrote:
> On Fri, 25 Sep 2015, Salvador Fandiño wrote:
>
>> Anyway, I am attaching the patches here again.
>
> Thanks a lot, I merged both of them now!
>
>
>
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel


--------------040300000101030904070605
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    <div class="moz-cite-prefix">On 9/29/15 12:50 AM, Daniel Stenberg
      wrote:<br>
    </div>
    <blockquote
      cite="mid:alpine.DEB.2.11.1509290950190.14530@tvnag.unkk.fr"
      type="cite">On Fri, 25 Sep 2015, Salvador Fandiño wrote:
      <br>
      <br>
      <blockquote type="cite">Anyway, I am attaching the patches here
        again.
        <br>
      </blockquote>
      <br>
      Thanks a lot, I merged both of them now!
      <br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
libssh2-devel <a class="moz-txt-link-freetext" href="http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel">http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>

--------------040300000101030904070605--

--===============0328770628==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--===============0328770628==--

From libssh2-devel-bounces@cool.haxx.se  Thu Oct 15 17:58:46 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9FFvMZ6010531;
	Thu, 15 Oct 2015 17:58:42 +0200
Received: from plane.gmane.org (plane.gmane.org [80.91.229.3])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9FFvKNd010523
 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Thu, 15 Oct 2015 17:57:20 +0200
Received: from list by plane.gmane.org with local (Exim 4.69)
 (envelope-from <gnslg-libssh2-devel-2@m.gmane.org>)
 id 1Zmku4-00055l-QN
 for libssh2-devel@cool.haxx.se; Thu, 15 Oct 2015 17:57:16 +0200
Received: from 213.37.131.197.static.user.ono.com ([213.37.131.197])
 by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
 id 1AlnuQ-0007hv-00
 for <libssh2-devel@cool.haxx.se>; Thu, 15 Oct 2015 17:57:16 +0200
Received: from sfandino by 213.37.131.197.static.user.ono.com with local
 (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00
 for <libssh2-devel@cool.haxx.se>; Thu, 15 Oct 2015 17:57:16 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: libssh2-devel@cool.haxx.se
From: Salvador Fandino <sfandino@gmail.com>
Subject: [PATCH] add function libssh2_session_set_last_error
Date: Thu, 15 Oct 2015 17:57:03 +0200
Lines: 75
Message-ID: <mvoicf$oj6$1@ger.gmane.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="------------070609050509020706070303"
X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: 213.37.131.197.static.user.ono.com
X-Mozilla-News-Host: news://nntp.gmane.org:119
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.2.0
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>

This is a multi-part message in MIME format.
--------------070609050509020706070303
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

See the patch attached.

It just exposes _libssh2_error through the API and its immediate 
objective is making my life (as the current maintainer of Net::SSH2) 
much much much easier.

But actually, this function may be useful to anybody building new 
features on top of the library and obviously for other wrapping modules.

--------------070609050509020706070303
Content-Type: application/text;
 name="0001-add-function-libssh2_session_set_last_error.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="0001-add-function-libssh2_session_set_last_error.patch"

RnJvbSA2NzZkNjhhZTgxOTZhODI0NTExMmIxZDM3ZjBjYjk2MzVlYmRjYTQ0IE1vbiBTZXAg
MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBTYWx2YWRvciBGYW5kaW5vIDxzZmFuZGlub0B5YWhv
by5jb20+CkRhdGU6IF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CU1NIMl9B
UEkgaW50CitsaWJzc2gyX3Nlc3Npb25fc2V0X2xhc3RfZXJyb3IoTElCU1NIMl9TRVNTSU9O
KiBzZXNzaW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBlcnJjb2Rl
LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIqIGVycm1zZykK
K3sKKyAgICByZXR1cm4gX2xpYnNzaDJfZXJyb3Ioc2Vzc2lvbiwgZXJyY29kZSwgZXJybXNn
KTsKK30KKworLyogTGlic3NoMl9zZXNzaW9uX2ZsYWcKICAqCiAgKiBTZXQvR2V0IHNlc3Np
b24gZmxhZ3MKICAqCi0tIAoyLjUuMAoK
--------------070609050509020706070303
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--------------070609050509020706070303--

From libssh2-devel-bounces@cool.haxx.se  Mon Oct 19 13:25:33 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9JBO61r004705;
	Mon, 19 Oct 2015 13:25:28 +0200
Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au
 [211.29.132.97])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9JBO45l004511
 for <libssh2-devel@cool.haxx.se>; Mon, 19 Oct 2015 13:24:05 +0200
Received: from OwnerPC311012 (unknown [203.202.164.190])
 (Authenticated sender: sisyphus1@optusnet.com.au)
 by mail110.syd.optusnet.com.au (Postfix) with ESMTPA id 666A8781888
 for <libssh2-devel@cool.haxx.se>; Mon, 19 Oct 2015 22:23:53 +1100 (AEDT)
Message-ID: <942272468E784F5EAC4BD30E7CCF68AD@OwnerPC311012>
From: <sisyphus1@optusnet.com.au>
To: <libssh2-devel@cool.haxx.se>
References: <mvoicf$oj6$1@ger.gmane.org>
In-Reply-To: <mvoicf$oj6$1@ger.gmane.org>
Subject: Re: [PATCH] add function libssh2_session_set_last_error
Date: Mon, 19 Oct 2015 22:23:45 +1100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Mailer: Microsoft Windows Live Mail 16.4.3505.912
X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3505.912
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0
 a=8e8rgZJuizJfF74+JHJpGg==:117 a=8e8rgZJuizJfF74+JHJpGg==:17
 a=PO7r1zJSAAAA:8 a=IkcTkHD0fZMA:10 a=l4Q2zkWEkbIFnu71Q_kA:9
 a=QEXdDO2ut3YA:10
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id t9JBO61r004705

-----Original Message----- 
From: Salvador Fandino
Sent: Friday, October 16, 2015 2:57 AM
To: libssh2-devel@cool.haxx.se
Subject: [PATCH] add function libssh2_session_set_last_error

> See the patch attached.
>
> It just exposes _libssh2_error through the API and its immediate objective 
> is making my life (as the current maintainer of Net::SSH2) much much much 
> easier.
>
> But actually, this function may be useful to anybody building new features 
> on top of the library and obviously for other wrapping modules.

I'd like to add my voice in favour of the inclusion of this function.
I use Net::SSH2 often, and I therefore support anything that makes life 
easier for its maintainer.

Cheers,
Rob 

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

From libssh2-devel-bounces@cool.haxx.se  Mon Oct 19 13:51:21 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9JBoFHk004456;
	Mon, 19 Oct 2015 13:51:19 +0200
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9JBoD3H004318
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Mon, 19 Oct 2015 13:50:14 +0200
Received: from int-mx13.intmail.prod.int.phx2.redhat.com
 (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26])
 by mx1.redhat.com (Postfix) with ESMTPS id 5709BC0C188B;
 Mon, 19 Oct 2015 11:50:13 +0000 (UTC)
Received: from kdudka.brq.redhat.com (kdudka.brq.redhat.com [10.34.4.67])
 by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id
 t9JBoB7H001425
 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
 Mon, 19 Oct 2015 07:50:12 -0400
From: Kamil Dudka <kdudka@redhat.com>
To: Salvador Fandino <sfandino@gmail.com>
Subject: Re: [PATCH] add function libssh2_session_set_last_error
Date: Mon, 19 Oct 2015 13:50:11 +0200
Message-ID: <1862333.047qXO3ZL8@kdudka.brq.redhat.com>
User-Agent: KMail/4.14.9 (Linux/4.0.8-304.fc22.x86_64; KDE/4.14.11; x86_64; ; )
In-Reply-To: <mvoicf$oj6$1@ger.gmane.org>
References: <mvoicf$oj6$1@ger.gmane.org>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26
Cc: libssh2-devel@cool.haxx.se
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id t9JBoFHk004456

On Thursday 15 October 2015 17:57:03 Salvador Fandino wrote:
> See the patch attached.
> 
> It just exposes _libssh2_error through the API and its immediate
> objective is making my life (as the current maintainer of Net::SSH2)
> much much much easier.
> 
> But actually, this function may be useful to anybody building new
> features on top of the library and obviously for other wrapping modules.

Thanks for the patch!  I agree that it as a valid reason for extending
the API.  Nevertheless, the proposed API looks fragile to me.  libssh2
does not copy the error message to its own memory.  So it is caller's 
responsibility to keep the string valid long enough.  This could cause 
problems.

We should either change the code to allocate memory for the error message
or clearly specify in the API documentation for how long the string needs
to remain valid.

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

From libssh2-devel-bounces@cool.haxx.se  Thu Oct 22 10:48:58 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9M8lWD8009742;
	Thu, 22 Oct 2015 10:48:55 +0200
Received: from plane.gmane.org (plane.gmane.org [80.91.229.3])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9M8lU4I009166
 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Thu, 22 Oct 2015 10:47:30 +0200
Received: from list by plane.gmane.org with local (Exim 4.69)
 (envelope-from <gnslg-libssh2-devel-2@m.gmane.org>)
 id 1ZpBWp-0000Tw-AY
 for libssh2-devel@cool.haxx.se; Thu, 22 Oct 2015 10:47:19 +0200
Received: from 213.37.131.197.static.user.ono.com ([213.37.131.197])
 by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
 id 1AlnuQ-0007hv-00
 for <libssh2-devel@cool.haxx.se>; Thu, 22 Oct 2015 10:47:19 +0200
Received: from sfandino by 213.37.131.197.static.user.ono.com with local
 (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00
 for <libssh2-devel@cool.haxx.se>; Thu, 22 Oct 2015 10:47:19 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: libssh2-devel@cool.haxx.se
From: Salvador Fandino <sfandino@gmail.com>
Subject: Re: [PATCH] add function libssh2_session_set_last_error
Date: Thu, 22 Oct 2015 10:47:11 +0200
Lines: 176
Message-ID: <n0a7qf$dnp$1@ger.gmane.org>
References: <mvoicf$oj6$1@ger.gmane.org>
 <1862333.047qXO3ZL8@kdudka.brq.redhat.com>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="------------050005050501090109060602"
X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: 213.37.131.197.static.user.ono.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.3.0
In-Reply-To: <1862333.047qXO3ZL8@kdudka.brq.redhat.com>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>

This is a multi-part message in MIME format.
--------------050005050501090109060602
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

On 10/19/2015 01:50 PM, Kamil Dudka wrote:
> On Thursday 15 October 2015 17:57:03 Salvador Fandino wrote:
>> See the patch attached.
>>
>> It just exposes _libssh2_error through the API and its immediate
>> objective is making my life (as the current maintainer of Net::SSH2)
>> much much much easier.
>>
>> But actually, this function may be useful to anybody building new
>> features on top of the library and obviously for other wrapping modules.
>
> Thanks for the patch!  I agree that it as a valid reason for extending
> the API.  Nevertheless, the proposed API looks fragile to me.  libssh2
> does not copy the error message to its own memory.  So it is caller's
> responsibility to keep the string valid long enough.  This could cause
> problems.
>
> We should either change the code to allocate memory for the error message
> or clearly specify in the API documentation for how long the string needs
> to remain valid.

Two new patches are attached.

As I didn't want to penalize every calls to "_libssh2_error" with a 
"strdup", I converted it into "_libssh2_error_flags" which accepts a 
flag indicating whether the given string must be duplicated and then 
added a new "_libssh2_error" that just calls "_libssh2_error_flags".

Finally, the second patch adds "libssh2_session_set_last_error" to the 
public API. It relies on "_libssh2_error_flags" and always duplicates 
the given string.



--------------050005050501090109060602
Content-Type: application/text;
 name="0001-Support-allocating-the-error-message-on-the-heap.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename*0="0001-Support-allocating-the-error-message-on-the-heap.patch"

RnJvbSA2ZGQ5YThlMmJhMWE1YmYzODQzNDY2YzM3MzVhZDA4MDJmNTg4MDc1IE1vbiBTZXAg
MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBTYWx2YWRvciBGYW5kaW5vIDxzZmFuZGlub0B5YWhv
by5jb20+CkRhdGU6IFdlZCwgMjEgT2N0IDIwMTUgMTU6MDM6MDIgKzAyMDAKU3ViamVjdDog
W1BBVENIIDEvMl0gU3VwcG9ydCBhbGxvY2F0aW5nIHRoZSBlcnJvciBtZXNzYWdlIG9uIHRo
ZSBoZWFwCgpCZWZvcmUgdGhpcyBwYXRjaCAiX2xpYnNzaDJfZXJyb3IiIHJlcXVpcmVkIHRo
ZSBlcnJvciBtZXNzYWdlIHRvIGJlIGEKc3RhdGljIHN0cmluZy4KClRoaXMgcGF0Y2ggYWRk
cyBhIG5ldyBmdW5jdGlvbiAiX2xpYnNzaDJfZXJyb3JfZmxhZ3MiIGFjY2VwdGluZyBhbgph
ZGRpdGlvbmFsICJmbGFncyIgYXJndW1lbnQgYW5kIHNwZWNpZmljYWxseSB0aGUgZmxhZwoi
TElCU1NIMl9FUlJfRkxBR19EVVAiIGluZGljYXRpbmcgdGhhdCB0aGUgcGFzc2VkIHN0cmlu
ZyBtdXN0IGJlCmR1cGxpY2F0ZWQgaW50byB0aGUgaGVhcC4KClRoZW4sIHRoZSBtZXRob2Qg
Il9saWJzc2gyX2Vycm9yIiBoYXMg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qIGVycm1zZykKICAgICByZXR1cm4gZXJyY29k
ZTsKIH0KIAoraW50IF9saWJzc2gyX2Vycm9yKExJQlNTSDJfU0VTU0lPTiogc2Vzc2lvbiwg
aW50IGVycmNvZGUsIGNvbnN0IGNoYXIqIGVycm1zZykKK3sKKyAgICByZXR1cm4gX2xpYnNz
aDJfZXJyb3JfZmxhZ3Moc2Vzc2lvbiwgZXJyY29kZSwgZXJybXNnLCAwKTsKK30KKwogI2lm
ZGVmIFdJTjMyCiBzdGF0aWMgaW50IHdzYTJlcnJubyh2b2lkKQogewpkaWZmIC0tZ2l0IGEv
c3JjL21pc2MuaCBiL3NyYy9taXNjLmgKaW5kZXggZjk5Yjc3My4uZWE2OGE0ZiAxMDA2NDQK
LS0tIGEvc3JjL21pc2MuaAorKysgYi9zcmMvbWlzYy5oCkBAIC00OSw2ICs0OSw3IEBAIHN0
cnVjdCBsaXN0X25vZGUgewogICAgIHN0cnVjdCBsaXN0X2hlYWQgKmhlYWQ7CiB9OwogCitp
bnQgX2xpYnNzaDJfZXJyb3JfZmxhZ3MoTElCU1NIMl9TRVNTSU9OKiBzZXNzaW9uLCBpbnQg
ZXJyY29kZSwgY29uc3QgY2hhciogZXJybXNnLCBpbnQgZmxhZ3MpOwogaW50IF9saWJzc2gy
X2Vycm9yKExJQlNTSDJfU0VTU0lPTiogc2Vzc2lvbiwgaW50IGVycmNvZGUsIGNvbnN0IGNo
YXIqIGVycm1zZyk7CiAKIHZvaWQgX2xpYnNzaDJfbGlzdF9pbml0KHN0cnVjdCBsaXN0X2hl
YWQgKmhlYWQpOwotLSAKMi41LjAKCg==
--------------050005050501090109060602
Content-Type: application/text;
 name="0002-add-function-libssh2_session_set_last_error.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="0002-add-function-libssh2_session_set_last_error.patch"

RnJvbSA5OGM1ZmQxNmM1MzEzZjJjYzJjZTNiZmE5ZTBjYjQ5MzhkMmI3ZjAwIE1vbiBTZXAg
MTcgMDA6MD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Xh0ZW5kIHRoZSBsaWJyYXJ5CisgKiBmZWF0dXJlcyB3aGls
ZSBzdGlsbCByZWx5aW5nIG9uIGl0cyBlcnJvciByZXBvcnRpbmcgbWVjaGFuaXNtLgorICov
CitMSUJTU0gyX0FQSSBpbnQKK2xpYnNzaDJfc2Vzc2lvbl9zZXRfbGFzdF9lcnJvcihMSUJT
U0gyX1NFU1NJT04qIHNlc3Npb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
aW50IGVycmNvZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hh
ciogZXJybXNnKQoreworICAgIHJldHVybiBfbGlic3NoMl9lcnJvcl9mbGFncyhzZXNzaW9u
LCBlcnJjb2RlLCBlcnJtc2csCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExJ
QlNTSDJfRVJSX0ZMQUdfRFVQKTsKK30KKworLyogTGlic3NoMl9zZXNzaW9uX2ZsYWcKICAq
CiAgKiBTZXQvR2V0IHNlc3Npb24gZmxhZ3MKICAqCi0tIAoyLjUuMAoK
--------------050005050501090109060602
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--------------050005050501090109060602--

From libssh2-devel-bounces@cool.haxx.se  Fri Oct 23 13:44:40 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9NBhFPl000697;
	Fri, 23 Oct 2015 13:44:37 +0200
Received: from foo.stuge.se (qmailr@foo.stuge.se [212.116.89.98])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9NBhDwD000689
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Fri, 23 Oct 2015 13:43:13 +0200
Received: (qmail 20612 invoked by uid 501); 23 Oct 2015 11:43:13 -0000
Message-ID: <20151023114313.20611.qmail@stuge.se>
Date: Fri, 23 Oct 2015 13:43:13 +0200
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: [PATCH] add function libssh2_session_set_last_error
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <mvoicf$oj6$1@ger.gmane.org>
 <1862333.047qXO3ZL8@kdudka.brq.redhat.com> <n0a7qf$dnp$1@ger.gmane.org>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <n0a7qf$dnp$1@ger.gmane.org>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id t9NBhFPl000697

Salvador,

Salvador Fandino wrote:
> I converted it into "_libssh2_error_flags" which accepts a flag 
> indicating whether the given string must be duplicated

Please think about how and where allocated memory is being freed.

Try creating and destroying sessions in a loop - there is a leak.

Do you need to free this memory in other places besides that?

Is there a LIBSSH2_REALLOC?

Style: the function takes several parameters whose names start with err.
You add a new parameter named flags, which does not start with err.
Please be careful to always follow style wherever you make changes.
Name the new parameter e.g. errflags.


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

From libssh2-devel-bounces@cool.haxx.se  Fri Oct 23 16:40:23 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9NEd8Ws012446;
	Fri, 23 Oct 2015 16:40:20 +0200
Received: from plane.gmane.org (plane.gmane.org [80.91.229.3])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9NEd7S9012441
 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Fri, 23 Oct 2015 16:39:07 +0200
Received: from list by plane.gmane.org with local (Exim 4.69)
 (envelope-from <gnslg-libssh2-devel-2@m.gmane.org>)
 id 1ZpdUo-00061k-FL
 for libssh2-devel@cool.haxx.se; Fri, 23 Oct 2015 16:39:06 +0200
Received: from 92.56.141.104 ([92.56.141.104])
 by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
 id 1AlnuQ-0007hv-00
 for <libssh2-devel@cool.haxx.se>; Fri, 23 Oct 2015 16:39:06 +0200
Received: from sfandino by 92.56.141.104 with local (Gmexim 0.1 (Debian))
 id 1AlnuQ-0007hv-00
 for <libssh2-devel@cool.haxx.se>; Fri, 23 Oct 2015 16:39:06 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: libssh2-devel@cool.haxx.se
From: =?UTF-8?Q?Salvador_Fandi=c3=b1o?= <sfandino@gmail.com>
Subject: Re: [PATCH] add function libssh2_session_set_last_error
Date: Fri, 23 Oct 2015 16:38:36 +0200
Lines: 260
Message-ID: <n0dgpd$mfa$1@ger.gmane.org>
References: <mvoicf$oj6$1@ger.gmane.org>
 <1862333.047qXO3ZL8@kdudka.brq.redhat.com> <n0a7qf$dnp$1@ger.gmane.org>
 <20151023114313.20611.qmail@stuge.se>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="------------040304060905020509070506"
X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: 92.56.141.104
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.3.0
In-Reply-To: <20151023114313.20611.qmail@stuge.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>

This is a multi-part message in MIME format.
--------------040304060905020509070506
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

On 10/23/2015 01:43 PM, Peter Stuge wrote:
> Salvador,
>
> Salvador Fandino wrote:
>> I converted it into "_libssh2_error_flags" which accepts a flag
>> indicating whether the given string must be duplicated
>
> Please think about how and where allocated memory is being freed.
>
> Try creating and destroying sessions in a loop - there is a leak.
>
> Do you need to free this memory in other places besides that?
>
> Is there a LIBSSH2_REALLOC?
>
> Style: the function takes several parameters whose names start with err.
> You add a new parameter named flags, which does not start with err.
> Please be careful to always follow style wherever you make changes.
> Name the new parameter e.g. errflags.

Ok, lets try again:

Now "err_msg" is also freed from "session_free" when the DUP flag is set.

The "flags" argument to "_libssh2_error_flags" has been renamed to 
"errflags".



--------------040304060905020509070506
Content-Type: text/x-patch;
 name="0001-Support-allocating-the-error-message-on-the-heap.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename*0="0001-Support-allocating-the-error-message-on-the-heap.patch"

From 5bf87c70453be606853001e9f5a10d9d75d6ea29 Mon Sep 17 00:00:00 2001
From: Salvador Fandino <sfandino@yahoo.com>
Date: Wed, 21 Oct 2015 15:03:02 +0200
Subject: [PATCH 1/2] Support allocating the error message on the heap
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Before this patch "_libssh2_error" required the error message to be a
static string.

This patch adds a new function "_libssh2_error_flags" accepting an
additional "flags" argument and specifically the flag
"LIBSSH2_ERR_FLAG_DUP" indicating that the passed string must be
duplicated into the heap.

Then, the method "_libssh2_error" has been rewritten to use that new
function under the hood.

Signed-off-by: Salvador Fandino <sfandino@yahoo.com>
Signed-off-by: Salvador Fandiño <sfandino@yahoo.com>
---
 src/libssh2_priv.h |  5 +++++
 src/misc.c         | 28 ++++++++++++++++++++++++++--
 src/misc.h         |  1 +
 src/session.c      |  5 +++++
 4 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/src/libssh2_priv.h b/src/libssh2_priv.h
index 78d4ced..1023943 100644
--- a/src/libssh2_priv.h
+++ b/src/libssh2_priv.h
@@ -631,6 +631,7 @@ struct _LIBSSH2_SESSION
     /* Error tracking */
     const char *err_msg;
     int err_code;
+    int err_flags;
 
     /* struct members for packet-level reading */
     struct transportpacket packet;
@@ -950,6 +951,10 @@ _libssh2_debug(LIBSSH2_SESSION * session, int context, const char *format, ...)
 /* Something very bad is going on */
 #define LIBSSH2_MAC_INVALID                     -1
 
+/* Flags for _libssh2_error_flags */
+/* Error message is allocated on the heap */
+#define LIBSSH2_ERR_FLAG_DUP                     1
+
 /* SSH Packet Types -- Defined by internet draft */
 /* Transport Layer */
 #define SSH_MSG_DISCONNECT                          1
diff --git a/src/misc.c b/src/misc.c
index 283daea..320df44 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -51,10 +51,29 @@
 #include <stdio.h>
 #include <errno.h>
 
-int _libssh2_error(LIBSSH2_SESSION* session, int errcode, const char* errmsg)
+int _libssh2_error_flags(LIBSSH2_SESSION* session, int errcode, const char* errmsg, int errflags)
 {
-    session->err_msg = errmsg;
+    if (session->err_flags & LIBSSH2_ERR_FLAG_DUP)
+        LIBSSH2_FREE(session, (char *)session->err_msg);
+
     session->err_code = errcode;
+    session->err_flags = 0;
+
+    if ((errmsg != NULL) && ((errflags & LIBSSH2_ERR_FLAG_DUP) != 0)) {
+        size_t len = strlen(errmsg);
+        char *copy = LIBSSH2_ALLOC(session, len + 1);
+        if (copy) {
+            memcpy(copy, errmsg, len + 1);
+            session->err_flags = LIBSSH2_ERR_FLAG_DUP;
+            session->err_msg = copy;
+        }
+        else
+            /* Out of memory: this code path is very unlikely */
+            session->err_msg = "former error forgotten (OOM)";
+    }
+    else
+        session->err_msg = errmsg;
+
 #ifdef LIBSSH2DEBUG
     if((errcode == LIBSSH2_ERROR_EAGAIN) && !session->api_block_mode)
         /* if this is EAGAIN and we're in non-blocking mode, don't generate
@@ -67,6 +86,11 @@ int _libssh2_error(LIBSSH2_SESSION* session, int errcode, const char* errmsg)
     return errcode;
 }
 
+int _libssh2_error(LIBSSH2_SESSION* session, int errcode, const char* errmsg)
+{
+    return _libssh2_error_flags(session, errcode, errmsg, 0);
+}
+
 #ifdef WIN32
 static int wsa2errno(void)
 {
diff --git a/src/misc.h b/src/misc.h
index f99b773..54ae546 100644
--- a/src/misc.h
+++ b/src/misc.h
@@ -49,6 +49,7 @@ struct list_node {
     struct list_head *head;
 };
 
+int _libssh2_error_flags(LIBSSH2_SESSION* session, int errcode, const char* errmsg, int errflags);
 int _libssh2_error(LIBSSH2_SESSION* session, int errcode, const char* errmsg);
 
 void _libssh2_list_init(struct list_head *head);
diff --git a/src/session.c b/src/session.c
index 9e9343f..cc77a7a 100644
--- a/src/session.c
+++ b/src/session.c
@@ -1058,6 +1058,11 @@ session_free(LIBSSH2_SESSION *session)
         LIBSSH2_FREE(session, session->server_hostkey);
     }
 
+    /* error string */
+    if (session->err_msg && ((session->err_flags & LIBSSH2_ERR_FLAG_DUP) != 0)) {
+        LIBSSH2_FREE(session, (char *)session->err_msg);
+    }
+
     LIBSSH2_FREE(session, session);
 
     return 0;
-- 
2.5.0


--------------040304060905020509070506
Content-Type: text/x-patch;
 name="0002-Add-function-libssh2_session_set_last_error.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment;
 filename="0002-Add-function-libssh2_session_set_last_error.patch"

From ee7bda6b0e810cad9d8855da7fc54f6099370e3f Mon Sep 17 00:00:00 2001
From: Salvador Fandino <sfandino@yahoo.com>
Date: Thu, 15 Oct 2015 17:36:03 +0200
Subject: [PATCH 2/2] Add function libssh2_session_set_last_error
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Net::SSH2, the Perl wrapping module for libssh2 implements several features*
on top of libssh2 that can fail and so need some mechanism to report the error
condition to the user.

Until now, besides the error state maintained internally by libssh2, another
error state was maintained at the Perl level for every session object and then
additional logic was used to merge both error states. That is a maintenance
nighmare, and actually there is no way to do it correctly and consistently.

In order to allow the high level language to add new features to the library
but still rely in its error reporting features the new function
libssh2_session_set_last_error (that just exposses _libssh2_error_flags) is
introduced.

*) For instance, connecting to a remote SSH service giving the hostname and
port.

Signed-off-by: Salvador Fandino <sfandino@yahoo.com>
Signed-off-by: Salvador Fandiño <sfandino@yahoo.com>
---
 include/libssh2.h |  3 +++
 src/session.c     | 19 ++++++++++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/include/libssh2.h b/include/libssh2.h
index 8b4695a..f3d976c 100644
--- a/include/libssh2.h
+++ b/include/libssh2.h
@@ -567,6 +567,9 @@ LIBSSH2_API int libssh2_session_last_error(LIBSSH2_SESSION *session,
                                            char **errmsg,
                                            int *errmsg_len, int want_buf);
 LIBSSH2_API int libssh2_session_last_errno(LIBSSH2_SESSION *session);
+LIBSSH2_API int libssh2_session_set_last_error(LIBSSH2_SESSION* session,
+                                               int errcode,
+                                               const char* errmsg);
 LIBSSH2_API int libssh2_session_block_directions(LIBSSH2_SESSION *session);
 
 LIBSSH2_API int libssh2_session_flag(LIBSSH2_SESSION *session, int flag,
diff --git a/src/session.c b/src/session.c
index cc77a7a..06e61dd 100644
--- a/src/session.c
+++ b/src/session.c
@@ -1290,7 +1290,24 @@ libssh2_session_last_errno(LIBSSH2_SESSION * session)
     return session->err_code;
 }
 
-/* libssh2_session_flag
+/* libssh2_session_set_last_error
+ *
+ * Sets the internal error code for the session.
+ *
+ * This function is available specifically to be used by high level
+ * language wrappers (i.e. Python or Perl) that may extend the library
+ * features while still relying on its error reporting mechanism.
+ */
+LIBSSH2_API int
+libssh2_session_set_last_error(LIBSSH2_SESSION* session,
+                               int errcode,
+                               const char* errmsg)
+{
+    return _libssh2_error_flags(session, errcode, errmsg,
+                                LIBSSH2_ERR_FLAG_DUP);
+}
+
+/* Libssh2_session_flag
  *
  * Set/Get session flags
  *
-- 
2.5.0


--------------040304060905020509070506
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--------------040304060905020509070506--

From libssh2-devel-bounces@cool.haxx.se  Mon Oct 26 10:15:13 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9Q9ElBk012202;
	Mon, 26 Oct 2015 10:15:09 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [212.116.89.98])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9Q9Ekqq012197
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Mon, 26 Oct 2015 10:14:46 +0100
Received: (qmail 16840 invoked by uid 501); 26 Oct 2015 09:14:46 -0000
Message-ID: <20151026091446.16839.qmail@stuge.se>
Date: Mon, 26 Oct 2015 10:14:46 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: [PATCH] add function libssh2_session_set_last_error
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <mvoicf$oj6$1@ger.gmane.org>
 <1862333.047qXO3ZL8@kdudka.brq.redhat.com> <n0a7qf$dnp$1@ger.gmane.org>
 <20151023114313.20611.qmail@stuge.se> <n0dgpd$mfa$1@ger.gmane.org>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <n0dgpd$mfa$1@ger.gmane.org>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id t9Q9ElBk012202

Salvador Fandiño wrote:
> Ok, lets try again:
>
> Now "err_msg" is also freed from "session_free" when the DUP flag is set.
>
> The "flags" argument to "_libssh2_error_flags" has been renamed to 
> "errflags".

Thanks. I've pushed these to git.libssh2.org.


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

From libssh2-devel-bounces@cool.haxx.se  Mon Oct 26 10:31:53 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9Q9VlKB025249;
	Mon, 26 Oct 2015 10:31:52 +0100
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9Q9Vjsh025241
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Mon, 26 Oct 2015 10:31:45 +0100
Received: from localhost (dast@localhost)
 by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id t9Q9VjPs025236
 for <libssh2-devel@cool.haxx.se>; Mon, 26 Oct 2015 10:31:45 +0100
X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs
Date: Mon, 26 Oct 2015 10:31:45 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: [PATCH] add function libssh2_session_set_last_error
In-Reply-To: <20151026091446.16839.qmail@stuge.se>
Message-ID: <alpine.DEB.2.11.1510261026240.3394@tvnag.unkk.fr>
References: <mvoicf$oj6$1@ger.gmane.org>
 <1862333.047qXO3ZL8@kdudka.brq.redhat.com> <n0a7qf$dnp$1@ger.gmane.org>
 <20151023114313.20611.qmail@stuge.se> <n0dgpd$mfa$1@ger.gmane.org>
 <20151026091446.16839.qmail@stuge.se>
User-Agent: Alpine 2.11 (DEB 23 2013-08-11)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id t9Q9VlKB025249

On Mon, 26 Oct 2015, Peter Stuge wrote:

> Thanks. I've pushed these to git.libssh2.org.

But why push that to the deprecated git repo? Are you intending to keep your 
own fork there or why are you splintering the effort like that?

The official libssh2 git repo is at https://github.com/libssh2/libssh2

Also: that's a new API function but without any provided docs and I don't 
think we should merge new functions undocumented.

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Mon Oct 26 11:55:21 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9QAt7m9014387;
	Mon, 26 Oct 2015 11:55:19 +0100
Received: from plane.gmane.org (plane.gmane.org [80.91.229.3])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9QAt5eW014382
 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Mon, 26 Oct 2015 11:55:05 +0100
Received: from list by plane.gmane.org with local (Exim 4.69)
 (envelope-from <gnslg-libssh2-devel-2@m.gmane.org>)
 id 1ZqfQe-000381-EV
 for libssh2-devel@cool.haxx.se; Mon, 26 Oct 2015 11:55:04 +0100
Received: from 213.37.131.197.static.user.ono.com ([213.37.131.197])
 by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
 id 1AlnuQ-0007hv-00
 for <libssh2-devel@cool.haxx.se>; Mon, 26 Oct 2015 11:55:04 +0100
Received: from sfandino by 213.37.131.197.static.user.ono.com with local
 (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00
 for <libssh2-devel@cool.haxx.se>; Mon, 26 Oct 2015 11:55:04 +0100
X-Injected-Via-Gmane: http://gmane.org/
To: libssh2-devel@cool.haxx.se
From: Salvador Fandino <sfandino@gmail.com>
Subject: Re: [PATCH] add function libssh2_session_set_last_error
Date: Mon, 26 Oct 2015 11:54:44 +0100
Lines: 89
Message-ID: <n0l0pk$a0h$1@ger.gmane.org>
References: <mvoicf$oj6$1@ger.gmane.org>
 <1862333.047qXO3ZL8@kdudka.brq.redhat.com> <n0a7qf$dnp$1@ger.gmane.org>
 <20151023114313.20611.qmail@stuge.se> <n0dgpd$mfa$1@ger.gmane.org>
 <20151026091446.16839.qmail@stuge.se>
 <alpine.DEB.2.11.1510261026240.3394@tvnag.unkk.fr>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="------------010208040702070409000602"
X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: 213.37.131.197.static.user.ono.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.3.0
In-Reply-To: <alpine.DEB.2.11.1510261026240.3394@tvnag.unkk.fr>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>

This is a multi-part message in MIME format.
--------------010208040702070409000602
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

On 10/26/2015 10:31 AM, Daniel Stenberg wrote:
> On Mon, 26 Oct 2015, Peter Stuge wrote:
>
>> Thanks. I've pushed these to git.libssh2.org.
>
> But why push that to the deprecated git repo? Are you intending to keep
> your own fork there or why are you splintering the effort like that?
>
> The official libssh2 git repo is at https://github.com/libssh2/libssh2
>
> Also: that's a new API function but without any provided docs and I
> don't think we should merge new functions undocumented.

Documentation patch attached.




--------------010208040702070409000602
Content-Type: application/text;
 name="0003-Document-libssh2_session_set_last_error-3.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="0003-Document-libssh2_session_set_last_error-3.patch"

RnJvbSA3MWZjZjM5NmZkMGM2OGUzZGVhM2Q5ZjIyMDQ4ZDBmMmZmZGViMTNhIE1vbiBTZXAg
MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBTYWx2YWRvciBGYW5kaW5vIDxz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itcZkllcnJjb2RlXGZQIC0gT25lIG9mIHRoZSBl
cnJvciBjb2RlcyBhcyBkZWZpbmVkIGluIHRoZSBwdWJsaWMKK2xpYnNzaDIgaGVhZGVyIGZp
bGUuCisKK1xmSWVycm1zZ1xmUCAtIElmIG5vdCBOVUxMLCBhIGNvcHkgb2YgdGhlIGdpdmVu
IHN0cmluZyBpcyBzdG9yZWQKK2luc2lkZSB0aGUgc2Vzc2lvbiBvYmplY3QgYXMgdGhlIGVy
cm9yIG1lc3NhZ2UuCisKK1RoaXMgZnVuY3Rpb24gaXMgcHJvdmlkZWQgZm9yIGhpZ2ggbGV2
ZWwgbGFuZ3VhZ2Ugd3JhcHBlcnMKKyhpLmUuIFB5dGhvbiBvciBQZXJsKSBhbmQgb3RoZXIg
bGlicmFyaWVzIHRoYXQgbWF5IGV4dGVuZCBsaWJzc2gyIHdpdGgKK2FkZGl0aW9uYWwgZmVh
dHVyZXMgd2hpbGUgc3RpbGwgcmVseWluZyBvbiBpdHMgZXJyb3IgcmVwb3J0aW5nCittZWNo
YW5pc20uCisKKy5TSCBSRVRVUk4gVkFMVUUKK051bWVyaWMgZXJyb3IgY29kZSBjb3JyZXNw
b25kaW5nIHRvIHRoZSB0aGUgRXJyb3IgQ29kZSBjb25zdGFudHMuCisKKy5TSCBBVkFJTEFC
SUxJVFkKK0FkZGVkIGluIDEuNi4xCisKKy5TSCBTRUUgQUxTTworLkJSIGxpYnNzaDJfc2Vz
c2lvbl9sYXN0X2Vycm9yKDMpCisuQlIgbGlic3NoMl9zZXNzaW9uX2xhc3RfZXJybm8oMykK
LS0gCjIuNS4wCgo=
--------------010208040702070409000602
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--------------010208040702070409000602--

From libssh2-devel-bounces@cool.haxx.se  Mon Oct 26 13:05:12 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9QC4wlg021146;
	Mon, 26 Oct 2015 13:05:10 +0100
Received: from plane.gmane.org (plane.gmane.org [80.91.229.3])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9QC4uNV020944
 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Mon, 26 Oct 2015 13:04:56 +0100
Received: from list by plane.gmane.org with local (Exim 4.69)
 (envelope-from <gnslg-libssh2-devel-2@m.gmane.org>)
 id 1ZqgWG-0005yF-64
 for libssh2-devel@cool.haxx.se; Mon, 26 Oct 2015 13:04:56 +0100
Received: from 213.37.131.197.static.user.ono.com ([213.37.131.197])
 by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
 id 1AlnuQ-0007hv-00
 for <libssh2-devel@cool.haxx.se>; Mon, 26 Oct 2015 13:04:56 +0100
Received: from sfandino by 213.37.131.197.static.user.ono.com with local
 (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00
 for <libssh2-devel@cool.haxx.se>; Mon, 26 Oct 2015 13:04:56 +0100
X-Injected-Via-Gmane: http://gmane.org/
To: libssh2-devel@cool.haxx.se
From: Salvador Fandino <sfandino@gmail.com>
Subject: Re: [PATCH] add function libssh2_session_set_last_error
Date: Mon, 26 Oct 2015 13:04:49 +0100
Lines: 51
Message-ID: <n0l4t1$div$1@ger.gmane.org>
References: <mvoicf$oj6$1@ger.gmane.org>
 <1862333.047qXO3ZL8@kdudka.brq.redhat.com> <n0a7qf$dnp$1@ger.gmane.org>
 <20151023114313.20611.qmail@stuge.se> <n0dgpd$mfa$1@ger.gmane.org>
 <20151026091446.16839.qmail@stuge.se>
 <alpine.DEB.2.11.1510261026240.3394@tvnag.unkk.fr>
 <n0l0pk$a0h$1@ger.gmane.org>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="------------090803010805040405050509"
X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: 213.37.131.197.static.user.ono.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.3.0
In-Reply-To: <n0l0pk$a0h$1@ger.gmane.org>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>

This is a multi-part message in MIME format.
--------------090803010805040405050509
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

On 10/26/2015 11:54 AM, Salvador Fandino wrote:
> On 10/26/2015 10:31 AM, Daniel Stenberg wrote:
>> On Mon, 26 Oct 2015, Peter Stuge wrote:
>>
>>> Thanks. I've pushed these to git.libssh2.org.
>>
>> But why push that to the deprecated git repo? Are you intending to keep
>> your own fork there or why are you splintering the effort like that?
>>
>> The official libssh2 git repo is at https://github.com/libssh2/libssh2
>>
>> Also: that's a new API function but without any provided docs and I
>> don't think we should merge new functions undocumented.
>
> Documentation patch attached.

I don't really know how the CMake build procedure works, but this extra 
patch is probably also needed in order to get the manual page for 
libssh2_session_set_last_error installed from there. Right?



--------------090803010805040405050509
Content-Type: application/text;
 name="0004-Add-libssh2_session_set_last_error.3-into-CMakeLists.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename*0="0004-Add-libssh2_session_set_last_error.3-into-CMakeLists.pa";
 filename*1="tch"

RnJvbSBlYjJkY2FjMzk3YWIwZjQwMmE5MTk4NjU2MjBlNjk1N2FmY2RkYzNlIE1vbiBTZXAg
MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBTYWx2YWRvciBGYW5kaW5vIDxzZmFuZGlub0B5YWhv
by5jb20+CkRhdGU6IE1vbiwgMjYgT2N0IDIwMTUgMTM6MDE6MDAgKzAxMDAKU3ViamVjdDog
W1BBVENIIDQvNF0gQWRkIGxpYnNzaDJfc2Vzc2lvbl9zZXRfbGFzdF9lcnJvci4zIGludG8g
Q01ha2VMaXN0cy50eHQKClNpZ25lZC1vZmYtYnk6IFNhbHZhZG9yIEZhbmRpbm8gPHNmYW5k
aW5vQHlhaG9vLmNvbT4KLS0tCiBkb2NzL0NNYWtlTGlzdHMudHh0IHwgMSArCiAxIGZpbGUg
Y2hhbmdlZCwgMSBpbnNlcnRpb24oKykKCmRpZmYgLS1naXQgYS9kb2NzL0NNYWtlTGlzdHMu
dHh0IGIvZG9jcy9DTWFrZUxpc3RzLnR4dAppbmRleCBmZDZmY2YyLi4zZTlkMTY1IDEwMDY0
NAotLS0gYS9kb2NzL0NNYWtlTGlzdHMudHh0CisrKyBiL2RvY3MvQ01ha2VMaXN0cy50eHQK
QEAgLTEzOSw2ICsxMzksNyBAQCBzZXQoTUFOX1BBR0VTCiAgIGxpYnNzaDJfc2Vzc2lvbl9p
bml0X2V4LjMKICAgbGlic3NoMl9zZXNzaW9uX2xhc3RfZXJybm8uMwogICBsaWJzc2gyX3Nl
c3Npb25fbGFzdF9lcnJvci4zCisgIGxpYnNzaDJfc2Vzc2lvbl9zZXRfbGFzdF9lcnJvci4z
CiAgIGxpYnNzaDJfc2Vzc2lvbl9tZXRob2RfcHJlZi4zCiAgIGxpYnNzaDJfc2Vzc2lvbl9t
ZXRob2RzLjMKICAgbGlic3NoMl9zZXNzaW9uX3NldF9ibG9ja2luZy4zCi0tIAoyLjUuMAoK

--------------090803010805040405050509
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--------------090803010805040405050509--

From libssh2-devel-bounces@cool.haxx.se  Mon Oct 26 13:46:47 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9QCkaUn021361;
	Mon, 26 Oct 2015 13:46:45 +0100
Received: from foo.stuge.se (qmailr@foo.stuge.se [212.116.89.98])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9QCkY6v021356
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Mon, 26 Oct 2015 13:46:34 +0100
Received: (qmail 6758 invoked by uid 501); 26 Oct 2015 12:46:35 -0000
Message-ID: <20151026124635.6757.qmail@stuge.se>
Date: Mon, 26 Oct 2015 13:46:35 +0100
From: Peter Stuge <peter@stuge.se>
To: libssh2-devel@cool.haxx.se
Subject: Re: [PATCH] add function libssh2_session_set_last_error
Mail-Followup-To: libssh2-devel@cool.haxx.se
References: <mvoicf$oj6$1@ger.gmane.org>
 <1862333.047qXO3ZL8@kdudka.brq.redhat.com> <n0a7qf$dnp$1@ger.gmane.org>
 <20151023114313.20611.qmail@stuge.se> <n0dgpd$mfa$1@ger.gmane.org>
 <20151026091446.16839.qmail@stuge.se>
 <alpine.DEB.2.11.1510261026240.3394@tvnag.unkk.fr>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.11.1510261026240.3394@tvnag.unkk.fr>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id t9QCkaUn021361

Daniel Stenberg wrote:
>> Thanks. I've pushed these to git.libssh2.org.
>
> But why push that to the deprecated git repo? Are you intending to keep 
> your own fork there or why are you splintering the effort like that?
>
> The official libssh2 git repo is at https://github.com/libssh2/libssh2

I pushed to git.libssh2.org because I do not use GitHub, and I don't
think you should either. Read their terms. Apparently if someone sues
them for something you have done, you have to pay for their lawyers.
That's just one of the many silly things.

I don't intend on maintaining a fork and I'm not splintering the
effort. I've pushed an updaated (rewritten) branch to git.libssh2.org
now, with Salvador's commits on top of what's currently at GitHub.


> Also: that's a new API function but without any provided docs and I
> don't think we should merge new functions undocumented.

I squashed Salvador's documentation commits together with the commit
that adds the function.


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

From libssh2-devel-bounces@cool.haxx.se  Mon Oct 26 14:33:58 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9QDXgQN016289;
	Mon, 26 Oct 2015 14:33:56 +0100
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9QDXedG015991
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Mon, 26 Oct 2015 14:33:41 +0100
Received: from int-mx11.intmail.prod.int.phx2.redhat.com
 (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24])
 by mx1.redhat.com (Postfix) with ESMTPS id 534BD96E7;
 Mon, 26 Oct 2015 13:33:39 +0000 (UTC)
Received: from kdudka.brq.redhat.com (kdudka.brq.redhat.com [10.34.4.67])
 by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id
 t9QDXa9U017281
 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
 Mon, 26 Oct 2015 09:33:38 -0400
From: Kamil Dudka <kdudka@redhat.com>
To: Peter Stuge <peter@stuge.se>
Subject: Re: [PATCH] add function libssh2_session_set_last_error
Date: Mon, 26 Oct 2015 14:33:36 +0100
Message-ID: <2084627.YWy7ANUtQo@kdudka.brq.redhat.com>
User-Agent: KMail/4.14.9 (Linux/4.0.8-304.fc22.x86_64; KDE/4.14.11; x86_64; ; )
In-Reply-To: <20151026124635.6757.qmail@stuge.se>
References: <mvoicf$oj6$1@ger.gmane.org>
 <alpine.DEB.2.11.1510261026240.3394@tvnag.unkk.fr>
 <20151026124635.6757.qmail@stuge.se>
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24
Cc: libssh2-devel@cool.haxx.se
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id t9QDXgQN016289

On Monday 26 October 2015 13:46:35 Peter Stuge wrote:
> Daniel Stenberg wrote:
> >> Thanks. I've pushed these to git.libssh2.org.
> > 
> > But why push that to the deprecated git repo? Are you intending to keep
> > your own fork there or why are you splintering the effort like that?
> > 
> > The official libssh2 git repo is at https://github.com/libssh2/libssh2
> 
> I pushed to git.libssh2.org because I do not use GitHub, and I don't
> think you should either. Read their terms. Apparently if someone sues
> them for something you have done, you have to pay for their lawyers.
> That's just one of the many silly things.
> 
> I don't intend on maintaining a fork and I'm not splintering the
> effort. I've pushed an updaated (rewritten) branch to git.libssh2.org
> now, with Salvador's commits on top of what's currently at GitHub.

I do not think I understand the relation between those two git repositories.

If git.libssh2.org is intended to be a mirror of the upstream git repo at 
github, it should only contain commits already pushed to github and nothing 
else.  Additionally, already pushed commits should not be rewritten.

If git.libssh2.org is intended to be a staging repository for your work, it 
should be clearly marked such (e.g. by using a separate branch for that
while keeping the master branch synced with github).

Kamil

> > Also: that's a new API function but without any provided docs and I
> > don't think we should merge new functions undocumented.
> 
> I squashed Salvador's documentation commits together with the commit
> that adds the function.
> 
> 
> //Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

From libssh2-devel-bounces@cool.haxx.se  Tue Oct 27 09:16:51 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9R8GMVj015950;
	Tue, 27 Oct 2015 09:16:46 +0100
Received: from mail-ob0-x22b.google.com (mail-ob0-x22b.google.com
 [IPv6:2607:f8b0:4003:c01::22b])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9R8GL7G015879
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Tue, 27 Oct 2015 09:16:21 +0100
Received: by obbza9 with SMTP id za9so46350566obb.1
 for <libssh2-devel@cool.haxx.se>; Tue, 27 Oct 2015 01:16:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:date:message-id:subject:from:to:content-type;
 bh=ba+1LdEAydNf/Yv5X2jT70iAA+sX+znI+r9nvy02iaU=;
 b=CyUxQ08IrfwLArheSCaLLJ0R7DNjlkGQAtI27LLsI6YjEUNcvGMZj+uNH2pHEjXayg
 vLTfyfYaRbArjPYtU3scH6odAZBt4RUZHfTrpZPgLBm9WcVSX92yV5R+539DEOfxKE1g
 73GVA5aQJOk0FWMbEDEuJnH/wg+mWCeSZbcqgSuLM+pv3rlkPj1UGAHLS9EojCTkX4m4
 4B8JG8nHY+oFl0VnmcyvoZ3BeSpBBOpfMYI9pTcF5P8aWQstmL3FFOvUlRhQQu3jnyV3
 7WOou00sHgL4J9OXQaXiR5n2B8jXsd9JVKbhL1TEPt49TyxDF6natuhKGqcs2E+ORMEF
 j6bQ==
MIME-Version: 1.0
X-Received: by 10.60.69.65 with SMTP id c1mr26731729oeu.38.1445933772644; Tue,
 27 Oct 2015 01:16:12 -0700 (PDT)
Received: by 10.76.74.40 with HTTP; Tue, 27 Oct 2015 01:16:12 -0700 (PDT)
Date: Tue, 27 Oct 2015 01:16:12 -0700
Message-ID: <CAHwNr4GJjmS5wT9sBMtWciTP4QoUfv0q88d6+LVKhRwY94yGdA@mail.gmail.com>
Subject: How to structure code for multiple sessions with async API
From: Sanchay Harneja <sanchay.h@gmail.com>
To: libssh2-devel@cool.haxx.se
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: multipart/mixed; boundary="===============0785492733=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>

--===============0785492733==
Content-Type: multipart/alternative; boundary=001a1133151ee32677052311b049

--001a1133151ee32677052311b049
Content-Type: text/plain; charset=UTF-8

Hi,

I'm developing an application where every 5 mins I need to open ~40-50 ssh
sessions and download some data by running commands. I'm in a resource
constrained environment and want to minimize latency (there are a
downstream functions which get kicked after downloading data which take
time).

So I'm planning to use libssh2 async API and keep ssh sessions alive. I've
managed to write code with opens the 50 sessions one after another in my
main thread. After this I kick off 50 commands asynchronously and use poll
to wait on the sockets. So my code looks like (pseudo code):

open_session(i) {
  sessions[i] = libssh2_session_init();
  socks[i] = open_socket();
  libssh2_session_handshake(sessions[i], socks[i]);
  libssh2_userauth_password(sessions[i]);
}

process_async(i) {
  if (opened[i] == 0) {
     channels[i] = libssh2_channel_open_session(sessions[i]);
     if (rc == LIBSSH2_ERROR_EAGAIN) { return }
     opened[i] = 1;
  }
  if (exec[i] == 0) {
     libssh2_channel_exec(channels[i], command);
     if (rc == LIBSSH2_ERROR_EAGAIN) { return }
     exec[i] = 1;
  }
  if (read[i] == 0) {
     do { libssh2_channel_read(channels[i]); } while (rc > 0);
     if (rc == LIBSSH2_ERROR_EAGAIN) { return }
     read[i] = 1;
  }
  if (closed[i] == 0) {
    libssh2_channel_close(channels[i]);
    if (rc == LIBSSH2_ERROR_EAGAIN) { return }
    closed[i] = 1;
  }
  done[i] =1;
  opened[i] = 0;
  exec[i] = 0;
  read[i] = 0;
  closed[i] = 0;
}

process_all_tasks() {
  for (i=0 to 50) { process_async[i] } // this is fast
  num_done = 0;
  while (num_done < 50) {
     rc = poll(socks[] ...); // direction is set
using libssh2_session_block_directions
     if (rc <= 0) {error}
     for (i=0 to 50) {
       if (tiggered) {
         process_async(i);
         if (done[i]) { num_done++ }
       }
     }
  }
}

main() {
  for (i=0 to 50) { open_session[i] } // this takes time
  while (true) {
    process_all_tasks();
    sleep(5 minutes);
  }
}

First of all - not sure if this is a good way to structure the calls but
all of this code works - at least I've tested the happy path multiple
times. I can share as a gist if it helps (its in C++). Let me know if you
think this is bad / suggestions.

Now I'm thinking of how to put in libssh2_keepalive_send calls. One thought
I have is to combine the processing and sleeping:

main() {
  for (i=0 to 50) { open_session[i] } // this takes time
  num_done = 0;
  last_done_time = 0;
  while (true) {
    if (num_done >= 50 && (now() - last_done_time >= 5mins)) {
      num_done = 0;
      last_done_time = now();
      for (i=0 to 50) {
        process_async(i);
      }
    }
    rc = poll(socks[] ...); // direction is set
using libssh2_session_block_directions
    if (rc < 0) { error } // NOTE : in this case i'm treating timeout as
valid
    for (i=0 to 50) {
       if (tiggered && (done[i] == 0)) {
         process_async(i);
         if (done[i]) {num_done++}
       } else {
         libssh2_keepalive_send(sessions[i]);
       }
     }
  }
}

I've tested this and it seems to be working but I'm not really utilizing
the keepalive_send's output seconds value.

Another issue I have is how to break up this code into smaller modular
parts.

--001a1133151ee32677052311b049
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi,<div><br></div><div>I&#39;m developing an application w=
here every 5 mins I need to open ~40-50 ssh sessions and download some data=
 by running commands. I&#39;m in a resource constrained environment and wan=
t to minimize latency (there are a downstream functions which get kicked af=
ter downloading data which take time).</div><div><br></div><div>So I&#39;m =
planning to use libssh2 async API and keep ssh sessions alive. I&#39;ve man=
aged to write code with opens the 50 sessions one after another in my main =
thread. After this I kick off 50 commands asynchronously and use poll to wa=
it on the sockets. So my code looks like (pseudo code):</div><div><br></div=
><div>open_session(i) {</div><div>=C2=A0 sessions[i] =3D libssh2_session_in=
it();</div><div>=C2=A0 socks[i] =3D open_socket();</div><div>=C2=A0 libssh2=
_session_handshake(sessions[i], socks[i]);</div><div>=C2=A0 libssh2_useraut=
h_password(sessions[i]);</div><div>}</div><div><br></div><div>process_async=
(i) {</div><div>=C2=A0 if (opened[i] =3D=3D 0) {</div><div>=C2=A0 =C2=A0 =
=C2=A0channels[i] =3D libssh2_channel_open_session(sessions[i]);</div><div>=
=C2=A0 =C2=A0 =C2=A0if (rc =3D=3D=C2=A0LIBSSH2_ERROR_EAGAIN) { return }</di=
v><div>=C2=A0 =C2=A0 =C2=A0opened[i] =3D 1;</div><div>=C2=A0 }</div><div>=
=C2=A0 if (exec[i] =3D=3D 0) {</div><div>=C2=A0 =C2=A0 =C2=A0libssh2_channe=
l_exec(channels[i], command);</div><div>=C2=A0 =C2=A0 =C2=A0if (rc =3D=3D=
=C2=A0LIBSSH2_ERROR_EAGAIN) { return }</div><div>=C2=A0 =C2=A0 =C2=A0exec[i=
] =3D 1;</div><div>=C2=A0 }</div><div>=C2=A0 if (read[i] =3D=3D 0) {</div><=
div>=C2=A0 =C2=A0 =C2=A0do { libssh2_channel_read(channels[i]); } while (rc=
 &gt; 0);</div><div>=C2=A0 =C2=A0 =C2=A0if (rc =3D=3D=C2=A0LIBSSH2_ERROR_EA=
GAIN) { return }</div><div>=C2=A0 =C2=A0 =C2=A0read[i] =3D 1;</div><div>=C2=
=A0 }</div><div>=C2=A0 if (closed[i] =3D=3D 0) {</div><div>=C2=A0 =C2=A0 li=
bssh2_channel_close(channels[i]);</div><div>=C2=A0 =C2=A0 if (rc =3D=3D=C2=
=A0LIBSSH2_ERROR_EAGAIN) { return }</div><div>=C2=A0 =C2=A0 closed[i] =3D 1=
;</div><div>=C2=A0 }</div><div>=C2=A0 done[i] =3D1;</div><div>=C2=A0 opened=
[i] =3D 0;</div><div>=C2=A0 exec[i] =3D 0;</div><div>=C2=A0 read[i] =3D 0;<=
/div><div>=C2=A0 closed[i] =3D 0;</div><div>}</div><div><br></div><div>proc=
ess_all_tasks() {</div><div><div>=C2=A0 for (i=3D0 to 50) { process_async[i=
] } // this is fast</div><div>=C2=A0 num_done =3D 0;</div><div>=C2=A0 while=
 (num_done &lt; 50) {</div><div>=C2=A0 =C2=A0 =C2=A0rc =3D poll(socks[] ...=
); // direction is set using=C2=A0libssh2_session_block_directions</div><di=
v>=C2=A0 =C2=A0 =C2=A0if (rc &lt;=3D 0) {error}</div><div>=C2=A0 =C2=A0 =C2=
=A0for (i=3D0 to 50) {</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0if (tiggered) {=
</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0process_async(i);</div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (done[i]) { num_done++ }</div><div>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0}</div><div>=C2=A0 =C2=A0 =C2=A0}</div><div>=C2=A0 =
}</div></div><div>}</div><div><br></div><div>main() {</div><div>=C2=A0 for =
(i=3D0 to 50) { open_session[i] } // this takes time</div><div>=C2=A0 while=
 (true) {</div><div>=C2=A0 =C2=A0 process_all_tasks();</div><div>=C2=A0 =C2=
=A0 sleep(5 minutes);</div><div>=C2=A0 }</div><div>}</div><div><br></div><d=
iv>First of all - not sure if this is a good way to structure the calls but=
 all of this code works - at least I&#39;ve tested the happy path multiple =
times. I can share as a gist if it helps (its in C++). Let me know if you t=
hink this is bad / suggestions.</div><div><br></div><div>Now I&#39;m thinki=
ng of how to put in libssh2_keepalive_send calls. One thought I have is to =
combine the processing and sleeping:</div><div><br></div><div>main() {</div=
><div>=C2=A0 for (i=3D0 to 50) { open_session[i] } // this takes time</div>=
<div>=C2=A0 num_done =3D 0;</div><div>=C2=A0 last_done_time =3D 0;</div><di=
v>=C2=A0 while (true) {</div><div>=C2=A0 =C2=A0 if (num_done &gt;=3D 50 &am=
p;&amp; (now() - last_done_time &gt;=3D 5mins)) {</div><div>=C2=A0 =C2=A0 =
=C2=A0 num_done =3D 0;</div><div>=C2=A0 =C2=A0 =C2=A0 last_done_time =3D no=
w();</div><div>=C2=A0 =C2=A0 =C2=A0 for (i=3D0 to 50) {</div><div>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 process_async(i);</div><div>=C2=A0 =C2=A0 =C2=A0 }</di=
v><div>=C2=A0 =C2=A0 }</div><div>=C2=A0 =C2=A0 rc =3D poll(socks[] ...); //=
 direction is set using=C2=A0libssh2_session_block_directions</div><div>=C2=
=A0 =C2=A0 if (rc &lt; 0) { error } // NOTE : in this case i&#39;m treating=
 timeout as valid</div><div>=C2=A0 =C2=A0 for (i=3D0 to 50) {</div><div>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0if (tiggered &amp;&amp; (done[i] =3D=3D 0)) {</div>=
<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0process_async(i);</div><div>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0if (done[i]) {num_done++}</div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0} else {</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0libss=
h2_keepalive_send(sessions[i]);</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0}</div=
><div>=C2=A0 =C2=A0 =C2=A0}</div><div>=C2=A0 }</div><div>}</div><div><br></=
div><div>I&#39;ve tested this and it seems to be working but I&#39;m not re=
ally utilizing the keepalive_send&#39;s output seconds value.</div><div><br=
></div><div>Another issue I have is how to break up this code into smaller =
modular parts.</div></div>

--001a1133151ee32677052311b049--

--===============0785492733==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--===============0785492733==--

From libssh2-devel-bounces@cool.haxx.se  Tue Oct 27 10:06:29 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9R96C7K024121;
	Tue, 27 Oct 2015 10:06:26 +0100
Received: from plane.gmane.org (plane.gmane.org [80.91.229.3])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9R95OjL023661
 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Tue, 27 Oct 2015 10:05:24 +0100
Received: from public by plane.gmane.org with local (Exim 4.69)
 (envelope-from <public@plane.gmane.org>) id 1Zr0C3-0008BG-Sx
 for libssh2-devel@cool.haxx.se; Tue, 27 Oct 2015 10:05:23 +0100
Received: from smtp.qindel.com ([89.140.90.34] helo=thor.qindel.com)
 by plane.gmane.org with esmtp (Exim 4.69)
 (envelope-from <sfandino@gmail.com>) id 1Zr0Bs-00080z-R5
 for public-libssh2-devel-nuDYylZla2DMSbncWqzJgw@plane.gmane.org;
 Tue, 27 Oct 2015 10:05:12 +0100
Received: from localhost (localhost [127.0.0.1])
 by thor.qindel.com (Postfix) with ESMTP id D138B6055C
 for <libssh2-devel-nuDYylZla2DMSbncWqzJgw@public.gmane.org>;
 Tue, 27 Oct 2015 10:05:10 +0100 (CET)
Received: from thor.qindel.com ([127.0.0.1])
 by localhost (thor.qindel.com [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id ln5oqLl_6Qw9
 for <libssh2-devel-nuDYylZla2DMSbncWqzJgw@public.gmane.org>;
 Tue, 27 Oct 2015 10:05:10 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
 by thor.qindel.com (Postfix) with ESMTP id 7A78560560
 for <libssh2-devel-nuDYylZla2DMSbncWqzJgw@public.gmane.org>;
 Tue, 27 Oct 2015 10:05:10 +0100 (CET)
X-Virus-Scanned: amavisd-new at thor.qindel.com
Received: from thor.qindel.com ([127.0.0.1])
 by localhost (thor.qindel.com [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id vlrnC1S-j0_r
 for <libssh2-devel-nuDYylZla2DMSbncWqzJgw@public.gmane.org>;
 Tue, 27 Oct 2015 10:05:10 +0100 (CET)
Received: from [192.168.20.42] (unknown [92.56.141.104])
 by thor.qindel.com (Postfix) with ESMTPSA id 1EAE86055C
 for <libssh2-devel-nuDYylZla2DMSbncWqzJgw@public.gmane.org>;
 Tue, 27 Oct 2015 10:05:09 +0100 (CET)
Subject: Re: How to structure code for multiple sessions with async API
To: libssh2 development
 <public-libssh2-devel-nuDYylZla2DMSbncWqzJgw@plane.gmane.org>
References: <CAHwNr4GJjmS5wT9sBMtWciTP4QoUfv0q88d6+LVKhRwY94yGdA@mail.gmail.com>
From: =?UTF-8?Q?Salvador_Fandi=c3=b1o?= <sfandino@gmail.com>
Message-ID: <562F3E45.1070309@gmail.com>
Date: Tue, 27 Oct 2015 10:05:09 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <CAHwNr4GJjmS5wT9sBMtWciTP4QoUfv0q88d6+LVKhRwY94yGdA@mail.gmail.com>
X-Mailman-Approved-At: Tue, 27 Oct 2015 10:06:11 +0100
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id t9R96C7K024121



On 10/27/2015 09:16 AM, Sanchay Harneja wrote:
>
> I've tested this and it seems to be working but I'm not really utilizing
> the keepalive_send's output seconds value.

If I am understanding libssh2 code correctly, libssh2_keepalive_send can 
not work reliably in non-blocking mode as it converts 
LIBSSH2_ERROR_SOCKET_EAGAIN errors from _libssh2_transport_send into 
LIBSSH2_ERROR_SOCKET_SEND and leaves the transport layer in an 
inconsistent state.

In other words, if you call libssh2_keepalive_send and for any reason 
the keep-alive packet can not be immediately delivered, the connection 
becomes corrupted.


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

From libssh2-devel-bounces@cool.haxx.se  Tue Oct 27 10:37:28 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9R9bDCO030586;
	Tue, 27 Oct 2015 10:37:26 +0100
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9R9bA99030574
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Tue, 27 Oct 2015 10:37:10 +0100
Received: from localhost (dast@localhost)
 by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id t9R9bAXj030569
 for <libssh2-devel@cool.haxx.se>; Tue, 27 Oct 2015 10:37:10 +0100
X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs
Date: Tue, 27 Oct 2015 10:37:10 +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 structure code for multiple sessions with async API
In-Reply-To: <562F3E45.1070309@gmail.com>
Message-ID: <alpine.DEB.2.11.1510271036470.3394@tvnag.unkk.fr>
References: <CAHwNr4GJjmS5wT9sBMtWciTP4QoUfv0q88d6+LVKhRwY94yGdA@mail.gmail.com>
 <562F3E45.1070309@gmail.com>
User-Agent: Alpine 2.11 (DEB 23 2013-08-11)
X-fromdanielhimself: yes
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED;
 BOUNDARY="1129329158-1520420226-1445938630=:3394"
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <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-1520420226-1445938630=:3394
Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8BIT

On Tue, 27 Oct 2015, Salvador Fandiño wrote:

> If I am understanding libssh2 code correctly, libssh2_keepalive_send can not 
> work reliably in non-blocking mode as it converts 
> LIBSSH2_ERROR_SOCKET_EAGAIN errors from _libssh2_transport_send into 
> LIBSSH2_ERROR_SOCKET_SEND and leaves the transport layer in an inconsistent 
> state.
>
> In other words, if you call libssh2_keepalive_send and for any reason the 
> keep-alive packet can not be immediately delivered, the connection becomes 
> corrupted.

Isn't that just a bug we should fix?

-- 

  / daniel.haxx.se
--1129329158-1520420226-1445938630=:3394
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--1129329158-1520420226-1445938630=:3394--

From libssh2-devel-bounces@cool.haxx.se  Tue Oct 27 11:18:44 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9RAIVPJ007972;
	Tue, 27 Oct 2015 11:18:41 +0100
Received: from mail-ob0-x230.google.com (mail-ob0-x230.google.com
 [IPv6:2607:f8b0:4003:c01::230])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9RAISTh007875
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Tue, 27 Oct 2015 11:18:29 +0100
Received: by obctp1 with SMTP id tp1so138617458obc.2
 for <libssh2-devel@cool.haxx.se>; Tue, 27 Oct 2015 03:18:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :content-type; bh=dRHpMGEot0KTPTJ5PPf6t+12ixrnq/Mgf3RS2Z3DUSc=;
 b=SYD2bK0irWyL6MPa24wrLJTiAGh841UPJqV4NIS2WnLu9/XiDHBxNuxMuq8hveAgF8
 Ojobmcqwc8JIj0Nn9JSXlftyGVP0hwQNitf/eEnfSWXk/F9bfVbi97sDw/suPkgRZAwk
 nf/zQK6c/Tqp7npzYMwp8y+jEg/7FpfAiCt/1MxU1OK9+/Poehc/yHqP4VDogLYNYgud
 GwQI7pznD6RGeHM89d/yZI1ft04bizGq7OijeNgbrY08lfvHPRgiv8vr0+L3Ya+BdimZ
 tGmMA/IYrDBD/PmJF+gIckDeoc1B6LF9BxMuJYJtbDQVAsqjHDDGu8dMY84Kzsp02QcG
 Vfsg==
MIME-Version: 1.0
X-Received: by 10.182.111.196 with SMTP id ik4mr28991513obb.60.1445941103377; 
 Tue, 27 Oct 2015 03:18:23 -0700 (PDT)
Received: by 10.76.74.40 with HTTP; Tue, 27 Oct 2015 03:18:23 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.11.1510271036470.3394@tvnag.unkk.fr>
References: <CAHwNr4GJjmS5wT9sBMtWciTP4QoUfv0q88d6+LVKhRwY94yGdA@mail.gmail.com>
 <562F3E45.1070309@gmail.com>
 <alpine.DEB.2.11.1510271036470.3394@tvnag.unkk.fr>
Date: Tue, 27 Oct 2015 03:18:23 -0700
Message-ID: <CAHwNr4FrT=w7JR6V0ZNYMEh=O7pVA+x_+4bKJZs8czQkD7NP6w@mail.gmail.com>
Subject: Re: How to structure code for multiple sessions with async API
From: Sanchay Harneja <sanchay.h@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: multipart/mixed; boundary="===============0411611024=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>

--===============0411611024==
Content-Type: multipart/alternative; boundary=089e01536886d5448005231365a0

--089e01536886d5448005231365a0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

> if you call libssh2_keepalive_send and for any reason the keep-alive
packet can not be immediately delivered, the connection becomes corrupted.
What is the return value of keepalive_send in that case?

Would you recommend just using (multi-threaded) blocking mode then?

On Tue, Oct 27, 2015 at 2:37 AM, Daniel Stenberg <daniel@haxx.se> wrote:

> On Tue, 27 Oct 2015, Salvador Fandi=C3=B1o wrote:
>
> If I am understanding libssh2 code correctly, libssh2_keepalive_send can
>> not work reliably in non-blocking mode as it converts
>> LIBSSH2_ERROR_SOCKET_EAGAIN errors from _libssh2_transport_send into
>> LIBSSH2_ERROR_SOCKET_SEND and leaves the transport layer in an inconsist=
ent
>> state.
>>
>> In other words, if you call libssh2_keepalive_send and for any reason th=
e
>> keep-alive packet can not be immediately delivered, the connection becom=
es
>> corrupted.
>>
>
> Isn't that just a bug we should fix?
>
> --
>
>  / daniel.haxx.se
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>
>

--089e01536886d5448005231365a0
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt;=C2=A0<span style=3D"font-size:12.8px">if you call lib=
ssh2_keepalive_send and for any reason the keep-alive packet can not be imm=
ediately delivered, the connection becomes corrupted.</span><div><span styl=
e=3D"font-size:12.8px">What is the return value of keepalive_send in that c=
ase?</span></div><div><br></div><div>Would you recommend just using (multi-=
threaded) blocking mode then?</div></div><div class=3D"gmail_extra"><br><di=
v class=3D"gmail_quote">On Tue, Oct 27, 2015 at 2:37 AM, Daniel Stenberg <s=
pan dir=3D"ltr">&lt;<a href=3D"mailto:daniel@haxx.se" target=3D"_blank">dan=
iel@haxx.se</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span c=
lass=3D"">On Tue, 27 Oct 2015, Salvador Fandi=C3=B1o wrote:<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
If I am understanding libssh2 code correctly, libssh2_keepalive_send can no=
t work reliably in non-blocking mode as it converts LIBSSH2_ERROR_SOCKET_EA=
GAIN errors from _libssh2_transport_send into LIBSSH2_ERROR_SOCKET_SEND and=
 leaves the transport layer in an inconsistent state.<br>
<br>
In other words, if you call libssh2_keepalive_send and for any reason the k=
eep-alive packet can not be immediately delivered, the connection becomes c=
orrupted.<br>
</blockquote>
<br></span>
Isn&#39;t that just a bug we should fix?<span class=3D"HOEnZb"><font color=
=3D"#888888"><br>
<br>
-- <br>
<br>
=C2=A0/ <a href=3D"http://daniel.haxx.se" rel=3D"noreferrer" target=3D"_bla=
nk">daniel.haxx.se</a></font></span><br>___________________________________=
____________<br>
libssh2-devel <a href=3D"http://cool.haxx.se/cgi-bin/mailman/listinfo/libss=
h2-devel" rel=3D"noreferrer" target=3D"_blank">http://cool.haxx.se/cgi-bin/=
mailman/listinfo/libssh2-devel</a><br>
<br></blockquote></div><br></div>

--089e01536886d5448005231365a0--

--===============0411611024==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--===============0411611024==--

From libssh2-devel-bounces@cool.haxx.se  Tue Oct 27 12:54:30 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9RBsBJD018492;
	Tue, 27 Oct 2015 12:54:27 +0100
Received: from plane.gmane.org (plane.gmane.org [80.91.229.3])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9R9eXPf000944
 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Tue, 27 Oct 2015 10:40:33 +0100
Received: from public by plane.gmane.org with local (Exim 4.69)
 (envelope-from <public@plane.gmane.org>) id 1Zr0k4-0003Dt-T1
 for libssh2-devel@cool.haxx.se; Tue, 27 Oct 2015 10:40:32 +0100
Received: from smtp.qindel.com ([89.140.90.34] helo=thor.qindel.com)
 by plane.gmane.org with esmtp (Exim 4.69)
 (envelope-from <sfandino@gmail.com>) id 1Zr0jx-00039W-0Z
 for public-libssh2-devel-nuDYylZla2DMSbncWqzJgw@plane.gmane.org;
 Tue, 27 Oct 2015 10:40:25 +0100
Received: from localhost (localhost [127.0.0.1])
 by thor.qindel.com (Postfix) with ESMTP id ABBAE6055E
 for <libssh2-devel-nuDYylZla2DMSbncWqzJgw@public.gmane.org>;
 Tue, 27 Oct 2015 10:40:24 +0100 (CET)
Received: from thor.qindel.com ([127.0.0.1])
 by localhost (thor.qindel.com [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id Rx3XKahEJnPm
 for <libssh2-devel-nuDYylZla2DMSbncWqzJgw@public.gmane.org>;
 Tue, 27 Oct 2015 10:40:22 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
 by thor.qindel.com (Postfix) with ESMTP id 32C10605E2
 for <libssh2-devel-nuDYylZla2DMSbncWqzJgw@public.gmane.org>;
 Tue, 27 Oct 2015 10:40:22 +0100 (CET)
X-Virus-Scanned: amavisd-new at thor.qindel.com
Received: from thor.qindel.com ([127.0.0.1])
 by localhost (thor.qindel.com [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id samTNn2I8XhF
 for <libssh2-devel-nuDYylZla2DMSbncWqzJgw@public.gmane.org>;
 Tue, 27 Oct 2015 10:40:21 +0100 (CET)
Received: from [192.168.20.42] (unknown [92.56.141.104])
 by thor.qindel.com (Postfix) with ESMTPSA id 7D7CE605E0
 for <libssh2-devel-nuDYylZla2DMSbncWqzJgw@public.gmane.org>;
 Tue, 27 Oct 2015 10:40:21 +0100 (CET)
Subject: Re: How to structure code for multiple sessions with async API
To: libssh2 development
 <public-libssh2-devel-nuDYylZla2DMSbncWqzJgw@plane.gmane.org>
References: <CAHwNr4GJjmS5wT9sBMtWciTP4QoUfv0q88d6+LVKhRwY94yGdA@mail.gmail.com>
 <562F3E45.1070309@gmail.com>
 <alpine.DEB.2.11.1510271036470.3394@tvnag.unkk.fr>
From: =?UTF-8?Q?Salvador_Fandi=c3=b1o?= <sfandino@gmail.com>
Message-ID: <562F4683.20505@gmail.com>
Date: Tue, 27 Oct 2015 10:40:19 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <alpine.DEB.2.11.1510271036470.3394@tvnag.unkk.fr>
X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id
 t9R9eXPf000944
X-Mailman-Approved-At: Tue, 27 Oct 2015 12:54:09 +0100
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id t9RBsBJD018492



On 10/27/2015 10:37 AM, Daniel Stenberg wrote:
> On Tue, 27 Oct 2015, Salvador Fandiño wrote:
>
>> If I am understanding libssh2 code correctly, libssh2_keepalive_send
>> can not work reliably in non-blocking mode as it converts
>> LIBSSH2_ERROR_SOCKET_EAGAIN errors from _libssh2_transport_send into
>> LIBSSH2_ERROR_SOCKET_SEND and leaves the transport layer in an
>> inconsistent state.
>>
>> In other words, if you call libssh2_keepalive_send and for any reason
>> the keep-alive packet can not be immediately delivered, the connection
>> becomes corrupted.
>
> Isn't that just a bug we should fix?

yes!



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

From libssh2-devel-bounces@cool.haxx.se  Tue Oct 27 14:46:15 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9RDjqks013647;
	Tue, 27 Oct 2015 14:46:07 +0100
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9RDjoSJ012771
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Tue, 27 Oct 2015 14:45:50 +0100
Received: from localhost (dast@localhost)
 by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id t9RDjnmM012727
 for <libssh2-devel@cool.haxx.se>; Tue, 27 Oct 2015 14:45:49 +0100
X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs
Date: Tue, 27 Oct 2015 14:45:49 +0100 (CET)
From: Daniel Stenberg <daniel@haxx.se>
X-X-Sender: dast@giant.haxx.se
To: libssh2 development <libssh2-devel@cool.haxx.se>
Subject: Re: [PATCH] add function libssh2_session_set_last_error
In-Reply-To: <2084627.YWy7ANUtQo@kdudka.brq.redhat.com>
Message-ID: <alpine.DEB.2.11.1510271442510.3394@tvnag.unkk.fr>
References: <mvoicf$oj6$1@ger.gmane.org>
 <alpine.DEB.2.11.1510261026240.3394@tvnag.unkk.fr>
 <20151026124635.6757.qmail@stuge.se>
 <2084627.YWy7ANUtQo@kdudka.brq.redhat.com>
User-Agent: Alpine 2.11 (DEB 23 2013-08-11)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id t9RDjqks013647

On Mon, 26 Oct 2015, Kamil Dudka wrote:

> If git.libssh2.org is intended to be a mirror of the upstream git repo at 
> github, it should only contain commits already pushed to github and nothing 
> else.  Additionally, already pushed commits should not be rewritten.
>
> If git.libssh2.org is intended to be a staging repository for your work, it 
> should be clearly marked such (e.g. by using a separate branch for that 
> while keeping the master branch synced with github).

I agree completely. As it is now, saying we merge new code into thay git repo 
will probably make some people think it was merged into our master repo, which 
it isn't.

What about renaming it to a name that makes it sound less official and more 
like a staging/experimental git repo?

-- 

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

From libssh2-devel-bounces@cool.haxx.se  Tue Oct 27 21:17:07 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9RKGmdN023529;
	Tue, 27 Oct 2015 21:17:04 +0100
Received: from mail-qg0-x232.google.com (mail-qg0-x232.google.com
 [IPv6:2607:f8b0:400d:c04::232])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9RKGkO8023410
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Tue, 27 Oct 2015 21:16:46 +0100
Received: by qgad10 with SMTP id d10so155156971qga.3
 for <libssh2-devel@cool.haxx.se>; Tue, 27 Oct 2015 13:16:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:from:date:message-id:subject:to:content-type;
 bh=MiNc/qmBDZ+1ebhNzTLPcnBtAiopq/LIZid9Pw3+WOQ=;
 b=uidVb8zV9WUxcci2/gIZYmoC7WN+1ijtlrONJ6iz7+VJnMjEMFdm2WnVgqCeHYuUAP
 ehIIre8X8rb1QsreZgPWKv6NF84H4adUu+uuA5tF57wLs50lXvzJd5SUOGgI1SZQyaQH
 V6gu8XL4NoWC/WGecSU3q6Fz3S/zJFaTvVMnlgQHb6mDbp5fI4nToIGUKOL5gLPmliRC
 ju3D5Vw/xOmVwGnsQ4rahqxGzFmmD047uzj7q9oVVQweQS5/QKIjpdWlQ0OUPWskEEdt
 kwC/TAhYKKG5N7Ku0DXxyiWBdEsaDy6SdmAeiqh/L31bfkSeqJ2qmVj9BcYmpNyNQDCw
 vXbQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=llamas_org.20150623.gappssmtp.com; s=20150623;
 h=mime-version:sender:from:date:message-id:subject:to:content-type;
 bh=MiNc/qmBDZ+1ebhNzTLPcnBtAiopq/LIZid9Pw3+WOQ=;
 b=CcU+3Pp0QwL2+fST+TVt0xR4Rx2xQ/USys7GXEhtMYB98unAvlQ6fs/7CLYrF0u37a
 pVSDWWLYpa8l5rome2MlU4EYPsVESkey6Yw5TQU9Oem5qVJNE7XfAdKOMv7EwbRY8SwQ
 6eI5oYJgzud66YYRmErNfjhUjoWLQCogWaATUeC9tN3uNyqEwwl3p13FVAECuf6qlBoN
 hMF6yIZZ1Leqr+dGl2e0fSXI9B4tVUx1HHlfZrJdT7vEONw6OW0o/5+JBcMj9hwNASgj
 2EYF3mt19DwoWJ6T4U177G7daH5mkQzvSUkdp1rUxW4cJ9/oGbKDsYheesY2QGHhyKE5
 v9uQ==
X-Received: by 10.140.104.97 with SMTP id z88mr28914221qge.56.1445977001377;
 Tue, 27 Oct 2015 13:16:41 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.140.86.105 with HTTP; Tue, 27 Oct 2015 13:16:22 -0700 (PDT)
From: George Nachman <gnachman@llamas.org>
Date: Tue, 27 Oct 2015 13:16:22 -0700
X-Google-Sender-Auth: Yx2T7id5a4jmGd542qV80spF8Is
Message-ID: <CAB5Rqo=BpR6pcKV+FVfK5Hkdk8+n-s7ZfKhEQrkG1ONsO1ng9Q@mail.gmail.com>
Subject: Key exchange methods
To: libssh2-devel@cool.haxx.se
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: multipart/mixed; boundary="===============1243093853=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>

--===============1243093853==
Content-Type: multipart/alternative; boundary=001a11354c8485453405231bc1a2

--001a11354c8485453405231bc1a2
Content-Type: text/plain; charset=UTF-8

I see that libssh2 supports the following key exchange methods:

diffie-hellman-group1-sha1
diffie-hellman-group14-sha1
diffie-hellman-group-exchange-sha1

I had a user of my application complain that he couldn't connect to his
server because it doesn't support any of these methods. Are there plans to
add any non-DH methods? I see a bunch of others that BSD's sshd supports:

curve25519-sha256@libssh.org
diffie-hellman-group1-sha1
diffie-hellman-group14-sha1
diffie-hellman-group-exchange-sha1
diffie-hellman-group-exchange-sha256
ecdh-sha2-nistp256
ecdh-sha2-nistp384
ecdh-sha2-nistp521


Thanks,
George

--001a11354c8485453405231bc1a2
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I see that libssh2 supports the following key exchange met=
hods:<div><br></div><div><div>diffie-hellman-group1-sha1</div><div>diffie-h=
ellman-group14-sha1<br></div><div>diffie-hellman-group-exchange-sha1<br></d=
iv></div><div><br></div><div>I had a user of my application complain that h=
e couldn&#39;t connect to his server because it doesn&#39;t support any of =
these methods. Are there plans to add any non-DH methods? I see a bunch of =
others that BSD&#39;s sshd supports:</div><div><br></div><div><div><a href=
=3D"mailto:curve25519-sha256@libssh.org">curve25519-sha256@libssh.org</a></=
div><div>diffie-hellman-group1-sha1</div><div>diffie-hellman-group14-sha1</=
div><div>diffie-hellman-group-exchange-sha1</div><div>diffie-hellman-group-=
exchange-sha256</div><div>ecdh-sha2-nistp256</div><div>ecdh-sha2-nistp384</=
div><div>ecdh-sha2-nistp521</div></div><div><br></div><div><br></div><div>T=
hanks,</div><div>George</div></div>

--001a11354c8485453405231bc1a2--

--===============1243093853==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--===============1243093853==--

From libssh2-devel-bounces@cool.haxx.se  Wed Oct 28 20:10:34 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9SJA8Qt019094;
	Wed, 28 Oct 2015 20:10:30 +0100
Received: from mail-oi0-x230.google.com (mail-oi0-x230.google.com
 [IPv6:2607:f8b0:4003:c06::230])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9SJA76p018924
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Wed, 28 Oct 2015 20:10:07 +0100
Received: by oies66 with SMTP id s66so10656718oie.1
 for <libssh2-devel@cool.haxx.se>; Wed, 28 Oct 2015 12:10:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=idbsUn+qPhqQj3HuMBZwgxMmfjFrBlvz1l8AcefFLs4=;
 b=DGb6CV10fztnFd+0UDuDgur0XcIgmDlQPK/C32MgpAGqSRAoYsJ2h313hynhVxdyGB
 9ruCMJcbesO55H4ohdcxAMDOITUEa7w+XJ0WoIAH4Z6+6WN0Ee4jghTNj7NJ9gKiFnKa
 Wpbqpr7rZSfxS0GcIzy63VchojN2tvez+exJdNQNvd9RKB+9kGdaClXBp4GnhMzzgnJW
 y/J7MkppPF9yKS+j+gblhkrc12qt1AqHbF9ScEZ4XTQoN7b3xqt9e8h9jVdF/4tmF8Yo
 uMw5u2/ygiC4SLglLd9E2TkHP8UBe/dRUePyF260Due2bgVI2soNrcRNj9ar/WI088CH
 A1CA==
MIME-Version: 1.0
X-Received: by 10.202.175.129 with SMTP id y123mr32609666oie.22.1446059402819; 
 Wed, 28 Oct 2015 12:10:02 -0700 (PDT)
Received: by 10.76.74.40 with HTTP; Wed, 28 Oct 2015 12:10:02 -0700 (PDT)
In-Reply-To: <562F4683.20505@gmail.com>
References: <CAHwNr4GJjmS5wT9sBMtWciTP4QoUfv0q88d6+LVKhRwY94yGdA@mail.gmail.com>
 <562F3E45.1070309@gmail.com>
 <alpine.DEB.2.11.1510271036470.3394@tvnag.unkk.fr>
 <562F4683.20505@gmail.com>
Date: Wed, 28 Oct 2015 12:10:02 -0700
Message-ID: <CAHwNr4F6jrD86fQHp=FPWWr042+rnt=7n0yxRG3PjVETbx6d+A@mail.gmail.com>
Subject: Re: How to structure code for multiple sessions with async API
From: Sanchay Harneja <sanchay.h@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
Cc: libssh2 development
 <public-libssh2-devel-nuDYylZla2DMSbncWqzJgw@plane.gmane.org>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: multipart/mixed; boundary="===============1190480814=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>

--===============1190480814==
Content-Type: multipart/alternative; boundary=001a113ce9d8077ea205232ef1b3

--001a113ce9d8077ea205232ef1b3
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Just wanted to clarify - is it okay to call libssh2_keepalive_send() after
the channel is closed?

On Tue, Oct 27, 2015 at 2:40 AM, Salvador Fandi=C3=B1o <sfandino@gmail.com>
wrote:

>
>
> On 10/27/2015 10:37 AM, Daniel Stenberg wrote:
>
>> On Tue, 27 Oct 2015, Salvador Fandi=C3=B1o wrote:
>>
>> If I am understanding libssh2 code correctly, libssh2_keepalive_send
>>> can not work reliably in non-blocking mode as it converts
>>> LIBSSH2_ERROR_SOCKET_EAGAIN errors from _libssh2_transport_send into
>>> LIBSSH2_ERROR_SOCKET_SEND and leaves the transport layer in an
>>> inconsistent state.
>>>
>>> In other words, if you call libssh2_keepalive_send and for any reason
>>> the keep-alive packet can not be immediately delivered, the connection
>>> becomes corrupted.
>>>
>>
>> Isn't that just a bug we should fix?
>>
>
> yes!
>
>
>
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>

--001a113ce9d8077ea205232ef1b3
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Just wanted to clarify - is it okay to call libssh2_keepal=
ive_send() after the channel is closed?</div><div class=3D"gmail_extra"><br=
><div class=3D"gmail_quote">On Tue, Oct 27, 2015 at 2:40 AM, Salvador Fandi=
=C3=B1o <span dir=3D"ltr">&lt;<a href=3D"mailto:sfandino@gmail.com" target=
=3D"_blank">sfandino@gmail.com</a>&gt;</span> wrote:<br><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><span class=3D""><br>
<br>
On 10/27/2015 10:37 AM, Daniel Stenberg wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
On Tue, 27 Oct 2015, Salvador Fandi=C3=B1o wrote:<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
If I am understanding libssh2 code correctly, libssh2_keepalive_send<br>
can not work reliably in non-blocking mode as it converts<br>
LIBSSH2_ERROR_SOCKET_EAGAIN errors from _libssh2_transport_send into<br>
LIBSSH2_ERROR_SOCKET_SEND and leaves the transport layer in an<br>
inconsistent state.<br>
<br>
In other words, if you call libssh2_keepalive_send and for any reason<br>
the keep-alive packet can not be immediately delivered, the connection<br>
becomes corrupted.<br>
</blockquote>
<br>
Isn&#39;t that just a bug we should fix?<br>
</blockquote>
<br></span>
yes!<br>
<br>
<br>
<br>
_______________________________________________<br>
libssh2-devel <a href=3D"http://cool.haxx.se/cgi-bin/mailman/listinfo/libss=
h2-devel" rel=3D"noreferrer" target=3D"_blank">http://cool.haxx.se/cgi-bin/=
mailman/listinfo/libssh2-devel</a><br>
</blockquote></div><br></div>

--001a113ce9d8077ea205232ef1b3--

--===============1190480814==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--===============1190480814==--

From libssh2-devel-bounces@cool.haxx.se  Wed Oct 28 20:37:43 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9SJbb2I009244;
	Wed, 28 Oct 2015 20:37:42 +0100
Received: from plane.gmane.org (plane.gmane.org [80.91.229.3])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9SJbZwO009187
 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Wed, 28 Oct 2015 20:37:35 +0100
Received: from public by plane.gmane.org with local (Exim 4.69)
 (envelope-from <public@plane.gmane.org>) id 1ZrWXN-000519-N4
 for libssh2-devel@cool.haxx.se; Wed, 28 Oct 2015 20:37:33 +0100
Received: from public by plane.gmane.org with local (Exim 4.69)
 (envelope-from <sanchay.h@gmail.com>) id 1ZrWXG-0004wW-TR
 for public-libssh2-devel-nuDYylZla2DMSbncWqzJgw@plane.gmane.org;
 Wed, 28 Oct 2015 20:37:26 +0100
Received: from mail-oi0-f50.google.com ([209.85.218.50])
 by plane.gmane.org with esmtp (Exim 4.69)
 (envelope-from <sanchay.h@gmail.com>) id 1ZrW6m-0005xD-0x
 for public-libssh2-devel-nuDYylZla2DMSbncWqzJgw@plane.gmane.org;
 Wed, 28 Oct 2015 20:10:04 +0100
Received: by oiao187 with SMTP id o187so10622939oia.3
 for <public-libssh2-devel-nuDYylZla2DMSbncWqzJgw@plane.gmane.org>;
 Wed, 28 Oct 2015 12:10:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=idbsUn+qPhqQj3HuMBZwgxMmfjFrBlvz1l8AcefFLs4=;
 b=DGb6CV10fztnFd+0UDuDgur0XcIgmDlQPK/C32MgpAGqSRAoYsJ2h313hynhVxdyGB
 9ruCMJcbesO55H4ohdcxAMDOITUEa7w+XJ0WoIAH4Z6+6WN0Ee4jghTNj7NJ9gKiFnKa
 Wpbqpr7rZSfxS0GcIzy63VchojN2tvez+exJdNQNvd9RKB+9kGdaClXBp4GnhMzzgnJW
 y/J7MkppPF9yKS+j+gblhkrc12qt1AqHbF9ScEZ4XTQoN7b3xqt9e8h9jVdF/4tmF8Yo
 uMw5u2/ygiC4SLglLd9E2TkHP8UBe/dRUePyF260Due2bgVI2soNrcRNj9ar/WI088CH
 A1CA==
MIME-Version: 1.0
X-Received: by 10.202.175.129 with SMTP id y123mr32609666oie.22.1446059402819; 
 Wed, 28 Oct 2015 12:10:02 -0700 (PDT)
Received: by 10.76.74.40 with HTTP; Wed, 28 Oct 2015 12:10:02 -0700 (PDT)
In-Reply-To: <562F4683.20505@gmail.com>
References: <CAHwNr4GJjmS5wT9sBMtWciTP4QoUfv0q88d6+LVKhRwY94yGdA@mail.gmail.com>
 <562F3E45.1070309@gmail.com>
 <alpine.DEB.2.11.1510271036470.3394@tvnag.unkk.fr>
 <562F4683.20505@gmail.com>
Date: Wed, 28 Oct 2015 12:10:02 -0700
Message-ID: <CAHwNr4F6jrD86fQHp=FPWWr042+rnt=7n0yxRG3PjVETbx6d+A@mail.gmail.com>
Subject: Re: How to structure code for multiple sessions with async API
From: Sanchay Harneja <sanchay.h@gmail.com>
To: libssh2 development <libssh2-devel@cool.haxx.se>
X-TMDA-Confirmed: Wed, 28 Oct 2015 20:37:26 +0100
Cc: libssh2 development
 <public-libssh2-devel-nuDYylZla2DMSbncWqzJgw@plane.gmane.org>
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: multipart/mixed; boundary="===============0135434934=="
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>




--===============0135434934==
Content-Type: multipart/alternative; boundary=001a113ce9d8077ea205232ef1b3




--001a113ce9d8077ea205232ef1b3
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Just wanted to clarify - is it okay to call libssh2_keepalive_send() after
the channel is closed?

On Tue, Oct 27, 2015 at 2:40 AM, Salvador Fandi=C3=B1o <sfandino@gmail.com>
wrote:

>
>
> On 10/27/2015 10:37 AM, Daniel Stenberg wrote:
>
>> On Tue, 27 Oct 2015, Salvador Fandi=C3=B1o wrote:
>>
>> If I am understanding libssh2 code correctly, libssh2_keepalive_send
>>> can not work reliably in non-blocking mode as it converts
>>> LIBSSH2_ERROR_SOCKET_EAGAIN errors from _libssh2_transport_send into
>>> LIBSSH2_ERROR_SOCKET_SEND and leaves the transport layer in an
>>> inconsistent state.
>>>
>>> In other words, if you call libssh2_keepalive_send and for any reason
>>> the keep-alive packet can not be immediately delivered, the connection
>>> becomes corrupted.
>>>
>>
>> Isn't that just a bug we should fix?
>>
>
> yes!
>
>
>
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>

--001a113ce9d8077ea205232ef1b3
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Just wanted to clarify - is it okay to call libssh2_keepal=
ive_send() after the channel is closed?</div><div class=3D"gmail_extra"><br=
><div class=3D"gmail_quote">On Tue, Oct 27, 2015 at 2:40 AM, Salvador Fandi=
=C3=B1o <span dir=3D"ltr">&lt;<a href=3D"mailto:sfandino@gmail.com" target=
=3D"_blank">sfandino@gmail.com</a>&gt;</span> wrote:<br><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><span class=3D""><br>
<br>
On 10/27/2015 10:37 AM, Daniel Stenberg wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
On Tue, 27 Oct 2015, Salvador Fandi=C3=B1o wrote:<br>
<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
If I am understanding libssh2 code correctly, libssh2_keepalive_send<br>
can not work reliably in non-blocking mode as it converts<br>
LIBSSH2_ERROR_SOCKET_EAGAIN errors from _libssh2_transport_send into<br>
LIBSSH2_ERROR_SOCKET_SEND and leaves the transport layer in an<br>
inconsistent state.<br>
<br>
In other words, if you call libssh2_keepalive_send and for any reason<br>
the keep-alive packet can not be immediately delivered, the connection<br>
becomes corrupted.<br>
</blockquote>
<br>
Isn&#39;t that just a bug we should fix?<br>
</blockquote>
<br></span>
yes!<br>
<br>
<br>
<br>
_______________________________________________<br>
libssh2-devel <a href=3D"http://cool.haxx.se/cgi-bin/mailman/listinfo/libss=
h2-devel" rel=3D"noreferrer" target=3D"_blank">http://cool.haxx.se/cgi-bin/=
mailman/listinfo/libssh2-devel</a><br>
</blockquote></div><br></div>

--001a113ce9d8077ea205232ef1b3--



--===============0135434934==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KbGlic3NoMi1k
ZXZlbCBodHRwOi8vY29vbC5oYXh4LnNlL2NnaS1iaW4vbWFpbG1hbi9saXN0aW5mby9saWJzc2gy
LWRldmVsCg==

--===============0135434934==--


From libssh2-devel-bounces@cool.haxx.se  Fri Oct 30 09:08:10 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9U87n9h021505;
	Fri, 30 Oct 2015 09:08:07 +0100
Received: from plane.gmane.org (plane.gmane.org [80.91.229.3])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9U86SOx017321
 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Fri, 30 Oct 2015 09:06:28 +0100
Received: from public by plane.gmane.org with local (Exim 4.69)
 (envelope-from <public@plane.gmane.org>) id 1Zs4hd-0008Gz-Gc
 for libssh2-devel@cool.haxx.se; Fri, 30 Oct 2015 09:06:25 +0100
Received: from smtp.qindel.com ([89.140.90.34] helo=thor.qindel.com)
 by plane.gmane.org with esmtp (Exim 4.69)
 (envelope-from <sfandino@gmail.com>) id 1Zs4hW-00085D-61
 for public-libssh2-devel-nuDYylZla2DMSbncWqzJgw@plane.gmane.org;
 Fri, 30 Oct 2015 09:06:18 +0100
Received: from localhost (localhost [127.0.0.1])
 by thor.qindel.com (Postfix) with ESMTP id 2C39B6051E
 for <libssh2-devel-nuDYylZla2DMSbncWqzJgw@public.gmane.org>;
 Fri, 30 Oct 2015 09:06:16 +0100 (CET)
Received: from thor.qindel.com ([127.0.0.1])
 by localhost (thor.qindel.com [127.0.0.1]) (amavisd-new, port 10032)
 with ESMTP id RibeY87hac5Q
 for <libssh2-devel-nuDYylZla2DMSbncWqzJgw@public.gmane.org>;
 Fri, 30 Oct 2015 09:06:15 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
 by thor.qindel.com (Postfix) with ESMTP id 966E86056D
 for <libssh2-devel-nuDYylZla2DMSbncWqzJgw@public.gmane.org>;
 Fri, 30 Oct 2015 09:06:15 +0100 (CET)
X-Virus-Scanned: amavisd-new at thor.qindel.com
Received: from thor.qindel.com ([127.0.0.1])
 by localhost (thor.qindel.com [127.0.0.1]) (amavisd-new, port 10026)
 with ESMTP id UozOkbKbk_5C
 for <libssh2-devel-nuDYylZla2DMSbncWqzJgw@public.gmane.org>;
 Fri, 30 Oct 2015 09:06:15 +0100 (CET)
Received: from [192.168.20.42] (unknown [92.56.141.104])
 by thor.qindel.com (Postfix) with ESMTPSA id BF9DE6051E
 for <libssh2-devel-nuDYylZla2DMSbncWqzJgw@public.gmane.org>;
 Fri, 30 Oct 2015 09:06:14 +0100 (CET)
Subject: Re: How to structure code for multiple sessions with async API
To: libssh2 development
 <public-libssh2-devel-nuDYylZla2DMSbncWqzJgw@plane.gmane.org>
References: <CAHwNr4GJjmS5wT9sBMtWciTP4QoUfv0q88d6+LVKhRwY94yGdA@mail.gmail.com>
 <562F3E45.1070309@gmail.com>
 <alpine.DEB.2.11.1510271036470.3394@tvnag.unkk.fr> <562F4683.20505@gmail.com>
 <CAHwNr4F6jrD86fQHp=FPWWr042+rnt=7n0yxRG3PjVETbx6d+A@mail.gmail.com>
From: =?UTF-8?Q?Salvador_Fandi=c3=b1o?= <sfandino@gmail.com>
Message-ID: <563324F5.9040702@gmail.com>
Date: Fri, 30 Oct 2015 09:06:13 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <CAHwNr4F6jrD86fQHp=FPWWr042+rnt=7n0yxRG3PjVETbx6d+A@mail.gmail.com>
X-Mailman-Approved-At: Fri, 30 Oct 2015 09:07:47 +0100
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id t9U87n9h021505



On 10/28/2015 08:10 PM, Sanchay Harneja wrote:
> Just wanted to clarify - is it okay to call libssh2_keepalive_send()
> after the channel is closed?

keep-alives are not related to channels, they are a session thing. So, 
as long as the connection is established, you can send them.

Calling libssh2_keepalive_send() is probably safe as long as the session 
object remains allocated.

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

From libssh2-devel-bounces@cool.haxx.se  Fri Oct 30 09:46:24 2015
Return-Path: <libssh2-devel-bounces@cool.haxx.se>
Received: from www.haxx.se (localhost.localdomain [127.0.0.1])
	by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9U8kEqK022338;
	Fri, 30 Oct 2015 09:46:23 +0100
Received: from giant.haxx.se (localhost.localdomain [127.0.0.1])
 by giant.haxx.se (8.14.4/8.14.4/Debian-7) with ESMTP id t9U8kBA0022293
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT)
 for <libssh2-devel@cool.haxx.se>; Fri, 30 Oct 2015 09:46:11 +0100
Received: from localhost (dast@localhost)
 by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id t9U8kBZk022289
 for <libssh2-devel@cool.haxx.se>; Fri, 30 Oct 2015 09:46:11 +0100
X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs
Date: Fri, 30 Oct 2015 09:46:11 +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: Key exchange methods
In-Reply-To: <CAB5Rqo=BpR6pcKV+FVfK5Hkdk8+n-s7ZfKhEQrkG1ONsO1ng9Q@mail.gmail.com>
Message-ID: <alpine.DEB.2.11.1510300945190.10227@tvnag.unkk.fr>
References: <CAB5Rqo=BpR6pcKV+FVfK5Hkdk8+n-s7ZfKhEQrkG1ONsO1ng9Q@mail.gmail.com>
User-Agent: Alpine 2.11 (DEB 23 2013-08-11)
X-fromdanielhimself: yes
MIME-Version: 1.0
X-BeenThere: libssh2-devel@cool.haxx.se
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: libssh2 development <libssh2-devel.cool.haxx.se>
List-Unsubscribe: <http://cool.haxx.se/cgi-bin/mailman/options/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=unsubscribe>
List-Archive: <http://cool.haxx.se/pipermail/libssh2-devel/>
List-Post: <mailto:libssh2-devel@cool.haxx.se>
List-Help: <mailto:libssh2-devel-request@cool.haxx.se?subject=help>
List-Subscribe: <http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel>, 
 <mailto:libssh2-devel-request@cool.haxx.se?subject=subscribe>
Reply-To: libssh2 development <libssh2-devel@cool.haxx.se>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: libssh2-devel-bounces@cool.haxx.se
Sender: "libssh2-devel" <libssh2-devel-bounces@cool.haxx.se>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id t9U8kEqK022338

On Tue, 27 Oct 2015, George Nachman wrote:

> I had a user of my application complain that he couldn't connect to his 
> server because it doesn't support any of these methods. Are there plans to 
> add any non-DH methods? I see a bunch of others that BSD's sshd supports:
>
> curve25519-sha256@libssh.org
> diffie-hellman-group1-sha1
> diffie-hellman-group14-sha1
> diffie-hellman-group-exchange-sha1
> diffie-hellman-group-exchange-sha256
> ecdh-sha2-nistp256
> ecdh-sha2-nistp384
> ecdh-sha2-nistp521

Feel free to implement any or all of these and send patches. I doubt anyone 
will be against merging support for them.

-- 

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

