From libssh2-devel-bounces@cool.haxx.se Mon Oct 3 19:21:44 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p93HLJW8011602; Mon, 3 Oct 2011 19:21:39 +0200 Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p93HLGLM011534 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 3 Oct 2011 19:21:17 +0200 Received: by vcbf13 with SMTP id f13so3918729vcb.41 for ; Mon, 03 Oct 2011 10:21:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=HpZ8PIEm6wqB0yKL/M/Ibwi8s/S7LcN40WwdNnfpnCM=; b=dR7IbG6ci0XMVdU9mDxUvTX6r7yLlxmfDs1BVyospZmQepMhQyI+0OmaX+SMMoPmLy 8RNRHLVIngv5UhqupfP77eOL8i5yKHIuKv6s369J2uq446A4YTQuzUmF0/0z9rncj8UK phGVUnTGv7q2erNgWBpWaA5qGatkJVTcfmSx4= MIME-Version: 1.0 Received: by 10.52.21.10 with SMTP id r10mr178586vde.287.1317662471346; Mon, 03 Oct 2011 10:21:11 -0700 (PDT) Received: by 10.52.160.193 with HTTP; Mon, 3 Oct 2011 10:21:11 -0700 (PDT) Date: Mon, 3 Oct 2011 10:21:11 -0700 X-Google-Sender-Auth: S4YKJH-hhs_CEhMSlhh407CEPjY Message-ID: Subject: internal poll doesn't handle orderly shut down (read/recv returns 0 bytes) = 100% CPU From: Pavel Strashkin To: libssh2 development X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Mon, 03 Oct 2011 19:21:43 +0200 (CEST) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [80.67.6.50]); Mon, 03 Oct 2011 19:21:17 +0200 (CEST) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Hello guys, I'm working with libssh2 (the latest stable build) using Net::SSH2 Perl binding. It uses internal libssh2 poll helper with a 250ms timeout. When orderly shut down is occurred (open connection, run some long-running task, kill/stop/whatever ssh on the server while the task is running), poll helper starts to consume all available CPU. I've reviewed the code and found that there is no check for return value of read/recv function when you're reading from channel (not session). When zero bytes are read - session should be marked as closed or sort of. As result it does as much do/while iterations as it can within N timeout. In a documentation i saw that you're going to deprecate that poll helpers, but right now it's still in use and we should fix as long as we can. Thank you for the great library! _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 3 20:10:24 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p93IADPl016713; Mon, 3 Oct 2011 20:10:23 +0200 Received: from giant.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p93IABmf016700 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 3 Oct 2011 20:10:11 +0200 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id p93IABFO016696 for ; Mon, 3 Oct 2011 20:10:11 +0200 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Mon, 3 Oct 2011 20:10:11 +0200 (CEST) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: internal poll doesn't handle orderly shut down (read/recv returns 0 bytes) = 100% CPU In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-fromdanielhimself: yes MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Mon, 03 Oct 2011 20:10:24 +0200 (CEST) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Mon, 03 Oct 2011 20:10:11 +0200 (CEST) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On Mon, 3 Oct 2011, Pavel Strashkin wrote: > I'm working with libssh2 (the latest stable build) using Net::SSH2 Perl > binding. It uses internal libssh2 poll helper with a 250ms timeout. What is this "internal libssh2 poll helper" exactly? -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 3 20:20:30 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p93IKNed023488; Mon, 3 Oct 2011 20:20:29 +0200 Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p93IKKvX023458 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 3 Oct 2011 20:20:21 +0200 Received: by vws11 with SMTP id 11so3984889vws.41 for ; Mon, 03 Oct 2011 11:20:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=HZqlNHA1gd7rowLKDd/DCbRVd9KOoCcInp7JKtixDSo=; b=KklF3tpAOaf+5k8oYlS4ZdYGx7La1tlIbIXAVQ1l26Yd+xqC09dH+Uw9z6cR+DPqKu aIXDltMu2gn1KR4WdMm3ge0RBWrZjZsCawjSXVirdxZWS4+n5k2vZZrL6BLaq3BVfUna lPwQUpJoLbvAf0Z3+EaBLPeGfFpoyvdaoRVUc= MIME-Version: 1.0 Received: by 10.52.115.4 with SMTP id jk4mr237789vdb.488.1317666016217; Mon, 03 Oct 2011 11:20:16 -0700 (PDT) Received: by 10.52.160.193 with HTTP; Mon, 3 Oct 2011 11:20:16 -0700 (PDT) In-Reply-To: References: Date: Mon, 3 Oct 2011 11:20:16 -0700 X-Google-Sender-Auth: qefi3cZqQ2Uzba7LXhlGyKzozx0 Message-ID: Subject: Re: internal poll doesn't handle orderly shut down (read/recv returns 0 bytes) = 100% CPU From: Pavel Strashkin To: libssh2 development X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Mon, 03 Oct 2011 20:20:30 +0200 (CEST) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [80.67.6.50]); Mon, 03 Oct 2011 20:20:21 +0200 (CEST) X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p93IKKvX023458 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p93IKNed023488 file: src/session.c, function: libssh2_poll, with defined HAVE_POLL (it uses poll instead of select) ==BEG== 1598 case LIBSSH2_POLLFD_SOCKET: 1599 fds[i].revents = sockets[i].revents; 1600 sockets[i].revents = 0; /* In case we loop again, be nice */ 1601 if (fds[i].revents) { 1602 active_fds++; 1603 } 1604 break; 1605 case LIBSSH2_POLLFD_CHANNEL: 1606 if (sockets[i].events & POLLIN) { 1607 /* Spin session until no data available */ 1608 while (_libssh2_transport_read(fds[i].fd.channel->session) 1609 > 0); 1610 } 1611 if (sockets[i].revents & POLLHUP) { 1612 fds[i].revents |= 1613 LIBSSH2_POLLFD_CHANNEL_CLOSED | 1614 LIBSSH2_POLLFD_SESSION_CLOSED; 1615 } 1616 sockets[i].revents = 0; 1617 break; ==END== What it does, it goes to "case LIBSSH2_POLLFD_CHANNEL" branch because i'm reading from a channel, does some work and doesn't increase active_fds counter so do/while loop waits for N timeout. In subject case the poll call always returns POLLIN event, but read/recv call always returns 0. 2011/10/3 Daniel Stenberg : > On Mon, 3 Oct 2011, Pavel Strashkin wrote: > >> I'm working with libssh2 (the latest stable build) using Net::SSH2 Perl >> binding. It uses internal libssh2 poll helper with a 250ms timeout. > > What is this "internal libssh2 poll helper" exactly? > > -- > >  / daniel.haxx.se > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 3 22:41:29 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p93Kf9mH015115; Mon, 3 Oct 2011 22:41:25 +0200 Received: from giant.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p93Kf83U015104 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 3 Oct 2011 22:41:08 +0200 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id p93Kf8is015099 for ; Mon, 3 Oct 2011 22:41:08 +0200 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Mon, 3 Oct 2011 22:41:08 +0200 (CEST) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: internal poll doesn't handle orderly shut down (read/recv returns 0 bytes) = 100% CPU In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-fromdanielhimself: yes MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Mon, 03 Oct 2011 22:41:29 +0200 (CEST) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Mon, 03 Oct 2011 22:41:08 +0200 (CEST) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On Mon, 3 Oct 2011, Pavel Strashkin wrote: > file: src/session.c, function: libssh2_poll, with defined HAVE_POLL (it uses > poll instead of select) The man page says: "This function is deprecated" Due to this, I've not bothered to fix it in the past but if someone does provide a patch that improves it I guess it could still be worthwhile to apply it as long as the function remains... -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 3 22:55:38 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p93KtVOr024148; Mon, 3 Oct 2011 22:55:38 +0200 Received: from mail-dy0-f54.google.com (mail-dy0-f54.google.com [209.85.220.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p93KtUxq024039 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 3 Oct 2011 22:55:30 +0200 Received: by dyj4 with SMTP id 4so154271dyj.41 for ; Mon, 03 Oct 2011 13:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=NAf9o09nblsLRfN2kOst34Sz921g31hoXCdCCVC6CM8=; b=PZFLSE9t+DY8wzVnJBiOKrmifF0blPbP2ySjhJU20NJ+jdwBkGU9DbyoAW+kifBwqy yG5opI+VzFKbc9+zFrBxH8QIi9xPq4+R2MSxTdz28IOEP23dtXeuIa1r1NwBJ42dx+Z8 vxhlr8vI4W1Wd2LMW45GqgGQO2MVk1dLDey4U= Received: by 10.223.45.18 with SMTP id c18mr483642faf.86.1317675325126; Mon, 03 Oct 2011 13:55:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.104.1 with HTTP; Mon, 3 Oct 2011 13:54:54 -0700 (PDT) In-Reply-To: References: From: Steven Ayre Date: Mon, 3 Oct 2011 21:54:54 +0100 Message-ID: Subject: Re: internal poll doesn't handle orderly shut down (read/recv returns 0 bytes) = 100% CPU To: libssh2 development X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Mon, 03 Oct 2011 22:55:38 +0200 (CEST) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [80.67.6.50]); Mon, 03 Oct 2011 22:55:30 +0200 (CEST) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0916035987==" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --===============0916035987== Content-Type: multipart/alternative; boundary=001517476940aef9e504ae6b3120 --001517476940aef9e504ae6b3120 Content-Type: text/plain; charset=ISO-8859-1 Are you referring to libssh2_poll, or Net:SSH2->poll which uses libssh2_poll? (Or both?) -Steve On 3 October 2011 21:41, Daniel Stenberg wrote: > On Mon, 3 Oct 2011, Pavel Strashkin wrote: > > file: src/session.c, function: libssh2_poll, with defined HAVE_POLL (it >> uses poll instead of select) >> > > The man page says: "This function is deprecated" > > Due to this, I've not bothered to fix it in the past but if someone does > provide a patch that improves it I guess it could still be worthwhile to > apply it as long as the function remains... > > > -- > > / daniel.haxx.se > ______________________________**_________________ > libssh2-devel http://cool.haxx.se/cgi-bin/**mailman/listinfo/libssh2-devel > --001517476940aef9e504ae6b3120 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Are you referring to libssh2_poll, or Net:SSH2->poll which uses libssh2_= poll? (Or both?)

-Steve


On 3 O= ctober 2011 21:41, Daniel Stenberg <daniel@haxx.se> wrote:
On Mon, 3 Oct 2011, Pavel= Strashkin wrote:

file: src/session.c, function: libssh2_poll, with defined HAVE_POLL (it use= s poll instead of select)

The man page says: "This function is deprecated"

Due to this, I've not bothered to fix it in the past but if someone doe= s provide a patch that improves it I guess it could still be worthwhile to = apply it as long as the function remains...


--

=A0/ daniel.haxx.se=
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/list= info/libssh2-devel

--001517476940aef9e504ae6b3120-- --===============0916035987== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --===============0916035987==-- From libssh2-devel-bounces@cool.haxx.se Mon Oct 3 23:00:45 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p93L0crS029716; Mon, 3 Oct 2011 23:00:45 +0200 Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p93L0ZYb029447 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 3 Oct 2011 23:00:36 +0200 Received: by vws11 with SMTP id 11so4187686vws.41 for ; Mon, 03 Oct 2011 14:00:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=JvrDbEomq6UycdoSRNeeVhoKn57TqW2JH1AMgRo118Y=; b=xCVYHFp+42lvo6wInzCufmqdu5eSSI5vvPPwEdNir9P2ljYTIK/mefygIoHebPhXPf W8TgnGnHqnPX9SfSGYdAvj+PKEJHMJfFaZ/liC44jJxD8EW5mf9mUdWPgrlYxptNMMqs WpClUiOh0PMgwr7pVQibQ9zTD0TGEfXXH0EJ0= MIME-Version: 1.0 Received: by 10.52.90.116 with SMTP id bv20mr450843vdb.86.1317675630505; Mon, 03 Oct 2011 14:00:30 -0700 (PDT) Received: by 10.52.160.193 with HTTP; Mon, 3 Oct 2011 14:00:30 -0700 (PDT) In-Reply-To: References: Date: Mon, 3 Oct 2011 14:00:30 -0700 X-Google-Sender-Auth: sfz3aRV6UJFKkvWdB0Ucv8Urewo Message-ID: Subject: Re: internal poll doesn't handle orderly shut down (read/recv returns 0 bytes) = 100% CPU From: Pavel Strashkin To: libssh2 development X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Mon, 03 Oct 2011 23:00:45 +0200 (CEST) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [80.67.6.50]); Mon, 03 Oct 2011 23:00:37 +0200 (CEST) X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p93L0ZYb029447 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p93L0crS029716 I'm referring to libssh2_poll. 2011/10/3 Steven Ayre : > Are you referring to libssh2_poll, or Net:SSH2->poll which uses > libssh2_poll? (Or both?) > > -Steve > > > On 3 October 2011 21:41, Daniel Stenberg wrote: >> >> On Mon, 3 Oct 2011, Pavel Strashkin wrote: >> >>> file: src/session.c, function: libssh2_poll, with defined HAVE_POLL (it >>> uses poll instead of select) >> >> The man page says: "This function is deprecated" >> >> Due to this, I've not bothered to fix it in the past but if someone does >> provide a patch that improves it I guess it could still be worthwhile to >> apply it as long as the function remains... >> >> -- >> >>  / daniel.haxx.se >> _______________________________________________ >> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > > > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 3 23:03:33 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p93L3SHd002648; Mon, 3 Oct 2011 23:03:32 +0200 Received: from giant.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p93L3QQH002632 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 3 Oct 2011 23:03:26 +0200 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id p93L3QOe002628 for ; Mon, 3 Oct 2011 23:03:26 +0200 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Mon, 3 Oct 2011 23:03:26 +0200 (CEST) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: internal poll doesn't handle orderly shut down (read/recv returns 0 bytes) = 100% CPU In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-fromdanielhimself: yes MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Mon, 03 Oct 2011 23:03:33 +0200 (CEST) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Mon, 03 Oct 2011 23:03:26 +0200 (CEST) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On Mon, 3 Oct 2011, Pavel Strashkin wrote: > I'm referring to libssh2_poll. So did I. -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Tue Oct 4 17:32:04 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p94FVdQh010813; Tue, 4 Oct 2011 17:31:59 +0200 Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p94FVbxx010796 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 4 Oct 2011 17:31:37 +0200 Received: by eyg7 with SMTP id 7so705046eyg.41 for ; Tue, 04 Oct 2011 08:31:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=psNcARv2XRfwiNFvRCYkr76VdbRRiypFEX1XI8w0afk=; b=veFhrNJRYTujSQUk1S7Mf3SKPkWXkv5kMS2YvMcCvpW0FaE4nlpLJeM5rLb7Uet4ZS Si/zB8nGC+cZSFitg03ftZjc0salS50zBgq52wJRCn6DSoeX2GjcpMB8ZSU2FXS3oa8q fvt3gAyaTR+COL4aAUtyKtJqD6j7xzKInT/lA= Received: by 10.223.31.151 with SMTP id y23mr1924314fac.48.1317742292112; Tue, 04 Oct 2011 08:31:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.104.1 with HTTP; Tue, 4 Oct 2011 08:31:02 -0700 (PDT) In-Reply-To: References: From: Steven Ayre Date: Tue, 4 Oct 2011 16:31:02 +0100 Message-ID: Subject: Re: internal poll doesn't handle orderly shut down (read/recv returns 0 bytes) = 100% CPU To: libssh2 development X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Tue, 04 Oct 2011 17:32:03 +0200 (CEST) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [80.67.6.50]); Tue, 04 Oct 2011 17:31:37 +0200 (CEST) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1207391184==" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --===============1207391184== Content-Type: multipart/alternative; boundary=0015174783643a179e04ae7ac98d --0015174783643a179e04ae7ac98d Content-Type: text/plain; charset=ISO-8859-1 Ok. I was just wondering whether Net::SSH2 should be updated if it's still using a depreciated function. -Steve On 3 October 2011 22:03, Daniel Stenberg wrote: > On Mon, 3 Oct 2011, Pavel Strashkin wrote: > > I'm referring to libssh2_poll. >> > > So did I. > > > -- > > / daniel.haxx.se > ______________________________**_________________ > libssh2-devel http://cool.haxx.se/cgi-bin/**mailman/listinfo/libssh2-devel > --0015174783643a179e04ae7ac98d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Ok. I was just wondering whether Net::SSH2 should be updated if it's st= ill using a depreciated function.

-Steve


On 3 October 2011 22:03, Daniel Stenberg <<= a href=3D"mailto:daniel@haxx.se">daniel@haxx.se> wrote:
On Mon, 3 Oct 2011, Pavel= Strashkin wrote:

I'm referring to libssh2_poll.

So did I.


--

=A0/ daniel.haxx.se=
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/list= info/libssh2-devel

--0015174783643a179e04ae7ac98d-- --===============1207391184== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --===============1207391184==-- From libssh2-devel-bounces@cool.haxx.se Tue Oct 4 22:12:12 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p94KBnVJ006741; Tue, 4 Oct 2011 22:12:08 +0200 Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p94KBmiq006731 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 4 Oct 2011 22:11:48 +0200 Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1]) by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id p94KBlSZ005274 for ; Tue, 4 Oct 2011 20:11:49 GMT Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged)) by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id p94KBjdL021899 for ; Tue, 4 Oct 2011 22:11:45 +0200 Subject: Re: internal poll doesn't handle orderly shut down (read/recv returns 0 bytes) = 100% CPU From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= To: libssh2 development Date: Tue, 04 Oct 2011 22:11:45 +0200 In-Reply-To: References: X-Mailer: Evolution 3.0.3 (3.0.3-1.fc15) Message-ID: <1317759105.21826.0.camel@henriknordstrom.net> Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Tue, 04 Oct 2011 22:12:12 +0200 (CEST) X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.9 (giant.haxx.se [IPv6:2a00:1a28:1200:9::2]); Tue, 04 Oct 2011 22:11:48 +0200 (CEST) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]); Tue, 04 Oct 2011 20:11:50 +0000 (UTC) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Yes. tis 2011-10-04 klockan 16:31 +0100 skrev Steven Ayre: > Ok. I was just wondering whether Net::SSH2 should be updated if it's > still using a depreciated function. > > -Steve > > > On 3 October 2011 22:03, Daniel Stenberg wrote: > On Mon, 3 Oct 2011, Pavel Strashkin wrote: > > > I'm referring to libssh2_poll. > > > So did I. > > > > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Wed Oct 5 23:24:13 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p95LNiDE021445; Wed, 5 Oct 2011 23:24:07 +0200 Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p95LNfXU021361 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 5 Oct 2011 23:23:42 +0200 Received: by vws11 with SMTP id 11so2278074vws.41 for ; Wed, 05 Oct 2011 14:23:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=zKjhVCM9ONT7VZqTwRkwpcYWbkLFmj35hsMI09Yj3kw=; b=Q1eV2DKd5/oLDU2KSGJTmLe6fbgEuQETTMuKT9IzNON59HGeQf96s57TaTAi9w2/JS Itm2BAE/hEWxfVS4cySCx9MR9UCcOsrOEZfDp9DcwdMYmHYtfAaQp0QetD0JCmRD922k aMvQvYgu++CzJFw0p8shtbO7gqiLkKmw5Oawc= MIME-Version: 1.0 Received: by 10.52.28.68 with SMTP id z4mr2092860vdg.287.1317849816924; Wed, 05 Oct 2011 14:23:36 -0700 (PDT) Received: by 10.52.160.193 with HTTP; Wed, 5 Oct 2011 14:23:36 -0700 (PDT) Date: Wed, 5 Oct 2011 14:23:36 -0700 X-Google-Sender-Auth: u-gPKnJvJfeSInb0NuuYAHTmf0s Message-ID: Subject: How do i know that process has completed? From: Pavel Strashkin To: libssh2 development X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Wed, 05 Oct 2011 23:24:13 +0200 (CEST) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [80.67.6.50]); Wed, 05 Oct 2011 23:23:42 +0200 (CEST) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Hello, 1. For an example i'm trying to create a directory or whatever. I create session, channel, do exec ("mkdir ...").What is the best way to know that command has completed and exit_status is ready to be read? 2. Is there any way to read stdout/stderr separately? Thank you! _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Wed Oct 5 23:27:15 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p95LRCkl023851; Wed, 5 Oct 2011 23:27:15 +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-2) with SMTP id p95LRBIg023839 for ; Wed, 5 Oct 2011 23:27:11 +0200 Received: (qmail 12266 invoked by uid 501); 5 Oct 2011 21:27:12 -0000 Message-ID: <20111005212712.12265.qmail@stuge.se> Date: Wed, 5 Oct 2011 23:27:12 +0200 From: Peter Stuge To: libssh2-devel@cool.haxx.se Subject: Re: How do i know that process has completed? Mail-Followup-To: libssh2-devel@cool.haxx.se References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Wed, 05 Oct 2011 23:27:15 +0200 (CEST) X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.9 (giant.haxx.se [80.67.6.50]); Wed, 05 Oct 2011 23:27:11 +0200 (CEST) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Pavel Strashkin wrote: > What is the best way to know that command has completed and > exit_status is ready to be read? libssh2_channel_eof() > 2. Is there any way to read stdout/stderr separately? libssh2_channel_read() reads stdout libssh2_channel_read_stderr() guess what ;) //Peter _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Wed Oct 5 23:42:59 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p95Lgmwa003722; Wed, 5 Oct 2011 23:42:59 +0200 Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p95Lgkfr003693 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 5 Oct 2011 23:42:47 +0200 Received: by vws11 with SMTP id 11so2295336vws.41 for ; Wed, 05 Oct 2011 14:42:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=hb6DOA/nlHCM/6ZuddZPF3DSmEjLo8+jKChM9c/Wj9c=; b=WtXFASDPEiC50TJfbfp5uYTfSYRyPDRuoxaoMnnGVdHxcjMOJ4VRYuSZYGtHJUCXyh kE0fDFtc6MB7MYyc/v0huX4hgLSSUqAuYfLqEjHK3t8RwP0Ekoqd98/70UU+uZegQlF+ EKTb3E/TZQ8AirAVq+31UPzJjBQvNIOQiPCW0= MIME-Version: 1.0 Received: by 10.52.115.4 with SMTP id jk4mr3029262vdb.488.1317850962778; Wed, 05 Oct 2011 14:42:42 -0700 (PDT) Received: by 10.52.160.193 with HTTP; Wed, 5 Oct 2011 14:42:42 -0700 (PDT) In-Reply-To: <20111005212712.12265.qmail@stuge.se> References: <20111005212712.12265.qmail@stuge.se> Date: Wed, 5 Oct 2011 14:42:42 -0700 X-Google-Sender-Auth: IZ1WuEAhB_MAHsWcwI5x3pa9Nxc Message-ID: Subject: Re: How do i know that process has completed? From: Pavel Strashkin To: libssh2 development X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Wed, 05 Oct 2011 23:42:59 +0200 (CEST) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [80.67.6.50]); Wed, 05 Oct 2011 23:42:47 +0200 (CEST) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Am i correct that libssh2_channel_eof should be used with libssh2_channel_read? i.e. without reading from a channel EOF will never be received. 2011/10/5 Peter Stuge : > Pavel Strashkin wrote: >> What is the best way to know that command has completed and >> exit_status is ready to be read? > > libssh2_channel_eof() > > >> 2. Is there any way to read stdout/stderr separately? > > libssh2_channel_read() reads stdout > libssh2_channel_read_stderr() guess what ;) > > > //Peter > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Wed Oct 5 23:45:30 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p95LjR7j005333; Wed, 5 Oct 2011 23:45:30 +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-2) with SMTP id p95LjQ1A005326 for ; Wed, 5 Oct 2011 23:45:26 +0200 Received: (qmail 14784 invoked by uid 501); 5 Oct 2011 21:45:28 -0000 Message-ID: <20111005214528.14783.qmail@stuge.se> Date: Wed, 5 Oct 2011 23:45:28 +0200 From: Peter Stuge To: libssh2-devel@cool.haxx.se Subject: Re: How do i know that process has completed? Mail-Followup-To: libssh2-devel@cool.haxx.se References: <20111005212712.12265.qmail@stuge.se> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Wed, 05 Oct 2011 23:45:30 +0200 (CEST) X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.9 (giant.haxx.se [80.67.6.50]); Wed, 05 Oct 2011 23:45:26 +0200 (CEST) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Pavel Strashkin wrote: > Am i correct that libssh2_channel_eof should be used with > libssh2_channel_read? i.e. without reading from a channel EOF will > never be received. Well, EOF may have been received, but libssh2 will not tell you until you have also read all data from both stdout and stderr. //Peter _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Wed Oct 5 23:52:20 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p95LqGbm008110; Wed, 5 Oct 2011 23:52:20 +0200 Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p95LqDcf008083 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 5 Oct 2011 23:52:14 +0200 Received: by vcbf13 with SMTP id f13so2319147vcb.41 for ; Wed, 05 Oct 2011 14:52:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=b/bhOGDxumjBNAPwUa3h+WiPr6iP4/UTFu0cZFWT680=; b=d/uMjHLqrrxP87WH9dKMpwFPj+6POasgR1hVXzEgJqyhA4fiyektPpRTSX5PVuFLM2 6Mht5Rbnhb39nUIRSonFPw+qvN8SOLIgtM4fbwsFySOfI9r+Y8aALh4t7Zlboyr2CKBU AZFO8h7YxSgdVMVHSwtlk4/VHDjO4P6pshtNM= MIME-Version: 1.0 Received: by 10.52.33.3 with SMTP id n3mr2876383vdi.354.1317851529554; Wed, 05 Oct 2011 14:52:09 -0700 (PDT) Received: by 10.52.160.193 with HTTP; Wed, 5 Oct 2011 14:52:09 -0700 (PDT) In-Reply-To: <20111005214528.14783.qmail@stuge.se> References: <20111005212712.12265.qmail@stuge.se> <20111005214528.14783.qmail@stuge.se> Date: Wed, 5 Oct 2011 14:52:09 -0700 X-Google-Sender-Auth: 6L-cWokor8Ug1KdE75jjSVKJk40 Message-ID: Subject: Re: How do i know that process has completed? From: Pavel Strashkin To: libssh2 development X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Wed, 05 Oct 2011 23:52:20 +0200 (CEST) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [80.67.6.50]); Wed, 05 Oct 2011 23:52:14 +0200 (CEST) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Oh, so, for an example, if some application prints to stdout and stderr both, and i'm reading _only_ from stdout (and waiting for EOF), i can get stuck just because there is a data in stderr and i have to read it, but i don't? 2011/10/5 Peter Stuge : > Pavel Strashkin wrote: >> Am i correct that libssh2_channel_eof should be used with >> libssh2_channel_read? i.e. without reading from a channel EOF will >> never be received. > > Well, EOF may have been received, but libssh2 will not tell you until > you have also read all data from both stdout and stderr. > > > //Peter > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Wed Oct 5 23:57:46 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p95LveFb010544; Wed, 5 Oct 2011 23:57:46 +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-2) with SMTP id p95Lvcwg010540 for ; Wed, 5 Oct 2011 23:57:38 +0200 Received: (qmail 16430 invoked by uid 501); 5 Oct 2011 21:57:40 -0000 Message-ID: <20111005215740.16429.qmail@stuge.se> Date: Wed, 5 Oct 2011 23:57:40 +0200 From: Peter Stuge To: libssh2-devel@cool.haxx.se Subject: Re: How do i know that process has completed? Mail-Followup-To: libssh2-devel@cool.haxx.se References: <20111005212712.12265.qmail@stuge.se> <20111005214528.14783.qmail@stuge.se> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Wed, 05 Oct 2011 23:57:46 +0200 (CEST) X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.9 (giant.haxx.se [80.67.6.50]); Wed, 05 Oct 2011 23:57:39 +0200 (CEST) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Pavel Strashkin wrote: > Oh, so, for an example, if some application prints to stdout and > stderr both, and i'm reading _only_ from stdout (and waiting for EOF), > i can get stuck just because there is a data in stderr and i have to > read it, but i don't? Yes. //Peter _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Thu Oct 6 00:06:58 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p95M6px3018493; Thu, 6 Oct 2011 00:06:57 +0200 Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p95M6nsv018471 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Thu, 6 Oct 2011 00:06:49 +0200 Received: by bkbzs8 with SMTP id zs8so3083442bkb.41 for ; Wed, 05 Oct 2011 15:06:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=xSr0Qo4WTA/O+4CCsAS9AmTzQNu9+Vit3FShRuTV6nA=; b=n7t7SpzDwY7Bn0J0yc1bd8Nm30Dh8ONxIzSrCG+6BHTww+pYoFOqqUPVk4kR1Ew1PY tt7PCKlE4PG1D1yKlrHx+IaIOekyBiZ5pLnHk4zhrsJ4+qOTI9z/SCR3KUkpUcBCzDWP LDj3m0JDKL1oErgGXrdf0v/ML7qn/alj1B+DY= Received: by 10.204.132.210 with SMTP id c18mr3343bkt.0.1317852406198; Wed, 05 Oct 2011 15:06:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.104.1 with HTTP; Wed, 5 Oct 2011 15:06:16 -0700 (PDT) In-Reply-To: <20111005215740.16429.qmail@stuge.se> References: <20111005212712.12265.qmail@stuge.se> <20111005214528.14783.qmail@stuge.se> <20111005215740.16429.qmail@stuge.se> From: Steven Ayre Date: Wed, 5 Oct 2011 23:06:16 +0100 Message-ID: Subject: Re: How do i know that process has completed? To: libssh2 development X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Thu, 06 Oct 2011 00:06:58 +0200 (CEST) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [80.67.6.50]); Thu, 06 Oct 2011 00:06:50 +0200 (CEST) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Pavel, You can however choose to do a nonblocking read and then read from both stdout and stderr. That'll return immediately if no data is available so you won't get stuck on a read from stdout if there's no data available. libssh2_poll() can let you know that there's stdout(IN) and stderr (EXT) data available, and that the command has finished (CHANNEL_CLOSED). It's depreciated now though. It seems the new idea is to do a select() or poll() on the socket, then do a nonblocking read of both stdout and stderr. Can someone clarify if that's correct please? -Steve On 5 October 2011 22:57, Peter Stuge wrote: > Pavel Strashkin wrote: >> Oh, so, for an example, if some application prints to stdout and >> stderr both, and i'm reading _only_ from stdout (and waiting for EOF), >> i can get stuck just because there is a data in stderr and i have to >> read it, but i don't? > > Yes. > > > //Peter > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Thu Oct 6 00:15:20 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p95MFDxY021908; Thu, 6 Oct 2011 00:15:18 +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-2) with SMTP id p95MFBk7021888 for ; Thu, 6 Oct 2011 00:15:11 +0200 Received: (qmail 18887 invoked by uid 501); 5 Oct 2011 22:15:13 -0000 Message-ID: <20111005221513.18886.qmail@stuge.se> Date: Thu, 6 Oct 2011 00:15:13 +0200 From: Peter Stuge To: libssh2-devel@cool.haxx.se Subject: Re: How do i know that process has completed? Mail-Followup-To: libssh2-devel@cool.haxx.se References: <20111005212712.12265.qmail@stuge.se> <20111005214528.14783.qmail@stuge.se> <20111005215740.16429.qmail@stuge.se> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Thu, 06 Oct 2011 00:15:20 +0200 (CEST) X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.9 (giant.haxx.se [80.67.6.50]); Thu, 06 Oct 2011 00:15:11 +0200 (CEST) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Steven Ayre wrote: > It seems the new idea is to do a select() or poll() on the socket, > then do a nonblocking read of both stdout and stderr. Can someone > clarify if that's correct please? This is the only way it works yes. See example/direct_tcpip.c for an example of how this can look. (This also considers another socket in the same select() call.) //Peter _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Thu Oct 13 02:09:22 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9D08sml024940; Thu, 13 Oct 2011 02:09:16 +0200 Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9D08qWS024914 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Thu, 13 Oct 2011 02:08:53 +0200 Received: by vws11 with SMTP id 11so1399712vws.41 for ; Wed, 12 Oct 2011 17:08:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=McuHrpY8IJds2nabvM9om82r21NPj70/WZ/hyCfEurM=; b=xOPZHvrA1TUJfRiiIzhXMCyETCqZcqICZNynuhMB5kosmGkPHA5tAfWTl9/MdktFWd hqfSrLrualpVZTpjSZ0oh6uu/BLIfkcG28WWYaEjmPqFe/MT4F/IMDYvHZ5r2uqPPVbc 2smAfFaW5yn2tvfomEB0xa2ClZWUEnJG9kiIE= MIME-Version: 1.0 Received: by 10.52.184.103 with SMTP id et7mr1453944vdc.35.1318464528339; Wed, 12 Oct 2011 17:08:48 -0700 (PDT) Received: by 10.52.33.225 with HTTP; Wed, 12 Oct 2011 17:08:48 -0700 (PDT) In-Reply-To: <1317759105.21826.0.camel@henriknordstrom.net> References: <1317759105.21826.0.camel@henriknordstrom.net> Date: Wed, 12 Oct 2011 17:08:48 -0700 X-Google-Sender-Auth: kEnQVIHk6xVf89314Fejpq1GFaQ Message-ID: Subject: Re: internal poll doesn't handle orderly shut down (read/recv returns 0 bytes) = 100% CPU From: Pavel Strashkin To: libssh2 development X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Thu, 13 Oct 2011 02:09:22 +0200 (CEST) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [80.67.6.50]); Thu, 13 Oct 2011 02:08:53 +0200 (CEST) X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9D08qWS024914 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9D08sml024940 I don't want to open a new topic so i'll ask here. libssh2 has 2 entities: session and channel, but only channel has "eof" or "disconnected" states. I don't see something similar for session. The question then is how could i know that session is closed without creating a channel? As i understand, when libssh2 does low-level reading (read or recv call) on file handle, it doesn't store information about read/recv returned zero bytes (connection closed) or errno value so such information can't be used by libssh2 user. 2011/10/4 Henrik Nordström : > Yes. > > tis 2011-10-04 klockan 16:31 +0100 skrev Steven Ayre: >> Ok. I was just wondering whether Net::SSH2 should be updated if it's >> still using a depreciated function. >> >> -Steve >> >> >> On 3 October 2011 22:03, Daniel Stenberg wrote: >>         On Mon, 3 Oct 2011, Pavel Strashkin wrote: >> >> >>                 I'm referring to libssh2_poll. >> >> >>         So did I. >> >> >> >>         _______________________________________________ >>         libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel >> >> > > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Thu Oct 13 04:56:36 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9D2uN83030634; Thu, 13 Oct 2011 04:56:34 +0200 Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9D2stYj029823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 13 Oct 2011 04:54:55 +0200 Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1]) by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id p9D2srec005437 for ; Thu, 13 Oct 2011 02:54:55 GMT Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged)) by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id p9D2sqYP022123 for ; Thu, 13 Oct 2011 04:54:52 +0200 Subject: Re: How to detect ssh session shutdown From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= To: libssh2 development Date: Thu, 13 Oct 2011 04:54:52 +0200 In-Reply-To: References: <1317759105.21826.0.camel@henriknordstrom.net> X-Mailer: Evolution 3.0.3 (3.0.3-1.fc15) Message-ID: <1318474492.21382.11.camel@henriknordstrom.net> Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.9 (giant.haxx.se [127.0.0.1]); Thu, 13 Oct 2011 04:56:36 +0200 (CEST) X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.3.9 (giant.haxx.se [IPv6:2a00:1a28:1200:9::2]); Thu, 13 Oct 2011 04:54:55 +0200 (CEST) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]); Thu, 13 Oct 2011 02:54:55 +0000 (UTC) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se ons 2011-10-12 klockan 17:08 -0700 skrev Pavel Strashkin: > I don't want to open a new topic so i'll ask here. Better to open a new topic when asing a new question. > libssh2 has 2 entities: session and channel, but only channel has > "eof" or "disconnected" states. I don't see something similar for > session. The question then is how could i know that session is closed > without creating a channel? Normally you always open a channel immediately after the session have been established. libssh2 currently do not support I/O activity on an idle session (i.e. between auth and initial channel request) in a clean manner. How to detect session close depends on where you are in the SSH sequence - Inital handshake, libssh2_session_handshake - auth, libssh2_userauth_... (method dependent) - channel, using channel I/O primitives or wrappers - closing, libssh2_session_disconnect which all returns errors if the transport socket got unexpectedly closed. > As i understand, when libssh2 does low-level reading (read or recv > call) on file handle, it doesn't store information about read/recv > returned zero bytes (connection closed) or errno value so such > information can't be used by libssh2 user. It stores it's own representation of these. The lowlevel transport details is if very little relevance to the user of libssh2. Regards Henrik _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Fri Oct 14 02:21:38 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9E0LHbp029272; Fri, 14 Oct 2011 02:21:33 +0200 Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9E0LEH1029005 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Fri, 14 Oct 2011 02:21:15 +0200 Received: by vws11 with SMTP id 11so614682vws.41 for ; Thu, 13 Oct 2011 17:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=oCQnlN1RYETMwAUbilRc8+BFvNt/g0cNiwi4rJc5Ft4=; b=kEu/yip/HNsPyXG62ffipcJ7AGiB2tBmmnO2nHWpZarTrCJkdG5vWjSV79K9RpqkbW +W4bRYctonytKH6LTAB4lKrXb5ODTZpoA7XgWqMqEDw65ZRHs4qE3XyYmjNmw19HyNyE ef2VrToxudlgsoGnGC6w/bktvbmdZQeicdsBI= MIME-Version: 1.0 Received: by 10.52.187.199 with SMTP id fu7mr6242687vdc.109.1318551669194; Thu, 13 Oct 2011 17:21:09 -0700 (PDT) Received: by 10.52.158.33 with HTTP; Thu, 13 Oct 2011 17:21:09 -0700 (PDT) Date: Thu, 13 Oct 2011 17:21:09 -0700 X-Google-Sender-Auth: UT6YnD66-cZrsKRT3NCiXKrhDAw Message-ID: Subject: libssh2_channel_close/libssh2_channel_free hangs if you execute long-running command From: Pavel Strashkin To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Hello folks, There is the commands like iostat or mpstat which can be run for a long time (useful for gathering statistics from remote servers). The commands support [interval] parameter. Every [interval] seconds they print some data which means nothing happens for [interval] seconds. Here we go. I read first block of data, then command "sleeps" for a [interval] seconds, i do libssh2_channel_close or libssh2_channel_free, and it hangs for [interval] seconds. I can't close channel or session graceful. As a workaround i do close on a socket directly before closing channel/session. Thank you! _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Fri Oct 14 03:50:09 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9E1nrtQ000825; Fri, 14 Oct 2011 03:50:07 +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-2) with SMTP id p9E1noc2000819 for ; Fri, 14 Oct 2011 03:49:51 +0200 Received: (qmail 24240 invoked by uid 501); 14 Oct 2011 01:49:51 -0000 Message-ID: <20111014014951.24239.qmail@stuge.se> Date: Fri, 14 Oct 2011 03:49:51 +0200 From: Peter Stuge To: libssh2-devel@cool.haxx.se Subject: Re: libssh2_channel_close/libssh2_channel_free hangs if you execute long-running command Mail-Followup-To: libssh2-devel@cool.haxx.se References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Pavel Strashkin wrote: > Here we go. I read first block of data, then command "sleeps" for a > [interval] seconds, i do libssh2_channel_close or > libssh2_channel_free, and it hangs for [interval] seconds. I can't > close channel or session graceful. Of course not, when the remote program still has the channel open? > As a workaround i do close on a socket directly before closing > channel/session. A proper solution would of course be to first kill the remote program. Maybe you will not bother. //Peter _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Fri Oct 14 04:28:33 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9E2SM8F024218; Fri, 14 Oct 2011 04:28:32 +0200 Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9E2SJN6024106 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Fri, 14 Oct 2011 04:28:20 +0200 Received: by vws11 with SMTP id 11so688398vws.41 for ; Thu, 13 Oct 2011 19:28:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=SEnrDr9b4pHtHyJp+ywhFZKpVT3PySKATCijlTV6X44=; b=tszRjqIyu85Etsd2jCyzNo2c9LAaRe3UIk9JEV9LZWnPoBkQiEvouHBYYRRh7dOn5z DnewSuWc5ziCenTFha6qhQ7Sig4pw+32YPAhdlgM43yuntU4iG8kwrq/6ZxlpVB/RiEd Aj+oCF0w8P/5uQFNizelZ7EirTH+/1K/DoVkE= MIME-Version: 1.0 Received: by 10.52.20.174 with SMTP id o14mr6732996vde.7.1318559294639; Thu, 13 Oct 2011 19:28:14 -0700 (PDT) Received: by 10.52.158.33 with HTTP; Thu, 13 Oct 2011 19:28:14 -0700 (PDT) In-Reply-To: <20111014014951.24239.qmail@stuge.se> References: <20111014014951.24239.qmail@stuge.se> Date: Thu, 13 Oct 2011 19:28:14 -0700 X-Google-Sender-Auth: D3Z1YhgJn4uv2NLtY3Z2MqHFxes Message-ID: Subject: Re: libssh2_channel_close/libssh2_channel_free hangs if you execute long-running command From: Pavel Strashkin To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se > Of course not, when the remote program still has the channel open? Remote or local doesn't matter. It's just a pipe. I can close (should be able) it at any time. Actually, channel is closed after [interval] seconds. The question is why it waits for anything to read before closing. Be patient. After [seconds] program is still running. In theory libssh2 would hang forever, but it doesn't. > A proper solution would of course be to first kill the remote > program. Maybe you will not bother. I don't mind to do it, but i don't have necessary tools. There is no kill or similar function in a library. I don't mind to use the close call directly either. I reported just because i think it's unexpectable behavior and people should know about it. 2011/10/13 Peter Stuge : > Pavel Strashkin wrote: >> Here we go. I read first block of data, then command "sleeps" for a >> [interval] seconds, i do libssh2_channel_close or >> libssh2_channel_free, and it hangs for [interval] seconds. I can't >> close channel or session graceful. > > Of course not, when the remote program still has the channel open? > > >> As a workaround i do close on a socket directly before closing >> channel/session. > > A proper solution would of course be to first kill the remote > program. Maybe you will not bother. > > > //Peter > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Fri Oct 14 05:48:41 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9E3mOrm031850; Fri, 14 Oct 2011 05:48:38 +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-2) with SMTP id p9E3mNe8031843 for ; Fri, 14 Oct 2011 05:48:23 +0200 Received: (qmail 8494 invoked by uid 501); 14 Oct 2011 03:48:23 -0000 Message-ID: <20111014034823.8493.qmail@stuge.se> Date: Fri, 14 Oct 2011 05:48:23 +0200 From: Peter Stuge To: libssh2-devel@cool.haxx.se Subject: Re: libssh2_channel_close/libssh2_channel_free hangs if you execute long-running command Mail-Followup-To: libssh2-devel@cool.haxx.se References: <20111014014951.24239.qmail@stuge.se> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Pavel Strashkin wrote: > > Of course not, when the remote program still has the channel open? > > Remote or local doesn't matter. It's just a pipe. It is certainly not a pipe; it is an SSH channel. Please read up on the SSH RFCs to learn the details of channels. > Actually, channel is closed after [interval] seconds. The question > is why it waits for anything to read before closing. Well - maybe you can find out? > > A proper solution would of course be to first kill the remote > > program. Maybe you will not bother. > > I don't mind to do it, but i don't have necessary tools. There is no > kill or similar function in a library. Please send a patch for libssh2 that adds support for sending signals. //Peter _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Fri Oct 14 08:40:30 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9E6eB88028516; Fri, 14 Oct 2011 08:40:28 +0200 Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9E6e9OB028471 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 14 Oct 2011 08:40:09 +0200 Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1]) by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id p9E6e8l7018039 for ; Fri, 14 Oct 2011 06:40:09 GMT Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged)) by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id p9E6e7UM027701 for ; Fri, 14 Oct 2011 08:40:07 +0200 Subject: Re: libssh2_channel_close/libssh2_channel_free hangs if you execute long-running command From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= To: libssh2 development Date: Fri, 14 Oct 2011 08:40:07 +0200 In-Reply-To: <20111014014951.24239.qmail@stuge.se> References: <20111014014951.24239.qmail@stuge.se> X-Mailer: Evolution 3.0.3 (3.0.3-1.fc15) Message-ID: <1318574407.13277.6.camel@henriknordstrom.net> Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]); Fri, 14 Oct 2011 06:40:09 +0000 (UTC) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se fre 2011-10-14 klockan 03:49 +0200 skrev Peter Stuge: > Pavel Strashkin wrote: > > Here we go. I read first block of data, then command "sleeps" for a > > [interval] seconds, i do libssh2_channel_close or > > libssh2_channel_free, and it hangs for [interval] seconds. I can't > > close channel or session graceful. > > Of course not, when the remote program still has the channel open? Can it after a CLOSE? (not EOF) Regards Henrik _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Fri Oct 14 19:07:19 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9EH6ud1012402; Fri, 14 Oct 2011 19:07:16 +0200 Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9EH6rYd012365 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Fri, 14 Oct 2011 19:06:54 +0200 Received: by vcbfo13 with SMTP id fo13so1270433vcb.41 for ; Fri, 14 Oct 2011 10:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=W0zCvd2FM6edWqO5rrJbjNCY7YnSlDohgS8nghYYo+o=; b=bRoMVd7xFs4ZsxHNwggp8QSJQCupi+Wo7zG4RriOvL0+dfJwCSAV8BCWAUOmC6gWvk A3EfjwAFtn+nS/FWsZXrPzmiKyHdFn2Fh0FAhDeOHL4q4uw+hGFlpOQbcSYwOcpzxeG1 R9Md4DhJ+c+S11+aVHAl89pTYVyNA2Ve4P5qg= MIME-Version: 1.0 Received: by 10.52.23.239 with SMTP id p15mr9822969vdf.24.1318612008077; Fri, 14 Oct 2011 10:06:48 -0700 (PDT) Received: by 10.52.158.33 with HTTP; Fri, 14 Oct 2011 10:06:47 -0700 (PDT) In-Reply-To: <1318574407.13277.6.camel@henriknordstrom.net> References: <20111014014951.24239.qmail@stuge.se> <1318574407.13277.6.camel@henriknordstrom.net> Date: Fri, 14 Oct 2011 10:06:47 -0700 X-Google-Sender-Auth: uGJgd7vFn5P03N0BBIW_D7phgB0 Message-ID: Subject: Re: libssh2_channel_close/libssh2_channel_free hangs if you execute long-running command From: Pavel Strashkin To: libssh2 development X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9EH6rYd012365 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9EH6ud1012402 ===SSH Connection Protocol=== When either party wishes to terminate the channel, it sends SSH_MSG_CHANNEL_CLOSE. Upon receiving this message, a party MUST send back an SSH_MSG_CHANNEL_CLOSE unless it has already sent this message for the channel. The channel is considered closed for a party when it has both sent and received SSH_MSG_CHANNEL_CLOSE, and the party may then reuse the channel number. A party MAY send SSH_MSG_CHANNEL_CLOSE without having sent or received SSH_MSG_CHANNEL_EOF. ===SSH Connection Protocol=== The "terminate" word has the only meaning so i think it's a bug that libssh2 waits for next channel data after user has called libssh2_channel_close. The waiting period depends on how often the program uses stdout/stderr. If core developers agree with an issue i can spend my time for the further investigation of such behavior and making the patch. Implementation of signal's sending looks pretty easy. I can try to make it too if nobody is working on it already. 2011/10/13 Henrik Nordström : > fre 2011-10-14 klockan 03:49 +0200 skrev Peter Stuge: >> Pavel Strashkin wrote: >> > Here we go. I read first block of data, then command "sleeps" for a >> > [interval] seconds, i do libssh2_channel_close or >> > libssh2_channel_free, and it hangs for [interval] seconds. I can't >> > close channel or session graceful. >> >> Of course not, when the remote program still has the channel open? > > Can it after a CLOSE? (not EOF) > > Regards > Henrik > > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Fri Oct 14 21:58:18 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9EJw6GL003742; Fri, 14 Oct 2011 21:58:17 +0200 Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9EJw4pO003721 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 14 Oct 2011 21:58:04 +0200 Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1]) by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id p9EJw3q3019957 for ; Fri, 14 Oct 2011 19:58:05 GMT Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged)) by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id p9EJw2QD019821 for ; Fri, 14 Oct 2011 21:58:02 +0200 Subject: Re: libssh2_channel_close/libssh2_channel_free hangs if you execute long-running command From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= To: libssh2 development Date: Fri, 14 Oct 2011 21:58:02 +0200 In-Reply-To: References: <20111014014951.24239.qmail@stuge.se> <1318574407.13277.6.camel@henriknordstrom.net> X-Mailer: Evolution 3.0.3 (3.0.3-1.fc15) Message-ID: <1318622282.8310.2.camel@henriknordstrom.net> Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]); Fri, 14 Oct 2011 19:58:06 +0000 (UTC) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se fre 2011-10-14 klockan 10:06 -0700 skrev Pavel Strashkin: > The "terminate" word has the only meaning so i think it's a bug that > libssh2 waits for next channel data after user has called > libssh2_channel_close. The waiting period depends on how often the > program uses stdout/stderr. It need to wait for the remote to respond to the close request, but that should be pretty much immediately. Regards Henrik _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Sat Oct 15 01:00:52 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9EN0VCe007608; Sat, 15 Oct 2011 01:00:49 +0200 Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9EN0Sa2007347 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Sat, 15 Oct 2011 01:00:29 +0200 Received: by vcbfo13 with SMTP id fo13so1633875vcb.41 for ; Fri, 14 Oct 2011 16:00:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=TjgKqMRVR2kxa3EnB5wmezsDvOdo3sHSZIJgXjNH40o=; b=kb9ngtkN5bwn01wJxl/xytOuPBVqntbI1OSkgtb0x50CeFFIDYqrlhQBZbbU9lcJko 66W+dttdOmjLNvoUppaTimTxIZSZJJh0fnwYPMt0Ag8S1tZvbBbCZpMNtxpTcfQyOTfO MvFGUy38QbH98KxwqY05tOdKsLHjTogRg9bKI= MIME-Version: 1.0 Received: by 10.52.28.211 with SMTP id d19mr10913329vdh.92.1318633224704; Fri, 14 Oct 2011 16:00:24 -0700 (PDT) Received: by 10.52.158.33 with HTTP; Fri, 14 Oct 2011 16:00:24 -0700 (PDT) In-Reply-To: <1318622282.8310.2.camel@henriknordstrom.net> References: <20111014014951.24239.qmail@stuge.se> <1318574407.13277.6.camel@henriknordstrom.net> <1318622282.8310.2.camel@henriknordstrom.net> Date: Fri, 14 Oct 2011 16:00:24 -0700 X-Google-Sender-Auth: WOjpYaUB0ZoJcNU790M2RjO3pFo Message-ID: Subject: Re: libssh2_channel_close/libssh2_channel_free hangs if you execute long-running command From: Pavel Strashkin To: libssh2 development X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9EN0Sa2007347 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9EN0VCe007608 OK, after really long investigation i've found the reason why it hangs. Now i'm not sure either client or server is the reason of that. The following stuff is happening. When "close" is received by server, it closes pipes (stdout, ...) connected to the program and waits for program termination. When pipe closed from one side, other side will get SIGPIPE signal when attempting to write, but...before each write it waits for [interval] seconds so that's why it hangs for the same time. I'm talking about iostat, mpstat. I think it should be documented very clearly in libssh2 docs for further users. The same happens for "eof" request. 2011/10/14 Henrik Nordström : > fre 2011-10-14 klockan 10:06 -0700 skrev Pavel Strashkin: > >> The "terminate" word has the only meaning so i think it's a bug that >> libssh2 waits for next channel data after user has called >> libssh2_channel_close. The waiting period depends on how often the >> program uses stdout/stderr. > > It need to wait for the remote to respond to the close request, but that > should be pretty much immediately. > > Regards > Henrik > > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Sat Oct 15 01:10:44 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9ENAdXO014994; Sat, 15 Oct 2011 01:10:44 +0200 Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9ENAbFJ014977 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Sat, 15 Oct 2011 01:10:38 +0200 Received: by vws11 with SMTP id 11so1696656vws.41 for ; Fri, 14 Oct 2011 16:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=5O1vfEZvikamZGs8gWS/Y3oFaecwy2mKm+3DqVxN0VM=; b=BJRBFFwnck/lXbjdJtyhxm7FpAb1NnU7d0gG8Nb+LjWK71QDu8rkrrzqhieCCh5QbU B2CpkXU70TChVE3ruMXofn+9ESyx9OLc/ZNXhgWATohjo10q8WbPhepf+q7cyorvQS4A SokvvGl6ubPHZcVNX+KmEuW3pSWMOfdttpTB8= MIME-Version: 1.0 Received: by 10.52.187.199 with SMTP id fu7mr10987104vdc.109.1318633833856; Fri, 14 Oct 2011 16:10:33 -0700 (PDT) Received: by 10.52.158.33 with HTTP; Fri, 14 Oct 2011 16:10:33 -0700 (PDT) In-Reply-To: References: <20111014014951.24239.qmail@stuge.se> <1318574407.13277.6.camel@henriknordstrom.net> <1318622282.8310.2.camel@henriknordstrom.net> Date: Fri, 14 Oct 2011 16:10:33 -0700 X-Google-Sender-Auth: Cln6FZfSCW8DhX-EIeoazcSOomE Message-ID: Subject: Re: libssh2_channel_close/libssh2_channel_free hangs if you execute long-running command From: Pavel Strashkin To: libssh2 development X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9ENAbFJ014977 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9ENAdXO014994 Actually, "close" should not be normally initiated by client side, only under some really unbelievable circumstances. I didn't know how it works so i had used it for "stop process" activity, but now i clearly understand that i should use signals for my case. I'm on my way in an integration of "signal" channel's message. 2011/10/14 Pavel Strashkin : > OK, after really long investigation i've found the reason why it > hangs. Now i'm not sure either client or server is the reason of that. > The following stuff is happening. When "close" is received by server, > it closes pipes (stdout, ...) connected to the program and waits for > program termination. When pipe closed from one side, other side will > get SIGPIPE signal when attempting to write, but...before each write > it waits for [interval] seconds so that's why it hangs for the same > time. I'm talking about iostat, mpstat. I think it should be > documented very clearly in libssh2 docs for further users. The same > happens for "eof" request. > > 2011/10/14 Henrik Nordström : >> fre 2011-10-14 klockan 10:06 -0700 skrev Pavel Strashkin: >> >>> The "terminate" word has the only meaning so i think it's a bug that >>> libssh2 waits for next channel data after user has called >>> libssh2_channel_close. The waiting period depends on how often the >>> program uses stdout/stderr. >> >> It need to wait for the remote to respond to the close request, but that >> should be pretty much immediately. >> >> Regards >> Henrik >> >> _______________________________________________ >> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel >> > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Sat Oct 15 01:40:50 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9ENeLvr027801; Sat, 15 Oct 2011 01:40:29 +0200 Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9ENeKOH027787 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 15 Oct 2011 01:40:20 +0200 Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1]) by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id p9ENeIcL020131 for ; Fri, 14 Oct 2011 23:40:21 GMT Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged)) by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id p9ENeGQ1002285 for ; Sat, 15 Oct 2011 01:40:16 +0200 Subject: Re: libssh2_channel_close/libssh2_channel_free hangs if you execute long-running command From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= To: libssh2 development Date: Sat, 15 Oct 2011 01:40:16 +0200 In-Reply-To: References: <20111014014951.24239.qmail@stuge.se> <1318574407.13277.6.camel@henriknordstrom.net> <1318622282.8310.2.camel@henriknordstrom.net> X-Mailer: Evolution 3.0.3 (3.0.3-1.fc15) Message-ID: <1318635616.27718.10.camel@henriknordstrom.net> Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]); Fri, 14 Oct 2011 23:40:21 +0000 (UTC) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se fre 2011-10-14 klockan 16:00 -0700 skrev Pavel Strashkin: > OK, after really long investigation i've found the reason why it > hangs. Now i'm not sure either client or server is the reason of that. > The following stuff is happening. When "close" is received by server, > it closes pipes (stdout, ...) connected to the program and waits for > program termination. When pipe closed from one side, other side will > get SIGPIPE signal when attempting to write, but...before each write > it waits for [interval] seconds so that's why it hangs for the same > time. I'm talking about iostat, mpstat. I think it should be > documented very clearly in libssh2 docs for further users. The same > happens for "eof" request. Who says close should not be initiated by client to immediately terminate the channel & process? Sure, it's not the normal way, but there is nothing wrong with it. How the server shuts down the running program when receiving a CLOSE request is outside specifications, but I would not expect it to wait for the program to exit before responding to the CLOSE requests. But implementations are free to wait if they insist. It's however not guaranteed it's possible to send a kill signal after the CLOSE so waiting like that puts the client in a little odd situation if the program never exits. EOF should differ significantly as it's unidirectional. Sending EOF should only close stdin to the program, stdout should still be connected to the channel. Regards Henrik _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Sat Oct 15 01:56:53 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9ENuk1I002909; Sat, 15 Oct 2011 01:56:52 +0200 Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9ENuhKP002887 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Sat, 15 Oct 2011 01:56:44 +0200 Received: by vws11 with SMTP id 11so1718843vws.41 for ; Fri, 14 Oct 2011 16:56:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=JMibB52zaf1PJh+6Jhyz0Ce3Dd/P3J939o9FwhbIMxU=; b=L3r7YN5KqgVzRA5io12KABtAQMkzg3+zonY/Dwfa2ZnjlPgiv8Jm1L6q0oX3jCi6Yt WnuaNLeGwDkJWS+2bHZFsYOHdbPJeitU4kcnABsAtUDeY8QeMeA/DVDSmDKBuzMIhBV/ 5gNKTQvY5krVG5VNqadVFPdNBlqaNi7Dj2ak0= MIME-Version: 1.0 Received: by 10.52.36.41 with SMTP id n9mr11164765vdj.41.1318636598288; Fri, 14 Oct 2011 16:56:38 -0700 (PDT) Received: by 10.52.158.33 with HTTP; Fri, 14 Oct 2011 16:56:38 -0700 (PDT) In-Reply-To: <1318635616.27718.10.camel@henriknordstrom.net> References: <20111014014951.24239.qmail@stuge.se> <1318574407.13277.6.camel@henriknordstrom.net> <1318622282.8310.2.camel@henriknordstrom.net> <1318635616.27718.10.camel@henriknordstrom.net> Date: Fri, 14 Oct 2011 16:56:38 -0700 X-Google-Sender-Auth: I4ACoowSbUT3hX8kOFfFp8qoA9s Message-ID: Subject: Re: libssh2_channel_close/libssh2_channel_free hangs if you execute long-running command From: Pavel Strashkin To: libssh2 development X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9ENuhKP002887 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9ENuk1I002909 > Who says close should not be initiated by client to immediately > terminate the channel & process? Nobody. It was a thought. As you mentioned: "it is outside specifications". > It's however not guaranteed it's possible to send a kill signal after the CLOSE so > waiting like that puts the client in a little odd situation if the program never exits. That why i think it would be better to send signal before closing the channel. The handling depends on situation. I believe in most cases people just run commands like "mkdir" of "ifconfig" which work pretty fast so not close nor signal is necessary. In case like mine the sequence should be signal -> wait_for_close if you want to force stop process. This is what happens when you press Ctrl+C or stop service by TERM signal. Normal way. I start thinking that closing channel for stop purposes is a bit brutal :) Only in case of INT/TERM/... signals program can handle it and stop gracefully. I hope you understand what i mean, usually i don't write so much in English, heh. I'd like to hear your opinion. Should something be changed or not in libssh2 based on my investigation? > EOF should differ significantly as it's unidirectional. Sending EOF > should only close stdin to the program, stdout should still be connected > to the channel. Yes, i think you're right. I'm out of mind a bit after research :) I had to review all openssh server code, libssh2 code and so on. I'm really newbie in all this SSH internals. 2011/10/14 Henrik Nordström : > fre 2011-10-14 klockan 16:00 -0700 skrev Pavel Strashkin: >> OK, after really long investigation i've found the reason why it >> hangs. Now i'm not sure either client or server is the reason of that. >> The following stuff is happening. When "close" is received by server, >> it closes pipes (stdout, ...) connected to the program and waits for >> program termination. When pipe closed from one side, other side will >> get SIGPIPE signal when attempting to write, but...before each write >> it waits for [interval] seconds so that's why it hangs for the same >> time. I'm talking about iostat, mpstat. I think it should be >> documented very clearly in libssh2 docs for further users. The same >> happens for "eof" request. > > Who says close should not be initiated by client to immediately > terminate the channel & process? > > Sure, it's not the normal way, but there is nothing wrong with it. > > How the server shuts down the running program when receiving a CLOSE > request is outside specifications, but I would not expect it to wait for > the program to exit before responding to the CLOSE requests. But > implementations are free to wait if they insist. It's however not > guaranteed it's possible to send a kill signal after the CLOSE so > waiting like that puts the client in a little odd situation if the > program never exits. > > EOF should differ significantly as it's unidirectional. Sending EOF > should only close stdin to the program, stdout should still be connected > to the channel. > > Regards > Henrik > > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Sat Oct 15 02:19:31 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9F0JFgf015044; Sat, 15 Oct 2011 02:19:30 +0200 Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9F0JDt7015036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 15 Oct 2011 02:19:13 +0200 Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1]) by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id p9F0JDME027756 for ; Sat, 15 Oct 2011 00:19:14 GMT Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged)) by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id p9F0JCDi004514 for ; Sat, 15 Oct 2011 02:19:12 +0200 Subject: Re: libssh2_channel_close/libssh2_channel_free hangs if you execute long-running command From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= To: libssh2 development Date: Sat, 15 Oct 2011 02:19:12 +0200 In-Reply-To: References: <20111014014951.24239.qmail@stuge.se> <1318574407.13277.6.camel@henriknordstrom.net> <1318622282.8310.2.camel@henriknordstrom.net> <1318635616.27718.10.camel@henriknordstrom.net> X-Mailer: Evolution 3.0.3 (3.0.3-1.fc15) Message-ID: <1318637952.27718.14.camel@henriknordstrom.net> Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]); Sat, 15 Oct 2011 00:19:15 +0000 (UTC) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se fre 2011-10-14 klockan 16:56 -0700 skrev Pavel Strashkin: > I'd like to hear your opinion. Should something be changed or not in > libssh2 based on my investigation? The delay in responding to CLOSE is on the server side. Adding signal support to libssh2 is always an welcome addition to libssh2 and would solve your issue with the server delaying it's response to CLOSE until the program exits. Regards Henrik _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 17 22:01:35 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9HK1B4X025552; Mon, 17 Oct 2011 22:01:32 +0200 Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9HK17kK025176 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 17 Oct 2011 22:01:08 +0200 Received: by vcbfo13 with SMTP id fo13so3455859vcb.41 for ; Mon, 17 Oct 2011 13:01:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=k9NU9KXTHkc7S0FjWThYrt0w8lfEGdasJMUwmqtdbtQ=; b=QZTsJETT00SmViPq1YhXlV2MTmR0v7QgrXlgpGPmYnZnDFcNeseZi5o6CZT5D861cx TbTTJe7o/FVSk0CHbpCBWSmI9bfbFAMdp6RZr0k4GtgEFoZL3jZ6oWx1tSL8sMwbuDoe HqODgpqYNvQoIG9lZrl1a71DKLdt65lglbj5Y= MIME-Version: 1.0 Received: by 10.52.16.243 with SMTP id j19mr3245530vdd.109.1318881663090; Mon, 17 Oct 2011 13:01:03 -0700 (PDT) Received: by 10.52.158.33 with HTTP; Mon, 17 Oct 2011 13:01:03 -0700 (PDT) Date: Mon, 17 Oct 2011 13:01:03 -0700 X-Google-Sender-Auth: g5qcwdupNfG1HvREVvo4yCghCxI Message-ID: Subject: [PATCH] Add support for "signal" message channel request From: Pavel Strashkin To: libssh2 development Content-Type: multipart/mixed; boundary=bcaec5014dc1077f3e04af84110d X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --bcaec5014dc1077f3e04af84110d Content-Type: text/plain; charset=ISO-8859-1 Hello everyone, The patch implements the following part of SSH RFC: ===CUT=== byte SSH_MSG_CHANNEL_REQUEST uint32 recipient channel string "signal" boolean FALSE string signal name (without the "SIG" prefix) ===END=== I've also extended "_libssh2_error" with an ability to use formatting string as "_libssh2_debug" does. Thank you! --bcaec5014dc1077f3e04af84110d Content-Type: application/octet-stream; name="add-support-for-signal-message-channel-request.patch" Content-Disposition: attachment; filename="add-support-for-signal-message-channel-request.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gtvw0uuq0 ZGlmZi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gICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgKipl eGl0c2lnbmFsLApkaWZmIC0tZ2l0IGEvc3JjL2NoYW5uZWwuYyBiL3NyYy9jaGFubmVsLmMKaW5k ZXggOGQ2ZmIwYS4uOGY5ZTM2OCAxMDA2NDQKLS0tIGEvc3JjL2NoYW5uZWwuYworKysgYi9zcmMv Y2hhbm5lbC5jCkBAIC03NTQsNiArNzU0LDExMSBAQCBsaWJzc2gyX2NoYW5uZWxfZm9yd2FyZF9h Y2NlcHQoTElCU1NIMl9MSVNURU5FUiAqbGlzdGVuZXIpCiB9CgogLyoKKyAqIF9saWJzc2gyX2No YW5uZWxfc2lnbmFsCisgKgorICogRGVsaXZlciBhIHNpZ25hbCB0byBhIHNoZWxsL3Byb2dyYW0v c3Vic3lzdGVtLgorICovCitzdGF0aWMgaW50IF9saWJzc2gyX2NoYW5uZWxfc2lnbmFsKExJQlNT SDJfQ0hBTk5FTCAqY2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hh ciAqc2lnbmFtZSwgc2l6ZV90IHNpZ25hbWVfbGVuKQoreworICAgIExJQlNTSDJfU0VTU0lPTiAq c2Vzc2lvbiA9IGNoYW5uZWwtPnNlc3Npb247CisgICAgc3RhdGljIGNvbnN0IGNoYXIgKnZhbGlk X3NpZ25hbHNbXSA9IHsKKyAgICAgICAgIkFCUlQiLAorICAgICAgICAiQUxSTSIsCisgICAgICAg ICJGUEUiLAorICAgICAgICAiSFVQIiwKKyAgICAgICAgIklMTCIsCisgICAgICAgICJJTlQiLAor ICAgICAgICAiS0lMTCIsCisgICAgICAgICJQSVBFIiwKKyAgICAgICAgIlFVSVQiLAorICAgICAg ICAiU0VHViIsCisgICAgICAgIDAKKyAgICB9OworCisgICAgaW50IHNpZ25hbF9pc192YWxpZCA9 IDA7CisgICAgaW50IGkgPSAwOworCisgICAgZm9yIChpID0gMDsgaSA8IHNpemVvZih2YWxpZF9z aWduYWxzKTsgaSsrKSB7CisgICAgICAgIGlmIChzdHJjbXAoc2lnbmFtZSwgdmFsaWRfc2lnbmFs c1tpXSkgPT0gMCkgeworICAgICAgICAgICAgc2lnbmFsX2lzX3ZhbGlkID0gMTsKKyAgICAgICAg ICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgaWYgKHNpZ25hbF9pc192YWxpZCA9 PSAwKSB7CisgICAgICAgIHJldHVybiBfbGlic3NoMl9lcnJvcihzZXNzaW9uLCBMSUJTU0gyX0VS Uk9SX0lOVkFMSURfU0lHTkFMX05BTUUsCisgICAgICAgICAgICAiVGhlIHNpZ25hbCBuYW1lICcl cycgaXMgaW52YWxpZC4gTXVzdCBiZSBvbmUgb2YgdGhlIGZvbGxvd2luZzogIgorICAgICAgICAg ICAgIkFCUlQsIEFMUk0sIEZQRSwgSFVQLCBJTEwsIElOVCwgS0lMTCwgUElQRSwgUVVJVCwgU0VH ViwgVEVSTSwgIgorICAgICAgICAgICAgIlVTUjEsIFVTUjIuIiwKKyAgICAgICAgICAgIHNpZ25h bWUKKyAgICAgICAgKTsKKyAgICB9CisKKyAgICBpZiAoY2hhbm5lbC0+c2lnbmFsX3N0YXRlID09 IGxpYnNzaDJfTkJfc3RhdGVfaWRsZSkgeworICAgICAgICAvKgorICAgICAgICAgKiBwYWNrZXRf dHlwZSgxKSArIGNoYW5uZWxfaWQoNCkgKyAic2lnbmFsIig2KSArIHdhbnRfcmVwbHkoMSkgKwor ICAgICAgICAgKiBzaWduYW1lKHNpZ25hbWVfbGVuKQorICAgICAgICAgKi8KKyAgICAgICAgY2hh bm5lbC0+c2lnbmFsX3BhY2tldF9sZW4gPSAxICsgNCArIDYgKyAxICsgc2lnbmFtZV9sZW47CisK KyAgICAgICAgLyogWmVybyB0aGUgd2hvbGUgdGhpbmcgb3V0ICovCisgICAgICAgIG1lbXNldCgm Y2hhbm5lbC0+c2lnbmFsX3BhY2tldF9yZXF1aXJldl9zdGF0ZSwgMCwKKyAgICAgICAgICAgICAg IHNpemVvZihjaGFubmVsLT5zaWduYWxfcGFja2V0X3JlcXVpcmV2X3N0YXRlKSk7CisKKyAgICAg ICAgX2xpYnNzaDJfZGVidWcoc2Vzc2lvbiwgTElCU1NIMl9UUkFDRV9DT05OLAorICAgICAgICAg ICAgIlNlbmRpbmcgc2lnbmFsICclcycgdG8gY2hhbm5lbCAlbHUvJWx1IiwKKyAgICAgICAgICAg IHNpZ25hbWUsCisgICAgICAgICAgICBjaGFubmVsLT5sb2NhbC5pZCwKKyAgICAgICAgICAgIGNo YW5uZWwtPnJlbW90ZS5pZCk7CisKKyAgICAgICAgdW5zaWduZWQgY2hhciAqcyA9IGNoYW5uZWwt PnNpZ25hbF9wYWNrZXQgPQorICAgICAgICAgICAgTElCU1NIMl9BTExPQyhzZXNzaW9uLCBjaGFu bmVsLT5zaWduYWxfcGFja2V0X2xlbik7CisgICAgICAgIGlmICghY2hhbm5lbC0+c2lnbmFsX3Bh Y2tldCkgeworICAgICAgICAgICAgcmV0dXJuIF9saWJzc2gyX2Vycm9yKHNlc3Npb24sIExJQlNT SDJfRVJST1JfQUxMT0MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlVuYWJs ZSB0byBhbGxvY2F0ZSBtZW1lb3J5ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAiZm9yIHNpZ25hbCBwYWNrZXQiKTsKKyAgICAgICAgfQorCisgICAgICAgICoocysrKSA9IFNT SF9NU0dfQ0hBTk5FTF9SRVFVRVNUOworICAgICAgICBfbGlic3NoMl9zdG9yZV91MzIoJnMsIGNo YW5uZWwtPnJlbW90ZS5pZCk7CisgICAgICAgIF9saWJzc2gyX3N0b3JlX3N0cigmcywgInNpZ25h bCIsIDYpOworICAgICAgICAqKHMrKykgPSAweDAwOyAvKiBEb24ndCByZXBseSAqLworICAgICAg ICBfbGlic3NoMl9zdG9yZV9zdHIoJnMsIHNpZ25hbWUsIHNpZ25hbWVfbGVuKTsKKworICAgICAg ICBjaGFubmVsLT5zaWduYWxfc3RhdGUgPSBsaWJzc2gyX05CX3N0YXRlX2NyZWF0ZWQ7CisgICAg fQorCisgICAgaWYgKGNoYW5uZWwtPnNpZ25hbF9zdGF0ZSA9PSBsaWJzc2gyX05CX3N0YXRlX2Ny ZWF0ZWQpIHsKKyAgICAgICAgaW50IHJjID0gX2xpYnNzaDJfdHJhbnNwb3J0X3NlbmQoc2Vzc2lv biwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsLT5zaWduYWxf cGFja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWwtPnNp Z25hbF9wYWNrZXRfbGVuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5V TEwsIDApOworICAgICAgICBpZiAocmMgPT0gTElCU1NIMl9FUlJPUl9FQUdBSU4pIHsKKyAgICAg ICAgICAgIF9saWJzc2gyX2Vycm9yKHNlc3Npb24sIHJjLAorICAgICAgICAgICAgICAgICAgICAg ICAgICAgIldvdWxkIGJsb2NrIHNlbmRpbmcgc2lnbmFsIHJlcXVlc3QiKTsKKyAgICAgICAgICAg IHJldHVybiByYzsKKyAgICAgICAgfSBlbHNlIGlmIChyYykgeworICAgICAgICAgICAgTElCU1NI Ml9GUkVFKHNlc3Npb24sIGNoYW5uZWwtPnNpZ25hbF9wYWNrZXQpOworICAgICAgICAgICAgY2hh bm5lbC0+c2lnbmFsX3BhY2tldCA9IE5VTEw7CisgICAgICAgICAgICBjaGFubmVsLT5zaWduYWxf c3RhdGUgPSBsaWJzc2gyX05CX3N0YXRlX2lkbGU7CisgICAgICAgICAgICByZXR1cm4gX2xpYnNz aDJfZXJyb3Ioc2Vzc2lvbiwgTElCU1NIMl9FUlJPUl9TT0NLRVRfU0VORCwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAiVW5hYmxlIHRvIHNlbmQgY2hhbm5lbC1yZXF1ZXN0IHBh Y2tldCB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gdGhlIHJlbW90ZSBwcm9jZXNzL3NlcnZpY2UKKy5TSCBTWU5PUFNJUworI2luY2x1ZGUgPGxp YnNzaDIuaD4KKworaW50CitsaWJzc2gyX2NoYW5uZWxfc2lnbmFsKExJQlNTSDJfQ0hBTk5FTCAq Y2hhbm5lbCwgY29uc3QgY2hhciAqc2lnbmFtZSwgc2l6ZV90IHNpZ25hbWVfbGVuKTsKKworLlNI IERFU0NSSVBUSU9OCitcZkljaGFubmVsXGZQIC0gQ2hhbm5lbCBzdHJlYW0gdG8gZGVsaXZlciBh IHNpZ25hbC4KKworXGZJc2lnbmFtZVxmUCAtIFRoZSBzaWduYWwgbmFtZSAod2l0aG91dCBsZWFk aW5nICJTSUciKSB3aGljaCBpcyBvbmUgb2YgdGhlIGZvbGxvd2luZyAodGhlc2UgYXJlIGZyb20g W1BPU0lYXSk6CisgICAgQUJSVAorICAgIEFMUk0KKyAgICBGUEUKKyAgICBIVVAKKyAgICBJTEwK KyAgICBJTlQKKyAgICBLSUxMCisgICAgUElQRQorICAgIFFVSVQKKyAgICBTRUdWCisgICAgVEVS TQorICAgIFVTUjEKKyAgICBVU1IyCisKK1xmSXNpZ25hbWVfbGVuXGZQIC0gVGhlIGxlbmd0aCBv ZiBzaWduYWwgbmFtZS4KKworLlNIIFJFVFVSTiBWQUxVRQorTnVtZXJpYyBlcnJvciBjb2RlIGNv cnJlc3BvbmRpbmcgdG8gdGhlIHRoZSBFcnJvciBDb2RlIGNvbnN0YW50cy4K --bcaec5014dc1077f3e04af84110d Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --bcaec5014dc1077f3e04af84110d-- From libssh2-devel-bounces@cool.haxx.se Mon Oct 17 22:08:03 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9HK7uvH031115; Mon, 17 Oct 2011 22:08:02 +0200 Received: from giant.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9HK7tn4031098 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 17 Oct 2011 22:07:55 +0200 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id p9HK7suA031093 for ; Mon, 17 Oct 2011 22:07:54 +0200 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Mon, 17 Oct 2011 22:07:54 +0200 (CEST) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: [PATCH] Add support for "signal" message channel request In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-fromdanielhimself: yes MIME-Version: 1.0 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On Mon, 17 Oct 2011, Pavel Strashkin wrote: > I've also extended "_libssh2_error" with an ability to use formatting string > as "_libssh2_debug" does. Thanks a lot for your work, but... Pretty please, do not make several unrelated changes in the same patch! Your _libssh2_error() now returns a pointer to a stack based buffer which is completely wrong. The comment header above libssh2_channel_signal() says the wrong function name. -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 17 22:26:44 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9HKQcpZ010819; Mon, 17 Oct 2011 22:26:43 +0200 Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9HKQYXo010759 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 17 Oct 2011 22:26:35 +0200 Received: by vcbfo13 with SMTP id fo13so3486485vcb.41 for ; Mon, 17 Oct 2011 13:26:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=9q25doCYU48LgArAjntwf4gw8QrjnwjE8BCk9ejn9pQ=; b=olxLxfaLFjSCSeJOLXzynsPHQaJXXwlILAd63yqkVU/SOo7KrcEPyM1kk+Ek+8u/aP pazCnVSWZ+vbf47vxVOsCmschr5wcURbm7giuipleQpnuvuhGP8PWVL46QUDHoSiVq7I Om8fc1Ar0NreiDMro6YjxA4aNVbccfRfFkNh4= MIME-Version: 1.0 Received: by 10.52.97.228 with SMTP id ed4mr21587496vdb.126.1318883191095; Mon, 17 Oct 2011 13:26:31 -0700 (PDT) Received: by 10.52.158.33 with HTTP; Mon, 17 Oct 2011 13:26:30 -0700 (PDT) Received: by 10.52.158.33 with HTTP; Mon, 17 Oct 2011 13:26:30 -0700 (PDT) In-Reply-To: References: Date: Mon, 17 Oct 2011 13:26:30 -0700 X-Google-Sender-Auth: LayAMJ7ZsqNMYF4vQsOl3H6tkGI Message-ID: Subject: Re: [PATCH] Add support for "signal" message channel request From: Pavel Strashkin To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0793207347==" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --===============0793207347== Content-Type: multipart/alternative; boundary=20cf307ac3c51affae04af846c6a --20cf307ac3c51affae04af846c6a Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Should i remove the changes for that function from the patch? Or i should fix my mistake and we OK with it for the first time? 17.10.2011 13:10 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5=CC=D8 "Daniel Stenberg" =CE=C1=D0=C9=D3=C1=CC: > On Mon, 17 Oct 2011, Pavel Strashkin wrote: > > I've also extended "_libssh2_error" with an ability to use formatting >> string as "_libssh2_debug" does. >> > > Thanks a lot for your work, but... > > Pretty please, do not make several unrelated changes in the same patch! > > Your _libssh2_error() now returns a pointer to a stack based buffer which > is completely wrong. > > The comment header above libssh2_channel_signal() says the wrong function > name. > > -- > > / daniel.haxx.se > ______________________________**_________________ > libssh2-devel http://cool.haxx.se/cgi-bin/**mailman/listinfo/libssh2-deve= l > --20cf307ac3c51affae04af846c6a Content-Type: text/html; charset=KOI8-R Content-Transfer-Encoding: quoted-printable

Should i remove the=9A changes for that function from the patch? Or i sh= ould fix my mistake and we OK with it for the first time?

17.10.2011 13:10 =D0=CF=CC=D8=DA=CF=D7=C1=D4=C5= =CC=D8 "Daniel Stenberg" <da= niel@haxx.se> =CE=C1=D0=C9=D3=C1=CC:
On Mon, 17 Oct 2011, Pavel Strashkin wrote:

I've also extended "_libssh2_error" with an ability to use fo= rmatting string as "_libssh2_debug" does.

Thanks a lot for your work, but...

Pretty please, do not make several unrelated changes in the same patch!

Your _libssh2_error() now returns a pointer to a stack based buffer which i= s completely wrong.

The comment header above libssh2_channel_signal() says the wrong function n= ame.

--

=9A/ daniel.haxx.se=
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/list= info/libssh2-devel
--20cf307ac3c51affae04af846c6a-- --===============0793207347== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --===============0793207347==-- From libssh2-devel-bounces@cool.haxx.se Mon Oct 17 22:29:09 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9HKT53d012049; Mon, 17 Oct 2011 22:29:08 +0200 Received: from giant.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9HKT3oB012026 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 17 Oct 2011 22:29:04 +0200 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id p9HKT3VG012016 for ; Mon, 17 Oct 2011 22:29:03 +0200 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Mon, 17 Oct 2011 22:29:03 +0200 (CEST) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: [PATCH] Add support for "signal" message channel request In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-fromdanielhimself: yes MIME-Version: 1.0 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On Mon, 17 Oct 2011, Pavel Strashkin wrote: > Should i remove the changes for that function from the patch? Or i should > fix my mistake and we OK with it for the first time? Since the new error function isn't working as intended I think you can start with removing those changes for and send a new patch with only the signal function and then work on getting that error function change done correctly in a second patch. -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 17 22:38:08 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9HKbxL3018216; Mon, 17 Oct 2011 22:38:07 +0200 Received: from ponderosa.fch.wimsey.bc.ca (zz201111.cipherkey.net [209.53.201.111]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9HKbvV6018205 for ; Mon, 17 Oct 2011 22:37:57 +0200 Received: by coneharvesters.com via sendmail with stdio id for libssh2-devel@cool.haxx.se; Mon, 17 Oct 2011 13:37:50 -0700 (PDT) Date: Mon, 17 Oct 2011 13:37:46 -0700 From: Dan Fandrich To: libssh2-devel@cool.haxx.se Subject: Re: [PATCH] Add support for "signal" message channel request Message-ID: <20111017203734.GA8144@coneharvesters.com> Mail-Followup-To: libssh2-devel@cool.haxx.se References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On Mon, Oct 17, 2011 at 01:01:03PM -0700, Pavel Strashkin wrote: > + * _libssh2_channel_signal > + * > + * Deliver a signal to a shell/program/subsystem. > + */ > +static int _libssh2_channel_signal(LIBSSH2_CHANNEL *channel, > + const char *signame, size_t signame_len) > +{ > + LIBSSH2_SESSION *session = channel->session; > + static const char *valid_signals[] = { This should be static const char * const valid_signals[] to make the array itself constant. > + "ABRT", > + "ALRM", > + "FPE", > + "HUP", > + "ILL", > + "INT", > + "KILL", > + "PIPE", > + "QUIT", > + "SEGV", Since this list is search linearly, you could make it ever so slightly faster by sorting it in decreasing order or usage frequency. That would be hard to determine, but I'd put signal like QUIT and HUP before ones like FPE. It's a microoptimization, but it comes for free :) > + 0 > + }; > + > + int signal_is_valid = 0; > + int i = 0; > + > + for (i = 0; i < sizeof(valid_signals); i++) { sizeof is wrong here. It should be ARRAY_SIZE(valid_signals). > + if (strcmp(signame, valid_signals[i]) == 0) { > + signal_is_valid = 1; > + break; > + } > + } > + > + if (signal_is_valid == 0) { > + return _libssh2_error(session, LIBSSH2_ERROR_INVALID_SIGNAL_NAME, > + "The signal name '%s' is invalid. Must be one of the following: " > + "ABRT, ALRM, FPE, HUP, ILL, INT, KILL, PIPE, QUIT, SEGV, TERM, " > + "USR1, USR2.", This list doesn't match the list in valid_signals[]. > + signame > + ); > + } > + > + if (channel->signal_state == libssh2_NB_state_idle) { > + /* > + * packet_type(1) + channel_id(4) + "signal"(6) + want_reply(1) + > + * signame(signame_len) > + */ > + channel->signal_packet_len = 1 + 4 + 6 + 1 + signame_len; > + > + /* Zero the whole thing out */ > + memset(&channel->signal_packet_requirev_state, 0, > + sizeof(channel->signal_packet_requirev_state)); > + > + _libssh2_debug(session, LIBSSH2_TRACE_CONN, > + "Sending signal '%s' to channel %lu/%lu", > + signame, > + channel->local.id, > + channel->remote.id); > + > + unsigned char *s = channel->signal_packet = > + LIBSSH2_ALLOC(session, channel->signal_packet_len); > + if (!channel->signal_packet) { > + return _libssh2_error(session, LIBSSH2_ERROR_ALLOC, > + "Unable to allocate memeory " Typo: memeory >>> Dan _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 17 23:27:34 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9HLRMKr017646; Mon, 17 Oct 2011 23:27:34 +0200 Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9HLRKoP017601 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 17 Oct 2011 23:27:20 +0200 Received: by vws11 with SMTP id 11so3576208vws.41 for ; Mon, 17 Oct 2011 14:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=Ls6r3IEREfXKWpIvpoiqIfvDDHUTzBdo83KGKOUHgyc=; b=cAn7mwuyQchGxJV6VJkAAT/k0aMWHY9nfrQHapYqoJy7V68NTRsSYeE4PEnldr828C fBUBATVcMEOp5Vy2qeaFkyt+/L5cAkR7MugxlT2yJuu43mxKzdlgevjJzO2N2kkgqQE4 wkc8IlHmKvCWs7lXKjY1mTm39s9ciohx7wBD0= MIME-Version: 1.0 Received: by 10.52.19.236 with SMTP id i12mr21611806vde.58.1318886835133; Mon, 17 Oct 2011 14:27:15 -0700 (PDT) Received: by 10.52.158.33 with HTTP; Mon, 17 Oct 2011 14:27:14 -0700 (PDT) In-Reply-To: <20111017203734.GA8144@coneharvesters.com> References: <20111017203734.GA8144@coneharvesters.com> Date: Mon, 17 Oct 2011 14:27:14 -0700 X-Google-Sender-Auth: hsuAEh9PYsZZmDoOyB94WPr4j1s Message-ID: Subject: Re: [PATCH] Add support for "signal" message channel request From: Pavel Strashkin To: libssh2 development Content-Type: multipart/mixed; boundary=20cf3078115c4e9cd604af8545b6 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --20cf3078115c4e9cd604af8545b6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable * remove changes for "_libssh2_error" * fix "memeory" typo * add missing signals to "valid_signals" array * use ARRAY_SIZE instead of sizeof to get number of elements in "valid_signals" array * make "valid_signals" array to be super constant * fix comment header for "libssh2_channel_signal" function > Since this list is search linearly, you could make it ever so slightly fa= ster > by sorting it in decreasing order or usage frequency. That would be hard = to > determine, but I'd put signal like QUIT and HUP before ones like FPE. It'= s a > microoptimization, but it comes for free :) I'd prefer to keep it in the same order as in RFC, doc file and error string, if you don't mind. 2011/10/17 Dan Fandrich : > On Mon, Oct 17, 2011 at 01:01:03PM -0700, Pavel Strashkin wrote: >> + * _libssh2_channel_signal >> + * >> + * Deliver a signal to a shell/program/subsystem. >> + */ >> +static int _libssh2_channel_signal(LIBSSH2_CHANNEL *channel, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0const char *signame= , size_t signame_len) >> +{ >> + =A0 =A0LIBSSH2_SESSION *session =3D channel->session; >> + =A0 =A0static const char *valid_signals[] =3D { > > This should be static const char * const valid_signals[] to make the arra= y > itself constant. > >> + =A0 =A0 =A0 =A0"ABRT", >> + =A0 =A0 =A0 =A0"ALRM", >> + =A0 =A0 =A0 =A0"FPE", >> + =A0 =A0 =A0 =A0"HUP", >> + =A0 =A0 =A0 =A0"ILL", >> + =A0 =A0 =A0 =A0"INT", >> + =A0 =A0 =A0 =A0"KILL", >> + =A0 =A0 =A0 =A0"PIPE", >> + =A0 =A0 =A0 =A0"QUIT", >> + =A0 =A0 =A0 =A0"SEGV", > > Since this list is search linearly, you could make it ever so slightly fa= ster > by sorting it in decreasing order or usage frequency. That would be hard = to > determine, but I'd put signal like QUIT and HUP before ones like FPE. It'= s a > microoptimization, but it comes for free :) > >> + =A0 =A0 =A0 =A00 >> + =A0 =A0}; >> + >> + =A0 =A0int signal_is_valid =3D 0; >> + =A0 =A0int i =3D 0; >> + >> + =A0 =A0for (i =3D 0; i < sizeof(valid_signals); i++) { > > sizeof is wrong here. It should be ARRAY_SIZE(valid_signals). > >> + =A0 =A0 =A0 =A0if (strcmp(signame, valid_signals[i]) =3D=3D 0) { >> + =A0 =A0 =A0 =A0 =A0 =A0signal_is_valid =3D 1; >> + =A0 =A0 =A0 =A0 =A0 =A0break; >> + =A0 =A0 =A0 =A0} >> + =A0 =A0} >> + >> + =A0 =A0if (signal_is_valid =3D=3D 0) { >> + =A0 =A0 =A0 =A0return _libssh2_error(session, LIBSSH2_ERROR_INVALID_SI= GNAL_NAME, >> + =A0 =A0 =A0 =A0 =A0 =A0"The signal name '%s' is invalid. Must be one o= f the following: " >> + =A0 =A0 =A0 =A0 =A0 =A0"ABRT, ALRM, FPE, HUP, ILL, INT, KILL, PIPE, QU= IT, SEGV, TERM, " >> + =A0 =A0 =A0 =A0 =A0 =A0"USR1, USR2.", > > This list doesn't match the list in valid_signals[]. > >> + =A0 =A0 =A0 =A0 =A0 =A0signame >> + =A0 =A0 =A0 =A0); >> + =A0 =A0} >> + >> + =A0 =A0if (channel->signal_state =3D=3D libssh2_NB_state_idle) { >> + =A0 =A0 =A0 =A0/* >> + =A0 =A0 =A0 =A0 * packet_type(1) + channel_id(4) + "signal"(6) + want_= reply(1) + >> + =A0 =A0 =A0 =A0 * signame(signame_len) >> + =A0 =A0 =A0 =A0 */ >> + =A0 =A0 =A0 =A0channel->signal_packet_len =3D 1 + 4 + 6 + 1 + signame_= len; >> + >> + =A0 =A0 =A0 =A0/* Zero the whole thing out */ >> + =A0 =A0 =A0 =A0memset(&channel->signal_packet_requirev_state, 0, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 sizeof(channel->signal_packet_requirev_sta= te)); >> + >> + =A0 =A0 =A0 =A0_libssh2_debug(session, LIBSSH2_TRACE_CONN, >> + =A0 =A0 =A0 =A0 =A0 =A0"Sending signal '%s' to channel %lu/%lu", >> + =A0 =A0 =A0 =A0 =A0 =A0signame, >> + =A0 =A0 =A0 =A0 =A0 =A0channel->local.id, >> + =A0 =A0 =A0 =A0 =A0 =A0channel->remote.id); >> + >> + =A0 =A0 =A0 =A0unsigned char *s =3D channel->signal_packet =3D >> + =A0 =A0 =A0 =A0 =A0 =A0LIBSSH2_ALLOC(session, channel->signal_packet_l= en); >> + =A0 =A0 =A0 =A0if (!channel->signal_packet) { >> + =A0 =A0 =A0 =A0 =A0 =A0return _libssh2_error(session, LIBSSH2_ERROR_AL= LOC, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"Un= able to allocate memeory " > > Typo: memeory > >>>> Dan > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > --20cf3078115c4e9cd604af8545b6 Content-Type: application/octet-stream; name="add-support-for-signal-message-channel-request.patch" Content-Disposition: attachment; filename="add-support-for-signal-message-channel-request.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gtvz4i9p0 ZGlmZiAtLWdpdCBhL2RvY3MvTWFrZWZpbGUuYW0gYi9kb2NzL01ha2VmaWxlLmFtCmluZGV4IGJj ZDlmYWEuLjJmZWVjNjUgMTAwNjQ0Ci0tLSBhL2RvY3MvTWFrZWZpbGUuYW0KKysrIGIvZG9jcy9N YWtlZmlsZS5hbQpAQCAtMjUsOCArMjUsOSBAQCBkaXN0X21hbl9NQU5TID0gXAogCWxpYnNzaDJf Y2hhbm5lbF9mb3J3YXJkX2xpc3Rlbi4zIFwKIAlsaWJzc2gyX2NoYW5uZWxfZm9yd2FyZF9saXN0 ZW5fZXguMyBcCiAJbGlic3NoMl9jaGFubmVsX2ZyZWUuMyBcCi0JbGlic3NoMl9jaGFubmVsX2dl dF9leGl0X3NpZ25hbC4zIFwKKwlsaWJzc2gyX2NoYW5uZWxfc2lnbmFsLjMgXAogCWxpYnNzaDJf Y2hhbm5lbF9nZXRfZXhpdF9zdGF0dXMuMyBcCisJbGlic3NoMl9jaGFubmVsX2dldF9leGl0X3Np Z25hbC4zIFwKIAlsaWJzc2gyX2NoYW5uZWxfaGFuZGxlX2V4dGVuZGVkX2RhdGEuMyBcCiAJbGli c3NoMl9jaGFubmVsX2hhbmRsZV9leHRlbmRlZF9kYXRhMi4zIFwKIA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5FTCAqY2hhbm5lbCwKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgY29uc3QgY2hhciAqc2lnbmFtZSwgc2l6ZV90IHNpZ25hbWVfbGVuKQorewor ICAgIExJQlNTSDJfU0VTU0lPTiAqc2Vzc2lvbiA9IGNoYW5uZWwtPnNlc3Npb247CisgICAgc3Rh dGljIGNvbnN0IGNoYXIqIGNvbnN0IHZhbGlkX3NpZ25hbHNbXSA9IHsKKyAgICAgICAgIkFCUlQi LAorICAgICAgICAiQUxSTSIsCisgICAgICAgICJGUEUiLAorICAgICAgICAiSFVQIiwKKyAgICAg ICAgIklMTCIsCisgICAgICAgICJJTlQiLAorICAgICAgICAiS0lMTCIsCisgICAgICAgICJQSVBF IiwKKyAgICAgICAgIlFVSVQiLAorICAgICAgICAiU0VHViIsCisgICAgICAgICJURVJNIiwKKyAg ICAgICAgIlVTUjEiLAorICAgICAgICAiVVNSMiIKKyAgICB9OworCisgICAgaW50IHNpZ25hbF9p c192YWxpZCA9IDA7CisgICAgaW50IGkgPSAwOworCisgICAgZm9yIChpID0gMDsgaSA8IEFSUkFZ X1NJWkUodmFsaWRfc2lnbmFscyk7IGkrKykgeworICAgICAgICBpZiAoc3RyY21wKHNpZ25hbWUs IHZhbGlkX3NpZ25hbHNbaV0pID09IDApIHsKKyAgICAgICAgICAgIHNpZ25hbF9pc192YWxpZCA9 IDE7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKworICAgIGlmIChzaWdu YWxfaXNfdmFsaWQgPT0gMCkgeworICAgICAgICByZXR1cm4gX2xpYnNzaDJfZXJyb3Ioc2Vzc2lv biwgTElCU1NIMl9FUlJPUl9JTlZBTElEX1NJR05BTF9OQU1FLAorICAgICAgICAgICAgIlRoZSBz aWduYWwgbmFtZSBpcyBpbnZhbGlkLiBNdXN0IGJlIG9uZSBvZiB0aGUgZm9sbG93aW5nOiAiCisg ICAgICAgICAgICAiQUJSVCwgQUxSTSwgRlBFLCBIVVAsIElMTCwgSU5ULCBLSUxMLCBQSVBFLCBR VUlULCBTRUdWLCBURVJNLCAiCisgICAgICAgICAgICAiVVNSMSwgVVNSMi4iCisgICAgICAgICk7 CisgICAgfQorCisgICAgaWYgKGNoYW5uZWwtPnNpZ25hbF9zdGF0ZSA9PSBsaWJzc2gyX05CX3N0 YXRlX2lkbGUpIHsKKyAgICAgICAgLyoKKyAgICAgICAgICogcGFja2V0X3R5cGUoMSkgKyBjaGFu bmVsX2lkKDQpICsgInNpZ25hbCIoNikgKyB3YW50X3JlcGx5KDEpICsKKyAgICAgICAgICogc2ln bmFtZShzaWduYW1lX2xlbikKKyAgICAgICAgICovCisgICAgICAgIGNoYW5uZWwtPnNpZ25hbF9w YWNrZXRfbGVuID0gMSArIDQgKyA2ICsgMSArIHNpZ25hbWVfbGVuOworCisgICAgICAgIC8qIFpl cm8gdGhlIHdob2xlIHRoaW5nIG91dCAqLworICAgICAgICBtZW1zZXQoJmNoYW5uZWwtPnNpZ25h bF9wYWNrZXRfcmVxdWlyZXZfc3RhdGUsIDAsCisgICAgICAgICAgICAgICBzaXplb2YoY2hhbm5l bC0+c2lnbmFsX3BhY2tldF9yZXF1aXJldl9zdGF0ZSkpOworCisgICAgICAgIF9saWJzc2gyX2Rl YnVnKHNlc3Npb24sIExJQlNTSDJfVFJBQ0VfQ09OTiwKKyAgICAgICAgICAgICJTZW5kaW5nIHNp Z25hbCAnJXMnIHRvIGNoYW5uZWwgJWx1LyVsdSIsCisgICAgICAgICAgICBzaWduYW1lLAorICAg ICAgICAgICAgY2hhbm5lbC0+bG9jYWwuaWQsCisgICAgICAgICAgICBjaGFubmVsLT5yZW1vdGUu aWQpOworCisgICAgICAgIHVuc2lnbmVkIGNoYXIgKnMgPSBjaGFubmVsLT5zaWduYWxfcGFja2V0 ID0KKyAgICAgICAgICAgIExJQlNTSDJfQUxMT0Moc2Vzc2lvbiwgY2hhbm5lbC0+c2lnbmFsX3Bh Y2tldF9sZW4pOworICAgICAgICBpZiAoIWNoYW5uZWwtPnNpZ25hbF9wYWNrZXQpIHsKKyAgICAg ICAgICAgIHJldHVybiBfbGlic3NoMl9lcnJvcihzZXNzaW9uLCBMSUJTU0gyX0VSUk9SX0FMTE9D LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJVbmFibGUgdG8gYWxsb2NhdGUg bWVtb3J5ICIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZm9yIHNpZ25hbCBw YWNrZXQiKTsKKyAgICAgICAgfQorCisgICAgICAgICoocysrKSA9IFNTSF9NU0dfQ0hBTk5FTF9S RVFVRVNUOworICAgICAgICBfbGlic3NoMl9zdG9yZV91MzIoJnMsIGNoYW5uZWwtPnJlbW90ZS5p ZCk7CisgICAgICAgIF9saWJzc2gyX3N0b3JlX3N0cigmcywgInNpZ25hbCIsIDYpOworICAgICAg ICAqKHMrKykgPSAweDAwOyAvKiBEb24ndCByZXBseSAqLworICAgICAgICBfbGlic3NoMl9zdG9y ZV9zdHIoJnMsIHNpZ25hbWUsIHNpZ25hbWVfbGVuKTsKKworICAgICAgICBjaGFubmVsLT5zaWdu YWxfc3RhdGUgPSBsaWJzc2gyX05CX3N0YXRlX2NyZWF0ZWQ7CisgICAgfQorCisgICAgaWYgKGNo YW5uZWwtPnNpZ25hbF9zdGF0ZSA9PSBsaWJzc2gyX05CX3N0YXRlX2NyZWF0ZWQpIHsKKyAgICAg ICAgaW50IHJjID0gX2xpYnNzaDJfdHJhbnNwb3J0X3NlbmQoc2Vzc2lvbiwKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsLT5zaWduYWxfcGFja2V0LAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWwtPnNpZ25hbF9wYWNrZXRfbGVu LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIDApOworICAgICAg ICBpZiAocmMgPT0gTElCU1NIMl9FUlJPUl9FQUdBSU4pIHsKKyAgICAgICAgICAgIF9saWJzc2gy X2Vycm9yKHNlc3Npb24sIHJjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIldvdWxkIGJs b2NrIHNlbmRpbmcgc2lnbmFsIHJlcXVlc3QiKTsKKyAgICAgICAgICAgIHJldHVybiByYzsKKyAg ICAgICAgfSBlbHNlIGlmIChyYykgeworICAgICAgICAgICAgTElCU1NIMl9GUkVFKHNlc3Npb24s IGNoYW5uZWwtPnNpZ25hbF9wYWNrZXQpOworICAgICAgICAgICAgY2hhbm5lbC0+c2lnbmFsX3Bh Y2tldCA9IE5VTEw7CisgICAgICAgICAgICBjaGFubmVsLT5zaWduYWxfc3RhdGUgPSBsaWJzc2gy X05CX3N0YXRlX2lkbGU7CisgICAgICAgICAgICByZXR1cm4gX2xpYnNzaDJfZXJyb3Ioc2Vzc2lv biwgTElCU1NIMl9FUlJPUl9TT0NLRVRfU0VORCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAiVW5hYmxlIHRvIHNlbmQgY2hhbm5lbC1yZXF1ZXN0IHBhY2tldCBmb3IgIgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJzaWduYWwgcmVxdWVzdCIpOworICAgICAg ICB9CisKKyAgICAgICAgTElCU1NIMl9GUkVFKHNlc3Npb24sIGNoYW5uZWwtPnNpZ25hbF9wYWNr ZXQpOworICAgICAgICBjaGFubmVsLT5zaWduYWxfcGFja2V0ID0gTlVMTDsKKworICAgICAgICBf bGlic3NoMl9odG9udTMyKGNoYW5uZWwtPnNpZ25hbF9sb2NhbF9jaGFubmVsLCBjaGFubmVsLT5s b2NhbC5pZCk7CisgICAgfQorCisgICAgY2hhbm5lbC0+c2lnbmFsX3N0YXRlID0gbGlic3NoMl9O Ql9zdGF0ZV9pZGxlOworICAgIHJldHVybiBMSUJTU0gyX0VSUk9SX05PTkU7Cit9CisKKy8qCiAg KiBjaGFubmVsX3NldGVudgogICoKICAqIFNldCBhbiBlbnZpc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dmOWMgMTAwNjQ0Ci0tLSBhL3NyYy9saWJzc2gyX3ByaXYuaAorKysgYi9zcmMvbGlic3No Ml9wcml2LmgKQEAgLTM2Niw2ICszNjYsMTMgQEAgc3RydWN0IF9MSUJTU0gyX0NIQU5ORUwKICAg ICB1bnNpZ25lZCBjaGFyIHNldGVudl9sb2NhbF9jaGFubmVsWzRdOwogICAgIHBhY2tldF9yZXF1 aXJldl9zdGF0ZV90IHNldGVudl9wYWNrZXRfcmVxdWlyZXZfc3RhdGU7CiAKKyAgICAvKiBTdGF0 ZSB2YXJpYWJsZXMgdXNlZCBpbiBsaWJzc2gyX2NoYW5uZWxfc2lnbmFsKCkgKi8KKyAgICBsaWJz c2gyX25vbmJsb2NraW5nX3N0YXRlcyBzaWduYWxfc3RhdGU7CisgICAgdW5zaWduZWQgY2hhciAq c2lnbmFsX3BhY2tldDsKKyAgICBzaXplX3Qgc2lnbmFsX3BhY2tldF9sZW47CisgICAgdW5zaWdu ZWQgY2hhciBzaWduYWxfbG9jYWxfY2hhbm5lbFs0XTsKKyAgICBwYWNrZXRfcmVxdWlyZXZfc3Rh dGVfdCBzaWduYWxfcGFja2V0X3JlcXVpcmV2X3N0YXRlOworCiAgICAgLyogU3RhdGUgdmFyaWFi bGVzIHVzZWQgaW4gbGlic3NoMl9jaGFubmVsX3JlcXVlc3RfcHR5X2V4KCkKICAgICAgICBsaWJz c2gyX2NoYW5uZWxfcmVxdWVzdF9wdHlfc2l6ZV9leCgpICovCiAgICAgbGlic3NoMl9ub25ibG9j a2luZ19zdGF0ZXMgcmVxUFRZX3N0YXRlOwo= --20cf3078115c4e9cd604af8545b6 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --20cf3078115c4e9cd604af8545b6-- From libssh2-devel-bounces@cool.haxx.se Tue Oct 18 03:04:06 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9I13iXc002125; Tue, 18 Oct 2011 03:04:02 +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-2) with SMTP id p9I13hp9001963 for ; Tue, 18 Oct 2011 03:03:43 +0200 Received: (qmail 29669 invoked by uid 501); 18 Oct 2011 01:03:44 -0000 Message-ID: <20111018010344.29668.qmail@stuge.se> Date: Tue, 18 Oct 2011 03:03:44 +0200 From: Peter Stuge To: libssh2-devel@cool.haxx.se Subject: Re: [PATCH] Add support for "signal" message channel request Mail-Followup-To: libssh2-devel@cool.haxx.se References: <20111017203734.GA8144@coneharvesters.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Pavel Strashkin wrote: > > I'd put signal like QUIT and HUP before ones like FPE. It's a > > microoptimization, but it comes for free :) > > I'd prefer to keep it in the same order as in RFC, doc file and > error string, if you don't mind. I agree with having the list in a familiar order. > diff --git a/docs/Makefile.am b/docs/Makefile.am Please create a commit, and let git generate a patch. This way you can also get feedback on the commit message, and you save a lot of time for the code maintainers, and finally you will automatically get credited correctly in the history. After you have made a commit you can still make changes to the commit, using git commit --amend. See also Pro Git about rewriting history. > +++ b/docs/Makefile.am > @@ -25,8 +25,9 @@ dist_man_MANS = \ > libssh2_channel_forward_listen.3 \ > libssh2_channel_forward_listen_ex.3 \ > libssh2_channel_free.3 \ > - libssh2_channel_get_exit_signal.3 \ > + libssh2_channel_signal.3 \ > libssh2_channel_get_exit_status.3 \ > + libssh2_channel_get_exit_signal.3 \ Please avoid any unrelated changes in your commits. I agree with the change to sort these correctly, but that should be done in a separate commit. Please create multiple commits in a local branch and have git generate (or send) patches, using git format-patch, or git send-email. > +++ b/docs/libssh2_channel_signal.3 .. > +.SH RETURN VALUE > +Numeric error code corresponding to the the Error Code constants. .. > +++ b/include/libssh2.h > @@ -404,6 +404,7 @@ typedef struct _LIBSSH2_POLLFD { > #define LIBSSH2_ERROR_SOCKET_RECV -43 > #define LIBSSH2_ERROR_ENCRYPT -44 > #define LIBSSH2_ERROR_BAD_SOCKET -45 > +#define LIBSSH2_ERROR_INVALID_SIGNAL_NAME -46 Is this new constant documented somewhere too? > @@ -748,6 +749,10 @@ LIBSSH2_API int libssh2_channel_flush_ex(LIBSSH2_CHANNEL *channel, > #define libssh2_channel_flush_stderr(channel) \ > libssh2_channel_flush_ex((channel), SSH_EXTENDED_DATA_STDERR) > > +LIBSSH2_API int libssh2_channel_signal(LIBSSH2_CHANNEL* channel, > + const char *signame, > + size_t signame_len); > + > LIBSSH2_API int libssh2_channel_get_exit_status(LIBSSH2_CHANNEL* channel); > LIBSSH2_API int libssh2_channel_get_exit_signal(LIBSSH2_CHANNEL* channel, > char **exitsignal, Sort order.. It's in logical order but perhaps alphabetical is better? Dunno. > +++ b/src/channel.c .. > +static int _libssh2_channel_signal(LIBSSH2_CHANNEL *channel, > + const char *signame, size_t signame_len) I disagree with this interface. First I would remove signame_len, noone wants to deal with that. Second, I would rather use a uint8_t or uint16_t parameter for the signal, and define all posible signals in an enum in the header file. Again, noone wants to deal with strings. > + static const char* const valid_signals[] = { > + "ABRT", > + "ALRM", .. > + if (signal_is_valid == 0) { > + return _libssh2_error(session, LIBSSH2_ERROR_INVALID_SIGNAL_NAME, > + "The signal name is invalid. Must be one of the following: " > + "ABRT, ALRM, FPE, HUP, ILL, INT, KILL, PIPE, QUIT, SEGV, TERM, " > + "USR1, USR2." > + ); A style note; the above closing parenthesis should probably be at the end of the line before. But more importantly, I don't like that the list of these signals appears in two places. I would like the error message to somehow cleverly use the canonical list of signals that the code also uses. //Peter _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Tue Oct 18 05:05:50 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9I35YEp032437; Tue, 18 Oct 2011 05:05:48 +0200 Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9I35W9Z032416 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 18 Oct 2011 05:05:32 +0200 Received: by vws11 with SMTP id 11so64323vws.41 for ; Mon, 17 Oct 2011 20:05:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=7JPFXBo9EcCrAcC6pO07zD9+ejCbCljrGzMjk/dCJpY=; b=gwAXIsgvMNhtcFuYlwVbLFeHrdHBLwjcRymbeF6q8rp6fDtoaLXTRvel2UfK7J6/30 f95TpwTj2H71oTjUN6GsCVI+oNezmRPL+fK8FF+t5UrkzOLK5Suy8ME8jd7980T4dV+y KV3438ocL8qgGEgPe7PO6WIAZQRcmMVWv9MLE= MIME-Version: 1.0 Received: by 10.52.19.236 with SMTP id i12mr470371vde.58.1318907126857; Mon, 17 Oct 2011 20:05:26 -0700 (PDT) Received: by 10.52.158.33 with HTTP; Mon, 17 Oct 2011 20:05:26 -0700 (PDT) In-Reply-To: <20111018010344.29668.qmail@stuge.se> References: <20111017203734.GA8144@coneharvesters.com> <20111018010344.29668.qmail@stuge.se> Date: Mon, 17 Oct 2011 20:05:26 -0700 X-Google-Sender-Auth: GgfyQ48fuROP7pjIp3SmC8prMlM Message-ID: Subject: Re: [PATCH] Add support for "signal" message channel request From: Pavel Strashkin To: libssh2 development X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9I35W9Z032416 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9I35YEp032437 > Is this new constant documented somewhere too? Are those all constants documented somewhere? :) > Sort order.. It's in logical order but perhaps alphabetical is > better? Dunno. Actually i tried to don't touch any order of definitions, i just added a function before some mark and keep it in sync everywhere in the code (including that Makefile.am which you saw at the beginning of patch). > I disagree with this interface. First I would remove signame_len, > noone wants to deal with that. Second, I would rather use a uint8_t > or uint16_t parameter for the signal, and define all posible signals > in an enum in the header file. Again, noone wants to deal with > strings. I'd like to keep API in the same way as RFC describes it. I don't know why they choose strings for signals instead of numbers. There was the reason. They define concrete signal names. And also libssh2_channel_signal(..., "QUIT") looks better and more readable than libssh2_channel_signal(..., 7). I believe 99% programmers remember only than 9 == TERM and 15 == KILL. > But more importantly, I don't like that the list of these signals > appears in two places. I would like the error message to somehow > cleverly use the canonical list of signals that the code also uses. There is no easy way to join all valid_signals elements. The price of this duplicate is really low. 2011/10/17 Peter Stuge : > Pavel Strashkin wrote: >> > I'd put signal like QUIT and HUP before ones like FPE. It's a >> > microoptimization, but it comes for free :) >> >> I'd prefer to keep it in the same order as in RFC, doc file and >> error string, if you don't mind. > > I agree with having the list in a familiar order. > > >> diff --git a/docs/Makefile.am b/docs/Makefile.am > > Please create a commit, and let git generate a patch. This way you > can also get feedback on the commit message, and you save a lot of > time for the code maintainers, and finally you will automatically > get credited correctly in the history. > > After you have made a commit you can still make changes to the > commit, using git commit --amend. See also Pro Git about rewriting > history. > > >> +++ b/docs/Makefile.am >> @@ -25,8 +25,9 @@ dist_man_MANS = \ >>       libssh2_channel_forward_listen.3 \ >>       libssh2_channel_forward_listen_ex.3 \ >>       libssh2_channel_free.3 \ >> -     libssh2_channel_get_exit_signal.3 \ >> +     libssh2_channel_signal.3 \ >>       libssh2_channel_get_exit_status.3 \ >> +     libssh2_channel_get_exit_signal.3 \ > > Please avoid any unrelated changes in your commits. I agree with the > change to sort these correctly, but that should be done in a separate > commit. Please create multiple commits in a local branch and have git > generate (or send) patches, using git format-patch, or git > send-email. > > >> +++ b/docs/libssh2_channel_signal.3 > .. >> +.SH RETURN VALUE >> +Numeric error code corresponding to the the Error Code constants. > > .. > >> +++ b/include/libssh2.h >> @@ -404,6 +404,7 @@ typedef struct _LIBSSH2_POLLFD { >>  #define LIBSSH2_ERROR_SOCKET_RECV               -43 >>  #define LIBSSH2_ERROR_ENCRYPT                   -44 >>  #define LIBSSH2_ERROR_BAD_SOCKET                -45 >> +#define LIBSSH2_ERROR_INVALID_SIGNAL_NAME       -46 > > Is this new constant documented somewhere too? > > >> @@ -748,6 +749,10 @@ LIBSSH2_API int libssh2_channel_flush_ex(LIBSSH2_CHANNEL *channel, >>  #define libssh2_channel_flush_stderr(channel) \ >>   libssh2_channel_flush_ex((channel), SSH_EXTENDED_DATA_STDERR) >> >> +LIBSSH2_API int libssh2_channel_signal(LIBSSH2_CHANNEL* channel, >> +                                       const char *signame, >> +                                       size_t signame_len); >> + >>  LIBSSH2_API int libssh2_channel_get_exit_status(LIBSSH2_CHANNEL* channel); >>  LIBSSH2_API int libssh2_channel_get_exit_signal(LIBSSH2_CHANNEL* channel, >>                                                  char **exitsignal, > > Sort order.. It's in logical order but perhaps alphabetical is > better? Dunno. > > >> +++ b/src/channel.c > .. >> +static int _libssh2_channel_signal(LIBSSH2_CHANNEL *channel, >> +                          const char *signame, size_t signame_len) > > I disagree with this interface. First I would remove signame_len, > noone wants to deal with that. Second, I would rather use a uint8_t > or uint16_t parameter for the signal, and define all posible signals > in an enum in the header file. Again, noone wants to deal with > strings. > > >> +    static const char* const valid_signals[] = { >> +        "ABRT", >> +        "ALRM", > .. >> +    if (signal_is_valid == 0) { >> +        return _libssh2_error(session, LIBSSH2_ERROR_INVALID_SIGNAL_NAME, >> +            "The signal name is invalid. Must be one of the following: " >> +            "ABRT, ALRM, FPE, HUP, ILL, INT, KILL, PIPE, QUIT, SEGV, TERM, " >> +            "USR1, USR2." >> +        ); > > A style note; the above closing parenthesis should probably be at the > end of the line before. > > But more importantly, I don't like that the list of these signals > appears in two places. I would like the error message to somehow > cleverly use the canonical list of signals that the code also uses. > > > //Peter > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Tue Oct 18 05:23:16 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9I3N7wO009737; Tue, 18 Oct 2011 05:23:15 +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-2) with SMTP id p9I3N5qt009730 for ; Tue, 18 Oct 2011 05:23:05 +0200 Received: (qmail 15730 invoked by uid 501); 18 Oct 2011 03:23:05 -0000 Message-ID: <20111018032305.15729.qmail@stuge.se> Date: Tue, 18 Oct 2011 05:23:05 +0200 From: Peter Stuge To: libssh2-devel@cool.haxx.se Subject: Re: [PATCH] Add support for "signal" message channel request Mail-Followup-To: libssh2-devel@cool.haxx.se References: <20111017203734.GA8144@coneharvesters.com> <20111018010344.29668.qmail@stuge.se> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Pavel Strashkin wrote: > > Is this new constant documented somewhere too? > > Are those all constants documented somewhere? :) Please check and answer this? > > I disagree with this interface. First I would remove signame_len, > > noone wants to deal with that. Second, I would rather use a uint8_t > > or uint16_t parameter for the signal, and define all posible signals > > in an enum in the header file. Again, noone wants to deal with > > strings. > > I'd like to keep API in the same way as RFC describes it. I don't > know why they choose strings for signals instead of numbers. There > was the reason. They define concrete signal names. And also > libssh2_channel_signal(..., "QUIT") looks better and more readable > than libssh2_channel_signal(..., 7). I believe 99% programmers > remember only than 9 == TERM and 15 == KILL. I am not advocating using numbers in the API, but to have values in an enum in libssh2.h, e.g. LIBSSH2_SIGNAL_QUIT. The names should match those in the RFC of course. > > But more importantly, I don't like that the list of these signals > > appears in two places. I would like the error message to somehow > > cleverly use the canonical list of signals that the code also uses. > > There is no easy way to join all valid_signals elements. The price > of this duplicate is really low. It's not about saving bytes, it's about making sure that there exists only one canonical representation of the values, so that it is impossible to create an inconsistency. //Peter _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Tue Oct 18 05:40:54 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9I3ekv4023332; Tue, 18 Oct 2011 05:40:53 +0200 Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9I3eiNF023085 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 18 Oct 2011 05:40:45 +0200 Received: by vws11 with SMTP id 11so78845vws.41 for ; Mon, 17 Oct 2011 20:40:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=zR5fr9YbkVTvYauLhImgm5OXVCsy7LDC+KQ+Ahx0g50=; b=byAigBaSRcmhIepRF/eYtUf1hXsZe4meHSzI2bAuWFCCsK86f3GjIdZpCIlq9hmJIf frxBhMIdldU7JxKr2/zJ0mJTczdtfjAQK0huY06gpgMBS9Q+NHf7VWj786JDdHCJzP9U A2YKX3BA4WboPD0wnpZoA++88U1gFzgY4Nbg0= MIME-Version: 1.0 Received: by 10.52.69.235 with SMTP id h11mr513477vdu.92.1318909239326; Mon, 17 Oct 2011 20:40:39 -0700 (PDT) Received: by 10.52.158.33 with HTTP; Mon, 17 Oct 2011 20:40:39 -0700 (PDT) In-Reply-To: <20111018032305.15729.qmail@stuge.se> References: <20111017203734.GA8144@coneharvesters.com> <20111018010344.29668.qmail@stuge.se> <20111018032305.15729.qmail@stuge.se> Date: Mon, 17 Oct 2011 20:40:39 -0700 X-Google-Sender-Auth: -xj22T572Rl20tmwBqGbEt_0dps Message-ID: Subject: Re: [PATCH] Add support for "signal" message channel request From: Pavel Strashkin To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se > Please check and answer this? It was sarcasm. No one of those constants are documented. If something is done - i did it too. If not - i'm not too. > I am not advocating using numbers in the API, but to have values in > an enum in libssh2.h, e.g. LIBSSH2_SIGNAL_QUIT. The names should > match those in the RFC of course. OK, now it sounds better. The last question is how we should check that passed signal name is valid? I have "valid_signals" array. Keep current code as is? btw. i saw many peaces of code related to the signals and i didn't see code-owns-definition of signals. I mean, we already have POSIX and if you're not going to respect it and pass wrong value - it's your problem. Either way is good for me. If you'd like to see defines i can add it. It isn't the point where i'd to stop and discuss it forever. Code is done and ready for use. Everything else is up to commiters. > It's not about saving bytes, it's about making sure that there exists > only one canonical representation of the values, so that it is > impossible to create an inconsistency. You know, it's not a big deal to write join-code. It's being called everytime when libssh2_channel_signal happens. Another solution is just remove advice from error message, but i don't like this idea. If something goes wrong - i don't want to check doc or code. Error message should be self-describable and as much helpful and it can be. 2011/10/17 Peter Stuge : > Pavel Strashkin wrote: >> > Is this new constant documented somewhere too? >> >> Are those all constants documented somewhere? :) > > Please check and answer this? > > >> > I disagree with this interface. First I would remove signame_len, >> > noone wants to deal with that. Second, I would rather use a uint8_t >> > or uint16_t parameter for the signal, and define all posible signals >> > in an enum in the header file. Again, noone wants to deal with >> > strings. >> >> I'd like to keep API in the same way as RFC describes it. I don't >> know why they choose strings for signals instead of numbers. There >> was the reason. They define concrete signal names. And also >> libssh2_channel_signal(..., "QUIT") looks better and more readable >> than libssh2_channel_signal(..., 7). I believe 99% programmers >> remember only than 9 == TERM and 15 == KILL. > > I am not advocating using numbers in the API, but to have values in > an enum in libssh2.h, e.g. LIBSSH2_SIGNAL_QUIT. The names should > match those in the RFC of course. > > >> > But more importantly, I don't like that the list of these signals >> > appears in two places. I would like the error message to somehow >> > cleverly use the canonical list of signals that the code also uses. >> >> There is no easy way to join all valid_signals elements. The price >> of this duplicate is really low. > > It's not about saving bytes, it's about making sure that there exists > only one canonical representation of the values, so that it is > impossible to create an inconsistency. > > > //Peter > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Tue Oct 18 06:47:54 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9I4lXWC002756; Tue, 18 Oct 2011 06:47:50 +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-2) with SMTP id p9I4lVgY002751 for ; Tue, 18 Oct 2011 06:47:31 +0200 Received: (qmail 26983 invoked by uid 501); 18 Oct 2011 04:47:30 -0000 Message-ID: <20111018044730.26982.qmail@stuge.se> Date: Tue, 18 Oct 2011 06:47:30 +0200 From: Peter Stuge To: libssh2-devel@cool.haxx.se Subject: Re: [PATCH] Add support for "signal" message channel request Mail-Followup-To: libssh2-devel@cool.haxx.se References: <20111017203734.GA8144@coneharvesters.com> <20111018010344.29668.qmail@stuge.se> <20111018032305.15729.qmail@stuge.se> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Pavel Strashkin wrote: > No one of those constants are documented. Ok. > > I am not advocating using numbers in the API, but to have values in > > an enum in libssh2.h, e.g. LIBSSH2_SIGNAL_QUIT. The names should > > match those in the RFC of course. > > OK, now it sounds better. The last question is how we should check > that passed signal name is valid? >= LIBSSH2_SIGNAL_MAX ? > I have "valid_signals" array. Keep current code as is? I would like an enum and a switch, with one case per enum. Then there will be a compiler warning if something gets out of sync. > btw. i saw many peaces of code related to the signals and i didn't see > code-owns-definition of signals. I mean, we already have POSIX and if > you're not going to respect it and pass wrong value - it's your > problem. What do you mean? Of course there needs to be a mapping between LIBSSH2_SIG* and the strings that are sent in the packet. > Either way is good for me. If you'd like to see defines i can > add it. It isn't the point where i'd to stop and discuss it > forever. Code is done and ready for use. Everything else is up > to commiters. Committers say the code is not quite done yet, although pretty close. > > It's not about saving bytes, it's about making sure that there exists > > only one canonical representation of the values, so that it is > > impossible to create an inconsistency. > > You know, it's not a big deal to write join-code. It's being called > everytime when libssh2_channel_signal happens. Or call it only when the error message is actually needed. //Peter _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Tue Oct 18 08:47:59 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9I6leTW005514; Tue, 18 Oct 2011 08:47:57 +0200 Received: from giant.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9I6lc0W005506 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 18 Oct 2011 08:47:38 +0200 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id p9I6lcDX005502 for ; Tue, 18 Oct 2011 08:47:38 +0200 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Tue, 18 Oct 2011 08:47:38 +0200 (CEST) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: [PATCH] Add support for "signal" message channel request In-Reply-To: <20111018032305.15729.qmail@stuge.se> Message-ID: References: <20111017203734.GA8144@coneharvesters.com> <20111018010344.29668.qmail@stuge.se> <20111018032305.15729.qmail@stuge.se> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-fromdanielhimself: yes MIME-Version: 1.0 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On Tue, 18 Oct 2011, Peter Stuge wrote: > I am not advocating using numbers in the API, but to have values in an enum > in libssh2.h, e.g. LIBSSH2_SIGNAL_QUIT. The names should match those in the > RFC of course. I agree completely with this. -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Tue Oct 18 09:45:51 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9I7jf70009458; Tue, 18 Oct 2011 09:45:50 +0200 Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9I7jdxR009449 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 18 Oct 2011 09:45:39 +0200 Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1]) by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id p9I7jbof028019 for ; Tue, 18 Oct 2011 07:45:39 GMT Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged)) by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id p9I7jbST019754 for ; Tue, 18 Oct 2011 09:45:37 +0200 Subject: Re: [PATCH] Add support for "signal" message channel request From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= To: libssh2 development Date: Tue, 18 Oct 2011 09:45:37 +0200 In-Reply-To: References: <20111017203734.GA8144@coneharvesters.com> <20111018010344.29668.qmail@stuge.se> <20111018032305.15729.qmail@stuge.se> X-Mailer: Evolution 3.0.3 (3.0.3-1.fc15) Message-ID: <1318923937.19439.6.camel@henriknordstrom.net> Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]); Tue, 18 Oct 2011 07:45:40 +0000 (UTC) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se tis 2011-10-18 klockan 08:47 +0200 skrev Daniel Stenberg: > On Tue, 18 Oct 2011, Peter Stuge wrote: > > > I am not advocating using numbers in the API, but to have values in an enum > > in libssh2.h, e.g. LIBSSH2_SIGNAL_QUIT. The names should match those in the > > RFC of course. > > I agree completely with this. Note, the "signal" request is open-ended and allows for other signals to be sent in addition to what is explicitly listed in the RFC. For signals not defined in an SSH RFC the normal @ style is used, and for OS defined signals @.config.guess. Additional well defined signal names may be added in other RFCs. I do not think the API should restrict to only RFC4254 defined signals. Not even sure we should sanity check them. Regards Henrik _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Tue Oct 18 09:49:01 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9I7mnPL010644; Tue, 18 Oct 2011 09:48:59 +0200 Received: from giant.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9I7mlRk010639 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 18 Oct 2011 09:48:47 +0200 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id p9I7mlbw010635 for ; Tue, 18 Oct 2011 09:48:47 +0200 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Tue, 18 Oct 2011 09:48:47 +0200 (CEST) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: [PATCH] Add support for "signal" message channel request In-Reply-To: <1318923937.19439.6.camel@henriknordstrom.net> Message-ID: References: <20111017203734.GA8144@coneharvesters.com> <20111018010344.29668.qmail@stuge.se> <20111018032305.15729.qmail@stuge.se> <1318923937.19439.6.camel@henriknordstrom.net> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-fromdanielhimself: yes MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1129329158-1947609713-1318924127=:24124" X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1129329158-1947609713-1318924127=:24124 Content-Type: TEXT/PLAIN; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8BIT On Tue, 18 Oct 2011, Henrik Nordström wrote: > Note, the "signal" request is open-ended and allows for other signals to be > sent in addition to what is explicitly listed in the RFC. Ouch. Good point and thanks for bringing in some facts here... I guess it teaches me to actually check the spec first! > I do not think the API should restrict to only RFC4254 defined signals. > Not even sure we should sanity check them. Right. Back to a string in the API I guess... -- / daniel.haxx.se --1129329158-1947609713-1318924127=:24124 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --1129329158-1947609713-1318924127=:24124-- From libssh2-devel-bounces@cool.haxx.se Tue Oct 18 10:00:25 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9I80DCv017022; Tue, 18 Oct 2011 10:00:24 +0200 Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9I80Cvm016828 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT) for ; Tue, 18 Oct 2011 10:00:13 +0200 Received: by wwn22 with SMTP id 22so4649103wwn.5 for ; Tue, 18 Oct 2011 01:00:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=nWhVnsv4cygQ8Klmq/zMrqUrRf8tVKGBmLysMJZceAs=; b=ib08LQEUzhnpf81KZO24K40RzFK4RFTrgXH5M1TuXhKKOVAFbSoHJ6/YcT2drh5SGw iiLpOzOIxansxN5Z7XijZy77j9usoB8xMMOjlnplzNl5xHsmx3WhNechSmH5eHYt0JvF M9HMp8jeicqkSa43J5qV/zazJUXaUdH2KeT6M= Received: by 10.223.7.18 with SMTP id b18mr2408176fab.31.1318924808201; Tue, 18 Oct 2011 01:00:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.125.75 with HTTP; Tue, 18 Oct 2011 00:59:38 -0700 (PDT) In-Reply-To: References: <20111017203734.GA8144@coneharvesters.com> From: Steven Ayre Date: Tue, 18 Oct 2011 08:59:38 +0100 Message-ID: Subject: Re: [PATCH] Add support for "signal" message channel request To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1132484322==" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --===============1132484322== Content-Type: multipart/alternative; boundary=0015174784eeada42f04af8e1c12 --0015174784eeada42f04af8e1c12 Content-Type: text/plain; charset=ISO-8859-1 > > > Since this list is search linearly, you could make it ever so slightly > faster > > by sorting it in decreasing order or usage frequency. That would be hard > to > > determine, but I'd put signal like QUIT and HUP before ones like FPE. > It's a > > microoptimization, but it comes for free :) > I'd prefer to keep it in the same order as in RFC, doc file and error > string, if you don't mind. > In fact it might even be better this way. QUIT should only happen once, but ALRM could potentially happen many times so in some situations it could be less optimal to move them earlier than the RFC states. I agree I think it's best to keep the listed order. --0015174784eeada42f04af8e1c12 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
> Since this list is search linearly, you could make it ever so slight= ly faster
> by sorting it in decreasing order or usage frequency. That would be ha= rd to
> determine, but I'd put signal like QUIT and HUP before ones like F= PE. It's a
> microoptimization, but it comes for free :)
I'd prefer to keep it in the same order as in RFC, doc file and e= rror
string, if you don't mind.

In fact it might even be better this way. QUIT = should only happen once, but=A0ALRM could potentially happen many times so = in some situations it could be less optimal to move them earlier than the R= FC states. I agree I think it's best to keep the listed order.
--0015174784eeada42f04af8e1c12-- --===============1132484322== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --===============1132484322==-- From libssh2-devel-bounces@cool.haxx.se Tue Oct 18 18:39:05 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9IGcbvs021385; Tue, 18 Oct 2011 18:39:01 +0200 Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9IGcZDp021339 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 18 Oct 2011 18:38:36 +0200 Received: by vws11 with SMTP id 11so644610vws.41 for ; Tue, 18 Oct 2011 09:38:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=p2yWMvdP0oJMU1VizhGMdVz8bnghTfFQpbqp9OwY614=; b=CZ2EoRDZpB47tT0LTTExSEC13W2iMMu8peiicWKhVFu98U6G/BBSQBrANI20/bIQbW ulq097vT4TpMtGCAUq+cvNgl3BhgSNzBLk2A80YDUv7tumLp83zERMISdpS4lz/p0OS2 eCc+T3C6IgtTwdyqZnLMS2FvrA1VHV8z/5dwI= MIME-Version: 1.0 Received: by 10.52.182.65 with SMTP id ec1mr3276879vdc.75.1318955909845; Tue, 18 Oct 2011 09:38:29 -0700 (PDT) Received: by 10.52.158.33 with HTTP; Tue, 18 Oct 2011 09:38:29 -0700 (PDT) In-Reply-To: References: Date: Tue, 18 Oct 2011 09:38:29 -0700 X-Google-Sender-Auth: xwJLEv_1F1OXxSpE-gKY5IhxwJE Message-ID: Subject: Re: [PATCH] Add support for "signal" message channel request From: Pavel Strashkin To: libssh2 development X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9IGcZDp021339 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9IGcbvs021385 It's terrible, but OpenSSH doesn't support "signal" message channel request *very sad face* It's scheduled for 6.0 release (https://bugzilla.mindrot.org/show_bug.cgi?id=1424) which is, i believe, far far away from now. 2011/10/17 Pavel Strashkin : > Hello everyone, > > The patch implements the following part of SSH RFC: > ===CUT=== >      byte      SSH_MSG_CHANNEL_REQUEST >      uint32    recipient channel >      string    "signal" >      boolean   FALSE >      string    signal name (without the "SIG" prefix) > ===END=== > > I've also extended "_libssh2_error" with an ability to use formatting > string as "_libssh2_debug" does. > > Thank you! > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Wed Oct 19 02:03:59 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9J03Yi2024350; Wed, 19 Oct 2011 02:03:55 +0200 Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9J03XlU024340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 19 Oct 2011 02:03:33 +0200 Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1]) by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id p9J03VvW007821 for ; Wed, 19 Oct 2011 00:03:33 GMT Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged)) by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id p9J03TZo000449 for ; Wed, 19 Oct 2011 02:03:29 +0200 Subject: Re: [PATCH] Add support for "signal" message channel request From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= To: libssh2 development Date: Wed, 19 Oct 2011 02:03:29 +0200 In-Reply-To: References: X-Mailer: Evolution 3.0.3 (3.0.3-1.fc15) Message-ID: <1318982609.26273.1.camel@henriknordstrom.net> Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]); Wed, 19 Oct 2011 00:03:33 +0000 (UTC) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se tis 2011-10-18 klockan 09:38 -0700 skrev Pavel Strashkin: > It's terrible, but OpenSSH doesn't support "signal" message channel > request *very sad face* It's scheduled for 6.0 release > (https://bugzilla.mindrot.org/show_bug.cgi?id=1424) which is, i > believe, far far away from now. dropbear server supports receiving signals. Regards Henrik _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Sun Oct 23 12:57:35 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9NAv88x017629; Sun, 23 Oct 2011 12:57:30 +0200 Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9NAv6jC017559 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Sun, 23 Oct 2011 12:57:06 +0200 Received: by eyd10 with SMTP id 10so6245919eyd.41 for ; Sun, 23 Oct 2011 03:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=4Ck/vSIRPqtxZjO2qb1S28hh7W4//SmiIVRXwbAlYjM=; b=x1ENL70XydOXCzjUJnO19m9O/qJDQDAJ7Xh4up8PumydJZ1Ll8TrhCR67qhvt9YJop PNUwCNL4e14hnjviP7LDKzjO0PHiye397t7nyEfk57V+HryaDn7kdC/ZWmQ/CQ9cUn7y RzFkn8sIHbGapq56p9cEr86VBbE1c5P8jo5IY= MIME-Version: 1.0 Received: by 10.213.35.131 with SMTP id p3mr222323ebd.51.1319367421110; Sun, 23 Oct 2011 03:57:01 -0700 (PDT) Received: by 10.213.8.130 with HTTP; Sun, 23 Oct 2011 03:57:01 -0700 (PDT) In-Reply-To: <20110929002526.3146.qmail@stuge.se> References: <20110929002526.3146.qmail@stuge.se> Date: Sun, 23 Oct 2011 12:57:01 +0200 Message-ID: Subject: Re: Patch to ticket 228 From: Jernej Kovacic To: libssh2 development Content-Type: multipart/mixed; boundary=0015174c1be076aa9904aff52a9c X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --0015174c1be076aa9904aff52a9c Content-Type: text/plain; charset=UTF-8 Hello, I have finally updated the patch which you can find attached. It works fine on FreeBSD 8.2 i 386. When built with OpenSSL 1.0.0d, zlib and none enabled, my simple test application returns the following : Supported KEX algorithms: diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1, Supported hostkey algorithms: ssh-rsa,ssh-dss, Supported symetric algorithms: aes128-ctr,aes192-ctr,aes256-ctr,aes256-cbc,rijndael-cbc@lysator.liu.se,aes192-cbc,aes128-cbc,blowfish-cbc,arcfour128,arcfour,cast128-cbc,3des-cbc,none, Supported HMAC algorithms: hmac-sha1,hmac-sha1-96,hmac-md5,hmac-md5-96,hmac-ripemd160,hmac,ripemd160@openssh.com,none, Supported compression algorithms: zlib,none, Please check the syntax of the man page (I am not familiar with it) and update the "availability" version appropriately. Now finally sticking to another desired feature that will be discussed in a separate thread. Regards, Jernej --0015174c1be076aa9904aff52a9c Content-Type: application/octet-stream; name="0001-Added-libssh2_session_supported_algs-3.patch" Content-Disposition: attachment; filename="0001-Added-libssh2_session_supported_algs-3.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gu3wwgmy0 RnJvbSBjMmUzNmE0ODViNzljMjkxYmI1OTBlMWZjYThhMDVlNzVmN2I2NzkwIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiB1bmtub3duIDxqa292YWNpY0AuKG5vbmUpPgpEYXRlOiBTdW4s IDIzIE9jdCAyMDExIDEyOjM0OjUyICswMjAwClN1YmplY3Q6IFtQQVRDS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ICAgICAgY2FzZSBMSUJTU0gyX01FVEhPRF9L RVg6CisgICAgICAgICAgICBtbGlzdCA9IChjb25zdCBMSUJTU0gyX0NPTU1PTl9NRVRIT0QgKiop IGxpYnNzaDJfa2V4X21ldGhvZHM7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNl IExJQlNTSDJfTUVUSE9EX0hPU1RLRVk6CisgICAgICAgICAgICBtbGlzdCA9IChjb25zdCBMSUJT U0gyX0NPTU1PTl9NRVRIT0QgKiopIGxpYnNzaDJfaG9zdGtleV9tZXRob2RzKCk7CisgICAgICAg ICAgICBicmVhazsKKworICAgICAgICBjYXNlIExJQlNTSDJfTUVUSE9EX0NSWVBUX0NTOgorICAg ICAgICBjYXNlIExJQlNTSDJfTUVUSE9EX0NSWVBUX1NDOgorICAgICAgICAgICAgbWxpc3QgPSAo Y29uc3QgTElCU1NIMl9DT01NT05fTUVUSE9EICoqKSBsaWJzc2gyX2NyeXB0X21ldGhvZHMoKTsJ CQkKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgTElCU1NIMl9NRVRIT0RfTUFD X0NTOgorICAgICAgICBjYXNlIExJQlNTSDJfTUVUSE9EX01BQ19TQzoKKyAgICAgICAgICAgIG1s aXN0ID0gKGNvbnN0IExJQlNTSDJfQ09NTU9OX01FVEhPRCAqKikgX2xpYnNzaDJfbWFjX21ldGhv ZHMoKTsKKyAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgTElCU1NIMl9NRVRIT0Rf Q09NUF9DUzoKKyAgICAgICAgY2FzZSBMSUJTU0gyX01FVEhPRF9DT01QX1NDOgorICAgICAgICAg ICAgbWxpc3QgPSAoY29uc3QgTElCU1NIMl9DT01NT05fTUVUSE9EICoqKSBfbGlic3NoMl9jb21w X21ldGhvZHMoTlVMTCk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0Ogor ICAgICAgICAgICAgcmV0dXJuIExJQlNTSDJfRVJST1JfTU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29waWVkPyAodGVzdCB0aGUgY29kZSBhYm92ZSkgKi8KKwlp ZiAoIGohPWlhbGcgKQorCXsKKwkJLyogZGVhbGxvY2F0ZSBidWZmZXIgKi8KKwkJTElCU1NIMl9G UkVFKHNlc3Npb24sICphbGdzKTsKKwkJKmFsZ3MgPSBOVUxMOworCisJCXJldHVybiBMSUJTU0gy X0VSUk9SX0JBRF9VU0U7CisJfQorCisgICAgcmV0dXJuIGlhbGc7Cit9Ci0tIAoxLjcuNi5tc3lz Z2l0LjAKCg== --0015174c1be076aa9904aff52a9c Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --0015174c1be076aa9904aff52a9c-- From libssh2-devel-bounces@cool.haxx.se Mon Oct 24 12:35:08 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9OAYisl001411; Mon, 24 Oct 2011 12:35:04 +0200 Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9OAYgKp001338 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 24 Oct 2011 12:34:43 +0200 Received: by qadz32 with SMTP id z32so2636365qad.41 for ; Mon, 24 Oct 2011 03:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=P8x/KKcZtGqzB1JUyld6ug78iiKyLN7t6fMqW7Y+g4s=; b=g6f1p5uAczfiu0cMKGEkcpHkN9+fiP9ikpU9kfkXAZJgOOFzaRW83NaM3TIMY56MaW uNp/ZwBCtz6HFfPSjLKJU6pMibf+2Pk/N/SPQxfeLM6caRURo2uUCWe3vnGKKOaHvKkZ BsM2lCRaWkZgvCMeDOOwD0En9o6x0FWGgCiyo= MIME-Version: 1.0 Received: by 10.229.109.200 with SMTP id k8mr4909867qcp.262.1319452476322; Mon, 24 Oct 2011 03:34:36 -0700 (PDT) Received: by 10.229.238.130 with HTTP; Mon, 24 Oct 2011 03:34:36 -0700 (PDT) In-Reply-To: References: <20110929002526.3146.qmail@stuge.se> Date: Mon, 24 Oct 2011 11:34:36 +0100 X-Google-Sender-Auth: CKYbXPNJ0UTD4xStUSR2-Z8zaMM Message-ID: Subject: Re: Patch to ticket 228 From: Alexander Lamaison To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On 23 October 2011 11:57, Jernej Kovacic wrote: > > I have finally updated the patch which you can find attached. Thanks Jernej. I have a few observations about this versions: - The changes to _libssh2_comp_methods aren't necessary now as a session is always used. - The patch introduces tabs as indentation. These should be spaces. - Any API function that returns an error must call _libssh2_error to set the session's error state. Alex -- Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org) _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 24 16:35:35 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9OEZDCm031827; Mon, 24 Oct 2011 16:35:30 +0200 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9OEZAuV031763 for ; Mon, 24 Oct 2011 16:35:11 +0200 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9OEZ6JE004255 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 24 Oct 2011 10:35:06 -0400 Received: from dhcp-25-232.brq.redhat.com (dhcp-25-232.brq.redhat.com [10.34.25.232]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9OEZ5uc001131 for ; Mon, 24 Oct 2011 10:35:05 -0400 From: Kamil Dudka To: libssh2-devel@cool.haxx.se Subject: [PATCH] example/sftp_RW_nonblock: do not ignore LIBSSH2_ERROR_EAGAIN Date: Mon, 24 Oct 2011 16:35:05 +0200 User-Agent: KMail/1.12.4 (Linux/2.6.32-131.0.15.el6.x86_64; KDE/4.3.4; x86_64; ; ) MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_ZeXpO0j1AxtUHAI" Message-Id: <201110241635.05824.kdudka@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --Boundary-00=_ZeXpO0j1AxtUHAI Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, sftp_RW_nonblock.c does not handle LIBSSH2_ERROR_EAGAIN, which causes the password authentication to fail. I fixed the example by taking the appropriate code from sftp_nonblock.c. Note that sftp_nonblock.c does not call select() while looping around libssh2_session_handshake(), libssh2_userauth_password(), libssh2_userauth_publickey_fromfile() and libssh2_session_disconnect() -- is that intentionally? (the call of libssh2_userauth_publickey_fromfile() is dead code anyway...) Kamil --Boundary-00=_ZeXpO0j1AxtUHAI Content-Type: text/x-patch; charset="UTF-8"; name="0001-example-sftp_RW_nonblock-do-not-ignore-LIBSSH2_ERROR.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-example-sftp_RW_nonblock-do-not-ignore-LIBSSH2_ERROR.patch" =46rom 19bcd604ed41540950f59944bea1913db39ae646 Mon Sep 17 00:00:00 2001 =46rom: Kamil Dudka Date: Mon, 24 Oct 2011 16:21:25 +0200 Subject: [PATCH] example/sftp_RW_nonblock: do not ignore LIBSSH2_ERROR_EAGA= IN Bug: https://bugzilla.redhat.com/745420 =2D-- example/sftp_RW_nonblock.c | 89 +++++++++++++++++++++++++++++++++++-----= =2D-- 1 files changed, 72 insertions(+), 17 deletions(-) diff --git a/example/sftp_RW_nonblock.c b/example/sftp_RW_nonblock.c index 8cb241f..babb48a 100644 =2D-- a/example/sftp_RW_nonblock.c +++ b/example/sftp_RW_nonblock.c @@ -43,6 +43,36 @@ example uses to store the downloaded file in */ =20 +static int waitsocket(int socket_fd, LIBSSH2_SESSION *session) +{ + struct timeval timeout; + int rc; + fd_set fd; + fd_set *writefd =3D NULL; + fd_set *readfd =3D NULL; + int dir; + + timeout.tv_sec =3D 10; + timeout.tv_usec =3D 0; + + FD_ZERO(&fd); + + FD_SET(socket_fd, &fd); + + /* now make sure we wait in the correct direction */ + dir =3D libssh2_session_block_directions(session); + + if(dir & LIBSSH2_SESSION_BLOCK_INBOUND) + readfd =3D &fd; + + if(dir & LIBSSH2_SESSION_BLOCK_OUTBOUND) + writefd =3D &fd; + + rc =3D select(socket_fd + 1, readfd, writefd, NULL, &timeout); + + return rc; +} + int main(int argc, char *argv[]) { int sock, i, auth_pw =3D 1; @@ -138,36 +168,61 @@ int main(int argc, char *argv[]) =20 if (auth_pw) { /* We could authenticate via password */ =2D if (libssh2_userauth_password(session, username, password)) { + while ((rc =3D libssh2_userauth_password(session, username, passwo= rd)) + =3D=3D LIBSSH2_ERROR_EAGAIN); + if (rc) { printf("Authentication by password failed.\n"); goto shutdown; } } else { /* Or by public key */ =2D if (libssh2_userauth_publickey_fromfile(session, username, =2D "/home/username/.ssh/id_= rsa.pub", =2D "/home/username/.ssh/id_= rsa", =2D password)) { + while ((rc =3D + libssh2_userauth_publickey_fromfile(session, username, + "/home/username/" + ".ssh/id_rsa.pub", + "/home/username/" + ".ssh/id_rsa", + password)) =3D=3D + LIBSSH2_ERROR_EAGAIN); + if (rc) { printf("\tAuthentication by public key failed\n"); goto shutdown; } } =20 =2D sftp_session =3D libssh2_sftp_init(session); + do { + sftp_session =3D libssh2_sftp_init(session); =20 =2D if (!sftp_session) { =2D fprintf(stderr, "Unable to init SFTP session\n"); =2D goto shutdown; =2D } + if(!sftp_session) { + if(libssh2_session_last_errno(session) =3D=3D + LIBSSH2_ERROR_EAGAIN) { + fprintf(stderr, "non-blocking init\n"); + waitsocket(sock, session); /* now we wait */ + } + else { + fprintf(stderr, "Unable to init SFTP session\n"); + goto shutdown; + } + } + } while (!sftp_session); =20 /* Request a file via SFTP */ =2D sftp_handle =3D =2D libssh2_sftp_open(sftp_session, sftppath, LIBSSH2_FXF_READ, 0); + do { + sftp_handle =3D libssh2_sftp_open(sftp_session, sftppath, + LIBSSH2_FXF_READ, 0); + + if (!sftp_handle) { + if (libssh2_session_last_errno(session) !=3D LIBSSH2_ERROR_EAG= AIN) { + fprintf(stderr, "Unable to open file with SFTP\n"); + goto shutdown; + } + else { + fprintf(stderr, "non-blocking open\n"); + waitsocket(sock, session); /* now we wait */ + } + } + } while (!sftp_handle); =20 =2D if (!sftp_handle) { =2D fprintf(stderr, "Unable to open file with SFTP\n"); =2D goto shutdown; =2D } fprintf(stderr, "libssh2_sftp_open() is done, now receive data!\n"); do { do { =2D-=20 1.7.1 --Boundary-00=_ZeXpO0j1AxtUHAI Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --Boundary-00=_ZeXpO0j1AxtUHAI-- From libssh2-devel-bounces@cool.haxx.se Mon Oct 24 22:24:01 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9OKNcCu010620; Mon, 24 Oct 2011 22:23:57 +0200 Received: from giant.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9OKNaDl010607 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 24 Oct 2011 22:23:36 +0200 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id p9OKNacC010603 for ; Mon, 24 Oct 2011 22:23:36 +0200 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Mon, 24 Oct 2011 22:23:36 +0200 (CEST) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: [PATCH] example/sftp_RW_nonblock: do not ignore LIBSSH2_ERROR_EAGAIN In-Reply-To: <201110241635.05824.kdudka@redhat.com> Message-ID: References: <201110241635.05824.kdudka@redhat.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-fromdanielhimself: yes MIME-Version: 1.0 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On Mon, 24 Oct 2011, Kamil Dudka wrote: > sftp_RW_nonblock.c does not handle LIBSSH2_ERROR_EAGAIN, which causes the > password authentication to fail. I fixed the example by taking the > appropriate code from sftp_nonblock.c. Note that sftp_nonblock.c does not > call select() while looping around libssh2_session_handshake(), > libssh2_userauth_password(), libssh2_userauth_publickey_fromfile() and > libssh2_session_disconnect() -- is that intentionally? It was only like that because of plain laziness. Thanks for fixing the example, I've pushed your fix now! -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Tue Oct 25 16:42:44 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9PEgGF8014299; Tue, 25 Oct 2011 16:42:40 +0200 Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9PEgE6o014053 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 25 Oct 2011 16:42:14 +0200 Received: by eyd10 with SMTP id 10so629114eyd.41 for ; Tue, 25 Oct 2011 07:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Wwljiv3o2kiRJINwlZ9S6MvJobFNzOZQplbM172tX7Q=; b=UlcC+mW7pJ4reF8geqiBosQQb/M9FmtXPPw7K/w8NKv73HOF5BDjo5e5/2lPP3U6Su PYMsX0Coy8ZHkxzcdWqkZhJUipSzvPE/x0W3IqGmkE68Kd+Wq8JIYdjYKiZTAU3TRsjd DWVD/A70NrKKzWeRK8JcXesMalumYFRQWBzBA= MIME-Version: 1.0 Received: by 10.213.25.74 with SMTP id y10mr397476ebb.13.1319553729041; Tue, 25 Oct 2011 07:42:09 -0700 (PDT) Received: by 10.213.8.130 with HTTP; Tue, 25 Oct 2011 07:42:08 -0700 (PDT) In-Reply-To: References: <20110929002526.3146.qmail@stuge.se> Date: Tue, 25 Oct 2011 16:42:08 +0200 Message-ID: Subject: Re: Patch to ticket 228 From: Jernej Kovacic To: libssh2 development Content-Type: multipart/mixed; boundary=0015174413664817cd04b0208b6e X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --0015174413664817cd04b0208b6e Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, Now I have modified the function to call _libssh2_error(), converted tabs to spaces (hopefully none have remained) and reverted the changes in comp.c. I have also added a few important lines into the doc. file to ensure that the function will be used properly when "asked" for compression methods. There are two files attached. The first is (should be) the same as in previous post, the second is relative to it. Maybe this could be done better but I am not very familiar with Git :( Regards, Jernej On Mon, Oct 24, 2011 at 12:34 PM, Alexander Lamaison wr= ote: > On 23 October 2011 11:57, Jernej Kovacic wrote: >> >> I have finally updated the patch which you can find attached. > > Thanks Jernej. =C2=A0I have a few observations about this versions: > > - The changes to _libssh2_comp_methods aren't necessary now as a > session is always used. > - The patch introduces tabs as indentation. =C2=A0These should be spaces. > - Any API function that returns an error must call _libssh2_error to > set the session's error state. > > Alex > > -- > Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org) > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > --0015174413664817cd04b0208b6e Content-Type: application/octet-stream; name="0001-Added-libssh2_session_supported_algs-3.patch" Content-Disposition: attachment; filename="0001-Added-libssh2_session_supported_algs-3.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gu6ztbnn0 RnJvbSBjMmUzNmE0ODViNzljMjkxYmI1OTBlMWZjYThhMDVlNzVmN2I2NzkwIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiB1bmtub3duIDxqa292YWNpY0AuKG5vbmUpPgpEYXRlOiBTdW4s IDIzIE9jdCAyMDExIDEyOjM0OjUyICswMjAwClN1YmplY3Q6IFtQQVRDSCAxLzJdIEFkZGVkIGxp YnNzaDJfc2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ICAgICAgICAgbWxpc3QgPSAoY29uc3QgTElCU1NIMl9DT01NT05fTUVUSE9E ICoqKSBsaWJzc2gyX2tleF9tZXRob2RzOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAg Y2FzZSBMSUJTU0gyX01FVEhPRF9IT1NUS0VZOgorICAgICAgICAgICAgbWxpc3QgPSAoY29uc3Qg TElCU1NIMl9DT01NT05fTUVUSE9EICoqKSBsaWJzc2gyX2hvc3RrZXlfbWV0aG9kcygpOworICAg ICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgY2FzZSBMSUJTU0gyX01FVEhPRF9DUllQVF9DUzoK KyAgICAgICAgY2FzZSBMSUJTU0gyX01FVEhPRF9DUllQVF9TQzoKKyAgICAgICAgICAgIG1saXN0 ID0gKGNvbnN0IExJQlNTSDJfQ09NTU9OX01FVEhPRCAqKikgbGlic3NoMl9jcnlwdF9tZXRob2Rz KCk7CQkJCisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIExJQlNTSDJfTUVUSE9E X01BQ19DUzoKKyAgICAgICAgY2FzZSBMSUJTU0gyX01FVEhPRF9NQUNfU0M6CisgICAgICAgICAg ICBtbGlzdCA9IChjb25zdCBMSUJTU0gyX0NPTU1PTl9NRVRIT0QgKiopIF9saWJzc2gyX21hY19t ZXRob2RzKCk7CisgICAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlIExJQlNTSDJfTUVU SE9EX0NPTVBfQ1M6CisgICAgICAgIGNhc2UgTElCU1NIMl9NRVRIT0RfQ09NUF9TQzoKKyAgICAg ICAgICAgIG1saXN0ID0gKGNvbnN0IExJQlNTSDJfQ09NTU9OX01FVEhPRCAqKikgX2xpYnNzaDJf Y29tcF9tZXRob2RzKE5VTEwpOworICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgZGVmYXVs dDoKKyAgICAgICAgICAgIHJldHVybiBMSUJTU0gyX0VSUk9SX01FVEhPRF9OT1RfU1VQUE9SVEVE OyAgLyogdW5rbm93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gdGhlIGNvZGUgYWJvdmUpICov CisJaWYgKCBqIT1pYWxnICkKKwl7CisJCS8qIGRlYWxsb2NhdGUgYnVmZmVyICovCisJCUxJQlNT SDJfRlJFRShzZXNzaW9uLCAqYWxncyk7CisJCSphbGdzID0gTlVMTDsKKworCQlyZXR1cm4gTElC U1NIMl9FUlJPUl9CQURfVVNFOworCX0KKworICAgIHJldHVybiBpYWxnOworfQotLSAKMS43LjYu bXN5c2dpdC4wCgo= --0015174413664817cd04b0208b6e Content-Type: application/octet-stream; name="0002-_libssh2_error-tabs-etc.patch" Content-Disposition: attachment; filename="0002-_libssh2_error-tabs-etc.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gu6zth8h1 RnJvbSBiM2YzNThmODM5MGIxN2FhNDU1NDljZGY2MzQ2MTVlNjNjOThhMTFiIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiB1bmtub3duIDxqa292YWNpY0AuKG5vbmUpPgpEYXRlOiBUdWUs IDI1IE9jdCAyMDExIDE2OjIyOjQ1ICswMjAwClN1YmplY3Q6IFtQQVRDSCAyLzJdIF9saWJzc2gy X2Vycm9yLCB0YWJzLCBldGMuCgotLS0KIGRvY3MvbGlic3NoMl9zZXNzaW9uX3N1cHBvcnRlZF9h bGdzLjMgfCAgICA0ICsKIGluY2x1ZGUvbGlic3NoMi5oICAgICAgICAgICAgICAgICAgICAgfCAg ICA0ICstCiBzcmMvY29tcC5jICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAxMCAtLS0K IHNyYy9rZXguYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgMTMxICsrKysrKysrKysr KysrKysrLS0tLS0tLS0tLS0tLS0tLQogNCBmaWxlcyBjaGFuZ2VkLCA3MiBpbnNlcnRpb25zKCsp LCA3NyBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9kb2NzL2xpYnNzaDJfc2Vzc2lvbl9zdXBw b3J0ZWRfYWxncy4zIGIvZG9jc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b3BlciBudW1iZXIgb2YgcG9pbnRlcnMgY29waWVkPyAodGVzdCB0aGUg Y29kZSBhYm92ZSkgKi8KLQlpZiAoIGohPWlhbGcgKQotCXsKLQkJLyogZGVhbGxvY2F0ZSBidWZm ZXIgKi8KLQkJTElCU1NIMl9GUkVFKHNlc3Npb24sICphbGdzKTsKLQkJKmFsZ3MgPSBOVUxMOwot Ci0JCXJldHVybiBMSUJTU0gyX0VSUk9SX0JBRF9VU0U7Ci0JfQorICAgIC8qIGNvcHkgbm9uLU5V TEwgcG9pbnRlcnMgb25seSAqLworICAgIGZvciAoIGk9MCwgaj0wOyBOVUxMIT1tbGlzdFtpXSAm JiBqPGlhbGc7IGkrKyApCisgICAgeworICAgICAgICBpZiAoIE5VTEw9PW1saXN0W2ldLT5uYW1l ICkKKyAgICAgICAgeworICAgICAgICAgICAgLyogbWF5YmUgYSB3ZWlyZCBzaXR1YXRpb24gYnV0 IGlmIGl0IG9jY3VycywgZG8gbm90IGluY2x1ZGUgTlVMTCBwb2ludGVycyAqLworICAgICAgICAg ICAgY29udGludWU7CisgICAgICAgIH0KKworICAgICAgICAvKiBub3RlIHRoYXQgW10gaGFzIGhp Z2hlciBwcmlvcml0eSB0aGFuICogKGRlcmVmZXJlbmNpbmcpICovCisgICAgICAgICgqYWxncylb aisrXSA9IG1saXN0W2ldLT5uYW1lOworICAgIH0KKworICAgIC8qIGNvcnJlY3QgbnVtYmVyIG9m IHBvaW50ZXJzIGNvcGllZD8gKHRlc3QgdGhlIGNvZGUgYWJvdmUpICovCisgICAgaWYgKCBqIT1p YWxnICkKKyAgICB7CisgICAgICAgIC8qIGRlYWxsb2NhdGUgYnVmZmVyICovCisgICAgICAgIExJ QlNTSDJfRlJFRShzZXNzaW9uLCAqYWxncyk7CisgICAgICAgICphbGdzID0gTlVMTDsKKworICAg ICAgICByZXR1cm4gX2xpYnNzaDJfZXJyb3Ioc2Vzc2lvbiwgTElCU1NIMl9FUlJPUl9CQURfVVNF LCAiSW50ZXJuYWwgZXJyb3IiKTsKKyAgICB9CiAKICAgICByZXR1cm4gaWFsZzsKIH0KLS0gCjEu Ny42Lm1zeXNnaXQuMAoK --0015174413664817cd04b0208b6e Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --0015174413664817cd04b0208b6e-- From libssh2-devel-bounces@cool.haxx.se Wed Oct 26 00:05:33 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9PM5ASB018234; Wed, 26 Oct 2011 00:05:30 +0200 Received: from giant.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9PM57hU018216 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 26 Oct 2011 00:05:07 +0200 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id p9PM5783018212 for ; Wed, 26 Oct 2011 00:05:07 +0200 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Wed, 26 Oct 2011 00:05:07 +0200 (CEST) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: Patch to ticket 228 In-Reply-To: Message-ID: References: <20110929002526.3146.qmail@stuge.se> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-fromdanielhimself: yes MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1129329158-564414393-1319580307=:18671" X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1129329158-564414393-1319580307=:18671 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Tue, 25 Oct 2011, Jernej Kovacic wrote: > Now I have modified the function to call _libssh2_error(), converted tabs to > spaces (hopefully none have remained) and reverted the changes in comp.c. I > have also added a few important lines into the doc. file to ensure that the > function will be used properly when "asked" for compression methods. This is better but I still wish you'd pay more attention to: trailing white space, source code style and line lengths. You also modified some unrelated lines. See the attachment here for my edited version showing my points. I'll commit this within shortly and then we can continue polishing it based on what we have in git. I only have one comment left here: 'char ***arg' is a really unfortunate argument type. I bet that will scare weak-hearted users really good. The least we can do is to offer an example in the man page showing how to use it... -- / daniel.haxx.se --1129329158-564414393-1319580307=:18671 Content-Type: TEXT/x-diff; name=0001-libssh2_session_supported_algs-added.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=0001-libssh2_session_supported_algs-added.patch RnJvbSBmNGU1Y2EyZjE0NDRmOWRiNTA4ODY2NDBhYzAzZTc4MjVkNWE1ZjJl IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogSmVybmVqIEtvdmFj aWMgPGprb3ZhY2ljQGdtYWlsLmNvbT4NCkRhdGU6IFR1ZSwgMjUgT2N0IDIw MTEgMjM6NTA6NDQgKzAyMDANClN1YmplY3Q6IFtQQVRDSF0gbGlic3NoMl9z ZXNzaW9uX3N1cHBvcnRlZF9hbGdzOiBhZGRlZA0KDQotLS0NCiBkb2NzL01h a2VmaWxlLmFtICAgICAgICAgICAgICAgICAgICAgIHwgICAgMSArDQogZG9j cy9saWJzc2gyX3Nlc3Npb25fc3VwcG9ydGVkX2FsZ3MuMyB8ICAgNDggKysr KysrKysrKysrKysNCiBpbmNsdWRlL2xpYnNzaDIuaCAgICAgICAgICAgICAg ICAgICAgIHwgICAxNiArKysrKy0NCiBzcmMva2V4LmMgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHwgIDExM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iBtYWdpYyBzdG9yZWQgYnkgdGhlIGxp YnJhcnkgKi8NCi0gICAgdm9pZCAqbm9kZTsJICAgIC8qIGhhbmRsZSB0byB0 aGUgaW50ZXJuYWwgcmVwcmVzZW50YXRpb24gb2Yga2V5ICovDQorICAgIHZv aWQgKm5vZGU7ICAgICAvKiBoYW5kbGUgdG8gdGhlIGludGVybmFsIHJlcHJl c2VudGF0aW9uIG9mIGtleSAqLw0KICAgICB1bnNpZ25lZCBjaGFyICpibG9i OyAgICAgICAgICAgLyogcHVibGljIGtleSBibG9iICovDQogICAgIHNpemVf dCBibG9iX2xlbjsgICAgICAgICAgICAgICAvKiBsZW5ndGggb2YgdGhlIHB1 YmxpYyBrZXkgYmxvYiAqLw0KICAgICBjaGFyICpjb21tZW50OyAgICAgICAg ICAgICAgICAgLyogY29tbWVudCBpbiBwcmludGFibGUgZm9ybWF0ICovDQpk aWZmIC0tZ2l0IGEvc3JjL2tleC5jIGIvc3JjL2tleC5jDQppbmRleCBkMjZi NWYzLi42ZDJlMzFlIDEwMDY0NA0KLS0tIGEvc3JjL2tleC5jDQorKysgYi9z cmMva2V4LmMNCkBAIC0xODk2LDMgKzE4OTYsMTEzIEBAIGxpYnNzaDJfc2Vz c2lvbl9tZXRob2RfcHJlZihMSUJTU0gyX1NFU1NJT04gKiBzZXNzaW9uLCBp bnQgbWV0aG9kX3R5cGUsDQogICAgIHJldHVybiAwOw0KIH0NCiANCisvKg0K KyAqIGxpYnNzaDJfc2Vzc2lvbl9zdXBwb3J0ZWRfYWxncygpDQorICogcmV0 dXJucyBhIG51bWJlciBvZiByZXR1cm5lZCBhbGdvcml0aG1zIChhIHBvc2l0 aXZlIG51bWJlcikgb24gc3VjY2VzcywNCisgKiBhIG5lZ2F0aXZlIG51bWJl ciBvbiBmYWlsdXJlDQorICovDQorDQorTElCU1NIMl9BUEkgaW50IGxpYnNz aDJfc2Vzc2lvbl9zdXBwb3J0ZWRfYWxncyhMSUJTU0gyX1NFU1NJT04qIHNl c3Npb24sDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBpbnQgbWV0aG9kX3R5cGUsDQorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyKioq IGFsZ3MpDQorew0KKyAgICB1bnNpZ25lZCBpbnQgaTsNCisgICAgdW5zaWdu ZWQgaW50IGo7DQorICAgIHVuc2lnbmVkIGludCBpYWxnOw0KKyAgICBjb25z dCBMSUJTU0gyX0NPTU1PTl9NRVRIT0QgKiptbGlzdDsNCisNCisgICAgLyog dG8gcHJldmVudCBjb3JlZHVtcHMgZHVlIHRvIGRlcmVmZXJlbmNpbmcgb2Yg TlVMTCAqLw0KKyAgICBpZiAoTlVMTCA9PSBhbGdzKQ0KKyAgICAgICAgcmV0 dXJuIF9saWJzc2gyX2Vycm9yKHNlc3Npb24sIExJQlNTSDJfRVJST1JfQkFE X1VTRSwNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiYWxncyBt dXN0IG5vdCBiZSBOVUxMIik7DQorDQorICAgIHN3aXRjaCAobWV0aG9kX3R5 cGUpIHsNCisgICAgY2FzZSBMSUJTU0gyX01FVEhPRF9LRVg6DQorICAgICAg ICBtbGlzdCA9IChjb25zdCBMSUJTU0gyX0NPTU1PTl9NRVRIT0QgKiopIGxp YnNzaDJfa2V4X21ldGhvZHM7DQorICAgICAgICBicmVhazsNCisNCisgICAg Y2FzZSBMSUJTU0gyX01FVEhPRF9IT1NUS0VZOg0KKyAgICAgICAgbWxpc3Qg PSAoY29uc3QgTElCU1NIMl9DT01NT05fTUVUSE9EICoqKSBsaWJzc2gyX2hv c3RrZXlfbWV0aG9kcygpOw0KKyAgICAgICAgYnJlYWs7DQorDQorICAgIGNh c2UgTElCU1NIMl9NRVRIT0RfQ1JZUFRfQ1M6DQorICAgIGNhc2UgTElCU1NI Ml9NRVRIT0RfQ1JZUFRfU0M6DQorICAgICAgICBtbGlzdCA9IChjb25zdCBM SUJTU0gyX0NPTU1PTl9NRVRIT0QgKiopIGxpYnNzaDJfY3J5cHRfbWV0aG9k cygpOw0KKyAgICAgICAgYnJlYWs7DQorDQorICAgIGNhc2UgTElCU1NIMl9N RVRIT0RfTUFDX0NTOg0KKyAgICBjYXNlIExJQlNTSDJfTUVUSE9EX01BQ19T QzoNCisgICAgICAgIG1saXN0ID0gKGNvbnN0IExJQlNTSDJfQ09NTU9OX01F VEhPRCAqKikgX2xpYnNzaDJfbWFjX21ldGhvZHMoKTsNCisgICAgICAgIGJy ZWFrOw0KKw0KKyAgICBjYXNlIExJQlNTSDJfTUVUSE9EX0NPTVBfQ1M6DQor ICAgIGNhc2UgTElCU1NIMl9NRVRIT0RfQ09NUF9TQzoNCisgICAgICAgIG1s aXN0ID0gKGNvbnN0IExJQlNTSDJfQ09NTU9OX01FVEhPRCAqKikgX2xpYnNz aDJfY29tcF9tZXRob2RzKHNlc3Npb24pOw0KKyAgICAgICAgYnJlYWs7DQor DQorICAgIGRlZmF1bHQ6DQorICAgICAgICByZXR1cm4gX2xpYnNzaDJfZXJy b3Ioc2Vzc2lvbiwgTElCU1NIMl9FUlJPUl9NRVRIT0RfTk9UX1NVUFBPUlRF RCwNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVW5rbm93biBt ZXRob2QgdHlwZSIpOw0KKyAgICB9ICAvKiBzd2l0Y2ggKi8NCisNCisgICAg Lyogd2VpcmQgc2l0dWF0aW9uICovDQorICAgIGlmIChOVUxMPT1tbGlzdCkN CisgICAgICAgIHJldHVybiBfbGlic3NoMl9lcnJvcihzZXNzaW9uLCBMSUJT U0gyX0VSUk9SX0lOVkFMLA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICJObyBhbGdvcml0aG0gZm91bmQiKTsNCisNCisgICAgLyoNCisgICAg ICBtbGlzdCBpcyBsb29wZWQgdGhyb3VnaCB0d2ljZS4gVGhlIGZpcnN0IHRp bWUgdG8gZmluZCB0aGUgbnVtY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IGlmICgwPT1pYWxnKQ0KKyAg ICAgICAgcmV0dXJuIF9saWJzc2gyX2Vycm9yKHNlc3Npb24sIExJQlNTSDJf RVJST1JfSU5WQUwsDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg Ik5vIGFsZ29yaXRobSBmb3VuZCIpOw0KKw0KKyAgICAvKiBhbGxvY2F0ZSBi dWZmZXIgKi8NCisgICAgKmFsZ3MgPSAoY29uc3QgY2hhcioqKSBMSUJTU0gy X0FMTE9DKHNlc3Npb24sIGlhbGcqc2l6ZW9mKGNvbnN0IGNoYXIqKSk7DQor ICAgIGlmICggTlVMTD09KmFsZ3MgKSB7DQorICAgICAgICByZXR1cm4gX2xp YnNzaDJfZXJyb3Ioc2Vzc2lvbiwgTElCU1NIMl9FUlJPUl9BTExPQywNCisg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiTWVtb3J5IGFsbG9jYXRp b24gZmFpbGVkIik7DQorICAgIH0NCisgICAgLyogUGFzdCB0aGlzIHBvaW50 ICphbGdzIG11c3QgYmUgZGVhbGxvY2F0ZWQgaW4gY2FzZSBvZiBhbiBlcnJv ciEhICovDQorDQorICAgIC8qIGNvcHkgbm9uLU5VTEwgcG9pbnRlcnMgb25s eSAqLw0KKyAgICBmb3IgKCBpPTAsIGo9MDsgTlVMTCE9bWxpc3RbaV0gJiYg ajxpYWxnOyBpKysgKSB7DQorICAgICAgICBpZiAoIE5VTEw9PW1saXN0W2ld LT5uYW1lICl7DQorICAgICAgICAgICAgLyogbWF5YmUgYSB3ZWlyZCBzaXR1 YXRpb24gYnV0IGlmIGl0IG9jY3VycywgZG8gbm90IGluY2x1ZGUgTlVMTA0K KyAgICAgICAgICAgICAgIHBvaW50ZXJzICovDQorICAgICAgICAgICAgY29u dGludWU7DQorICAgICAgICB9DQorDQorICAgICAgICAvKiBub3RlIHRoYXQg W10gaGFzIGhpZ2hlciBwcmlvcml0eSB0aGFuICogKGRlcmVmZXJlbmNpbmcp ICovDQorICAgICAgICAoKmFsZ3MpW2orK10gPSBtbGlzdFtpXS0+bmFtZTsN CisgICAgfQ0KKw0KKyAgICAvKiBjb3JyZWN0IG51bWJlciBvZiBwb2ludGVy cyBjb3BpZWQ/ICh0ZXN0IHRoZSBjb2RlIGFib3ZlKSAqLw0KKyAgICBpZiAo IGohPWlhbGcgKSB7DQorICAgICAgICAvKiBkZWFsbG9jYXRlIGJ1ZmZlciAq Lw0KKyAgICAgICAgTElCU1NIMl9GUkVFKHNlc3Npb24sICphbGdzKTsNCisg ICAgICAgICphbGdzID0gTlVMTDsNCisNCisgICAgICAgIHJldHVybiBfbGli c3NoMl9lcnJvcihzZXNzaW9uLCBMSUJTU0gyX0VSUk9SX0JBRF9VU0UsDQor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkludGVybmFsIGVycm9y Iik7DQorICAgIH0NCisNCisgICAgcmV0dXJuIGlhbGc7DQorfQ0KLS0gDQox LjcuNw0KDQo= --1129329158-564414393-1319580307=:18671 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --1129329158-564414393-1319580307=:18671-- From libssh2-devel-bounces@cool.haxx.se Wed Oct 26 01:06:26 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9PN692V020737; Wed, 26 Oct 2011 01:06:25 +0200 Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9PN67GC020733 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 26 Oct 2011 01:06:07 +0200 Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1]) by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id p9PN66TG014182 for ; Tue, 25 Oct 2011 23:06:08 GMT Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged)) by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id p9PN65xf008999 for ; Wed, 26 Oct 2011 01:06:05 +0200 Subject: Re: Patch to ticket 228 From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= To: libssh2 development Date: Wed, 26 Oct 2011 01:06:05 +0200 In-Reply-To: References: <20110929002526.3146.qmail@stuge.se> X-Mailer: Evolution 3.0.3 (3.0.3-1.fc15) Message-ID: <1319583965.31519.59.camel@henriknordstrom.net> Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]); Tue, 25 Oct 2011 23:06:08 +0000 (UTC) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se ons 2011-10-26 klockan 00:05 +0200 skrev Daniel Stenberg: > I only have one comment left here: 'char ***arg' is a really unfortunate > argument type. I bet that will scare weak-hearted users really good. The least > we can do is to offer an example in the man page showing how to use it... It may look scary in the prototype, but normal usage would be const char **methods; n = libssh2_session_supported_algs(session, type, &methods) .... methods[0], .... methods[1], ... methods[n] libssh2_free(session, methods); which is fairly normal. using *** in the calling code would surely result in confusion. Other comments For consistency libssh2_kex_methods should be turned into a function like how the other types works. Not 100% part of this patch but tightly related. Can there really be NULL names within method lists? I do not think so. kex.c has many loops over these method lists and none skips over NULL names like done here. Some ends on NULL names, some assumes name is alway valid. kex_get_method_by_name() assumes ->name is always valid and would crash if there is a NULL ->name. kex_method_strlen() and kex_method_list() truncates the result if ->name is NULL, and these are used by kexinit to translate the lists into string lists for the wire protocol. Regards Henrik _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Wed Oct 26 01:34:19 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9PNYBp2030664; Wed, 26 Oct 2011 01:34:19 +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-2) with SMTP id p9PNYAt3030656 for ; Wed, 26 Oct 2011 01:34:10 +0200 Received: (qmail 16123 invoked by uid 501); 25 Oct 2011 23:34:11 -0000 Message-ID: <20111025233411.16122.qmail@stuge.se> Date: Wed, 26 Oct 2011 01:34:11 +0200 From: Peter Stuge To: libssh2 development Subject: Re: Patch to ticket 228 Mail-Followup-To: libssh2 development References: <20110929002526.3146.qmail@stuge.se> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Jernej Kovacic wrote: > There are two files attached. The first is (should be) the same as in > previous post, the second is relative to it. Maybe this could be done > better but I am not very familiar with Git :( When these two commits are the last on a local branch you can run: git rebase -i HEAD^^ to open a rebase script. Change the second pick to fixup, and that commit will be integrated into the previous one. See also http://progit.org/book/ch6-4.html and man git-rebase and feel free to ask if you have questions. We are also on IRC in #libssh2 on irc.freenode.net. For the commit message, please note that you should reference the ticket as described on http://trac.libssh2.org/wiki/Development Daniel Stenberg wrote: > I only have one comment left here: 'char ***arg' is a really > unfortunate argument type. I bet that will scare weak-hearted users > really good. The least we can do is to offer an example in the man > page showing how to use it... I would favor using ** and taking a length parameter, so that we work toward less malloc within libssh2 instead of more. //Peter _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Fri Oct 28 02:24:53 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9S0ORLB008544; Fri, 28 Oct 2011 02:24:48 +0200 Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9S0OPZ1008513 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Fri, 28 Oct 2011 02:24:26 +0200 Received: by vws11 with SMTP id 11so3722457vws.41 for ; Thu, 27 Oct 2011 17:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=0IQP2OVchB3GRKN7pbZ6j2O3IzbkRDJbKZDPUWBnoy4=; b=JKwrmUnVpeCbUwIpYkx1FhE47nEWHxC2gOJMyTtezAykgArdmjfXEKLzrmbsWazZxt aOW4MM695wV4i+KzjEoKoLOXLL2L+ZRQh73RexYs7PO+ZgnYBRURAhIAOPbe6M/s/pVz bgtyIoBwFVsw9QrYcMXrj3h6rG3kJXM8zvv24= MIME-Version: 1.0 Received: by 10.52.20.33 with SMTP id k1mr99716vde.12.1319761460322; Thu, 27 Oct 2011 17:24:20 -0700 (PDT) Received: by 10.52.162.201 with HTTP; Thu, 27 Oct 2011 17:24:20 -0700 (PDT) Date: Thu, 27 Oct 2011 17:24:20 -0700 X-Google-Sender-Auth: Tv-_pUFoPBupEDpU6GtI4AEFxyA Message-ID: Subject: libssh2_session_free changes nonblock state of already unused fd From: Pavel Strashkin To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Hello, Despite the fact that i write here, i don't use libssh2 directly, but Net::SSH2 (Perl). As most of you knows, Perl has GC which sometimes doesn't delete an object "right now and right here". There is no strict order. What happened to me is that i had one session (socket fd = 3) which was closed by server side so i handled it and closed everything on my side (sockets, ...). Net::SSH2 wrapper around the session had not been deleted yet so libssh2_session_free had not been called either. After that i created a new one session which had been given with the same socket fd = 3 as previous one just because previous one is closed already and the system re-used the number (OS or Perl, don't know). libssh2 changed nonblock state to TRUE at this point. Most interesting part had started: when new one session had been successfully initiated and channel was created, GC made the devil's deal - it called destroy for previous object which called libssh2_session_free which had set nonblock for fd = 3 to FALSE. Uppps! I can't manage the GC work. I don't have cross-references or so on. It just how script languages works. I think libssh2 should never touch nonblock state or, at least, should set it to TRUE and forget about it till the end (i.e. nothing should happen inside libssh2_session_free). Probably, it should be up to libssh2 user which one IO mode to use - async or blocking. Ideas? Thank you. _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Fri Oct 28 09:35:28 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9S7ZAGj009346; Fri, 28 Oct 2011 09:35:25 +0200 Received: from giant.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9S7Z8WE009326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 28 Oct 2011 09:35:08 +0200 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id p9S7Z8UG009322 for ; Fri, 28 Oct 2011 09:35:08 +0200 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Fri, 28 Oct 2011 09:35:08 +0200 (CEST) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: libssh2_session_free changes nonblock state of already unused fd In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-fromdanielhimself: yes MIME-Version: 1.0 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On Thu, 27 Oct 2011, Pavel Strashkin wrote: > What happened to me is that i had one session (socket fd = 3) which was > closed by server side so i handled it and closed everything on my side > (sockets, ...). Net::SSH2 wrapper around the session had not been deleted > yet so libssh2_session_free had not been called either. Right, and here's the problem. You handed over the control of the socket to libssh2, and then you closed it behind its back... > I think libssh2 should never touch nonblock state or, at least, should set > it to TRUE and forget about it till the end (i.e. nothing should happen > inside libssh2_session_free). The basic principles: 1. the socket is handed over to libssh2 to handle when doing SSH operations 2. libssh2 owns the socket as long as you haven't told it properly that you're done and want control back 3. when libssh2 stops controlling the socket, it restores the original blocking state of the socket so that to the application that passed in the socket in step (1) it won't be any surprise I don't think just skipping the restoring of the blocking state in step 3 is going to save you. When you fiddle with the socket before libssh2 has been told to give it up, you're out on very thin ice. We can't guarantee that libssh2 won't have to do some other little thing on the socket before it returns out and you as a user of libssh2 must not assume otherwise. Or am I wrong? -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Fri Oct 28 10:11:21 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9S8BCw6031735; Fri, 28 Oct 2011 10:11:20 +0200 Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9S8B9er031703 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Fri, 28 Oct 2011 10:11:10 +0200 Received: by vws11 with SMTP id 11so3885878vws.41 for ; Fri, 28 Oct 2011 01:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=H9FjeKHwO8pCH/O3m1UvaSiQB6tVrac3q1HEARLqIQE=; b=tG1SsXUCJlH+nAMwpZWOlGpVxtKi/pBysDpyQebtQb0o1UlL4MTxe2bN+0hBTPgDhB SDJBsyskBnxHczzrY4t1GxAQbwBKxqmlDS4CONZywIr1Uw1pYZkLOpBDLphAhFovQW1Y eF8uBPX4RNAJjo4jCuH8HcoYzyhbv1k7U32R4= MIME-Version: 1.0 Received: by 10.52.20.33 with SMTP id k1mr429512vde.12.1319789464405; Fri, 28 Oct 2011 01:11:04 -0700 (PDT) Received: by 10.52.162.201 with HTTP; Fri, 28 Oct 2011 01:11:04 -0700 (PDT) In-Reply-To: References: Date: Fri, 28 Oct 2011 01:11:04 -0700 X-Google-Sender-Auth: kKg9gI159GeaD2I3lKU8w41FiLE Message-ID: Subject: Re: libssh2_session_free changes nonblock state of already unused fd From: Pavel Strashkin To: libssh2 development X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9S8B9er031703 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9S8BCw6031735 You're correct, but as i said we have the deal with a Perl, Python, whatever else that has GC which doesn't guarantee anything to you. An object can be destroyed at an time. In this world you should you take care of it too (in case if it happens). My point here (no hacks, no workarounds) is that you shouldn't change IO from blocking to async. You have the stream (socket) and the only thing which you should have to do is just send and recv. How it happens - async or blocking - is not up to library. I mean you have to support both cases as you do already, but you don't have to change the mode. Leave it to library's user. This small change will make life easier i believe. Right now, to cheat against Perl's GC, i create a new session before close a previous one. I don't like it. Just recv or send. Will it block or not - doesn't matter. User decides. 2011/10/28 Daniel Stenberg : > On Thu, 27 Oct 2011, Pavel Strashkin wrote: > >> What happened to me is that i had one session (socket fd = 3) which was >> closed by server side so i handled it and closed everything on my side >> (sockets, ...). Net::SSH2 wrapper around the session had not been deleted >> yet so libssh2_session_free had not been called either. > > Right, and here's the problem. You handed over the control of the socket to > libssh2, and then you closed it behind its back... > >> I think libssh2 should never touch nonblock state or, at least, should set >> it to TRUE and forget about it till the end (i.e. nothing should happen >> inside libssh2_session_free). > > The basic principles: > > 1. the socket is handed over to libssh2 to handle when doing SSH operations > > 2. libssh2 owns the socket as long as you haven't told it properly that > you're >   done and want control back > > 3. when libssh2 stops controlling the socket, it restores the original >   blocking state of the socket so that to the application that passed in the >   socket in step (1) it won't be any surprise > > I don't think just skipping the restoring of the blocking state in step 3 is > going to save you. When you fiddle with the socket before libssh2 has been > told to give it up, you're out on very thin ice. We can't guarantee that > libssh2 won't have to do some other little thing on the socket before it > returns out and you as a user of libssh2 must not assume otherwise. > > Or am I wrong? > > -- > >  / daniel.haxx.se > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel > _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Fri Oct 28 11:37:13 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9S9awKR018687; Fri, 28 Oct 2011 11:37:12 +0200 Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9S9avxt018674 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Fri, 28 Oct 2011 11:36:57 +0200 Received: by faar19 with SMTP id r19so4808391faa.41 for ; Fri, 28 Oct 2011 02:36:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-type:message-id :content-transfer-encoding:x-mailer:from:subject:date:to; bh=5u9sgboWHwwzoCSfBJtpednmPKJBfeDafuKX00nG2Jc=; b=HCkkYQoMXPZFCKmqIHUpOzrIV3gnPRvt9/aDPTFWN1tubtgJsWxWP7qymYfIWkV02b q7UbHvKGfSKZrikJ5Ojo6U4aJqjdbPoZfjPjQv5NNoVYwOnHRV3TwAzH9h5kL8EVt4mk nh1Xsm95vtm5T07dzaPtFtLtF1/rm5/EbDDmw= Received: by 10.223.58.146 with SMTP id g18mr4955895fah.13.1319794612912; Fri, 28 Oct 2011 02:36:52 -0700 (PDT) Received: from [192.116.107.71] ([192.116.107.71]) by mx.google.com with ESMTPS id w7sm16476350fab.6.2011.10.28.02.36.50 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 28 Oct 2011 02:36:51 -0700 (PDT) References: In-Reply-To: Mime-Version: 1.0 (1.0) Message-Id: <17BC502F-5F03-4F81-B9B9-49198C28CBE6@gmail.com> X-Mailer: iPhone Mail (9A334) From: Steven Ayre Subject: Re: libssh2_session_free changes nonblock state of already unused fd Date: Fri, 28 Oct 2011 11:36:48 +0200 To: libssh2 development X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9S9avxt018674 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se If you close the socket you should let libssh2 do that for you. Don't do it yourself. There is a libssh2_disconnect function that will send the disconnect SSH message and close the socket. Instead of closing the socket yourself you should be calling that. Net::SSH2 exposes that as the disconnect method. Use it! Destroying the Net::SSH2 object by garbage collection is only for reclaiming the memory - not closing the connection, the disconnect method lets you do that earlier exactly when you want to. Steve on iPhone On 28 Oct 2011, at 10:11, Pavel Strashkin wrote: > You're correct, but as i said we have the deal with a Perl, Python, > whatever else that has GC which doesn't guarantee anything to you. An > object can be destroyed at an time. In this world you should you take > care of it too (in case if it happens). My point here (no hacks, no > workarounds) is that you shouldn't change IO from blocking to async. > You have the stream (socket) and the only thing which you should have > to do is just send and recv. How it happens - async or blocking - is > not up to library. I mean you have to support both cases as you do > already, but you don't have to change the mode. Leave it to library's > user. This small change will make life easier i believe. Right now, to > cheat against Perl's GC, i create a new session before close a > previous one. I don't like it. Just recv or send. Will it block or not > - doesn't matter. User decides. > > 2011/10/28 Daniel Stenberg : >> On Thu, 27 Oct 2011, Pavel Strashkin wrote: >> >>> What happened to me is that i had one session (socket fd = 3) which was >>> closed by server side so i handled it and closed everything on my side >>> (sockets, ...). Net::SSH2 wrapper around the session had not been deleted >>> yet so libssh2_session_free had not been called either. >> >> Right, and here's the problem. You handed over the control of the socket to >> libssh2, and then you closed it behind its back... >> >>> I think libssh2 should never touch nonblock state or, at least, should set >>> it to TRUE and forget about it till the end (i.e. nothing should happen >>> inside libssh2_session_free). >> >> The basic principles: >> >> 1. the socket is handed over to libssh2 to handle when doing SSH operations >> >> 2. libssh2 owns the socket as long as you haven't told it properly that >> you're >> done and want control back >> >> 3. when libssh2 stops controlling the socket, it restores the original >> blocking state of the socket so that to the application that passed in the >> socket in step (1) it won't be any surprise >> >> I don't think just skipping the restoring of the blocking state in step 3 is >> going to save you. When you fiddle with the socket before libssh2 has been >> told to give it up, you're out on very thin ice. We can't guarantee that >> libssh2 won't have to do some other little thing on the socket before it >> returns out and you as a user of libssh2 must not assume otherwise. >> >> Or am I wrong? >> >> -- >> >> / daniel.haxx.se >> _______________________________________________ >> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel >> > > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Fri Oct 28 11:42:30 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9S9gRJa024549; Fri, 28 Oct 2011 11:42:30 +0200 Received: from giant.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9S9gQgK024522 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 28 Oct 2011 11:42:26 +0200 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id p9S9gPR7024513 for ; Fri, 28 Oct 2011 11:42:25 +0200 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Fri, 28 Oct 2011 11:42:25 +0200 (CEST) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: libssh2_session_free changes nonblock state of already unused fd In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-fromdanielhimself: yes MIME-Version: 1.0 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On Fri, 28 Oct 2011, Pavel Strashkin wrote: > You're correct, but as i said we have the deal with a Perl, Python, whatever > else that has GC which doesn't guarantee anything to you. An object can be > destroyed at an time. It guarantees a lot and please don't come blaming the language for this bug. The socket is not yours to close as long as you've handed it over to libssh2 so doing so is a bug. perl certainly doesn't force you to. Do you need to make some extra little quirk or precaution to make sure this happens correctly? Perhaps. But this way of working is very common in transfer libraries written in C so this is certainly not the first time and it is not the first perl binding that needs to solve this problem. Just cleanup the libssh2 handle first, then close the socket. > In this world you should you take care of it too (in case if it happens). My > point here (no hacks, no workarounds) is that you shouldn't change IO from > blocking to async. Why not? You hand over the socket to the library to do SSH operations on it. Why isn't libssh2 then allowed to do things with the socket in ways that allows it to perform as good as possible? What bad does it cause your program if it changes some socket options? > You have the stream (socket) and the only thing which you should have to do > is just send and recv. That's an easy thing to say from an outsider's perspective before you have given the problem and the existing API some proper thought. I'd urge you to read up on the code and the API again and then think again and if you then still believe this to be true, then by all means write a patch and try it out and see for yourself. > How it happens - async or blocking - is not up to library. I mean you have > to support both cases as you do already, No, we don't. We always and unconditionally use the socket set to non-blocking internally and we offer an optionally blocking API on top of that non-blocking socket. > This small change will make life easier i believe. I disagree. This non-blocking issue is what made you notice your bug. You still closed the socket before you told libssh2 to let it go and that was the problem. libssh2 is entitled to do whatever it deems correct with the socket until you've told it to give the socket back. Changing libssh2's treatment of blocking vs non-blocking does not fix your bug. -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Fri Oct 28 11:44:58 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9S9itsL025337; Fri, 28 Oct 2011 11:44:57 +0200 Received: from giant.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9S9ir0L025324 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 28 Oct 2011 11:44:53 +0200 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id p9S9irn5025321 for ; Fri, 28 Oct 2011 11:44:53 +0200 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Fri, 28 Oct 2011 11:44:53 +0200 (CEST) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: libssh2_session_free changes nonblock state of already unused fd In-Reply-To: <17BC502F-5F03-4F81-B9B9-49198C28CBE6@gmail.com> Message-ID: References: <17BC502F-5F03-4F81-B9B9-49198C28CBE6@gmail.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-fromdanielhimself: yes MIME-Version: 1.0 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On Fri, 28 Oct 2011, Steven Ayre wrote: > There is a libssh2_disconnect function that will send the disconnect SSH > message and close the socket. Instead of closing the socket yourself you > should be calling that. That's not correct. libssh2_session_disconnect_ex() exists yes and it disconnects the session SSH-wise, but it doesn't actually call close on the socket. The application created the socket before it handed it over to libssh2 and it is expected to also close the socket once libssh2 has given back control of it. -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Fri Oct 28 12:10:01 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9SA9sH8008694; Fri, 28 Oct 2011 12:10:00 +0200 Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9SA9rTG008677 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Fri, 28 Oct 2011 12:09:53 +0200 Received: by eyd10 with SMTP id 10so4156974eyd.41 for ; Fri, 28 Oct 2011 03:09:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-type:message-id :content-transfer-encoding:x-mailer:from:subject:date:to; bh=TaNGtqZQ5lmg5wYudqLuhdijI7o7Lj6fPw9lJaoP40M=; b=VOXTwzrVijVBl8xK8Ka4KfKA+hjj9sd2iqzlo9aOA4Epk+glFcFcYcHIiTvrXTzo5d cKLXHmIVNO2KER8tlowuKmx0CmOd2kDFN7BybZ0Ie/cQYDJCZ8Pm+cO8FMOAg2AhaZrf dEK4WMECp3BH1Jl3Sn9uhjRGFXlaJ0McRTNJ4= Received: by 10.14.3.163 with SMTP id 35mr170416eeh.186.1319796588994; Fri, 28 Oct 2011 03:09:48 -0700 (PDT) Received: from [192.116.107.71] ([192.116.107.71]) by mx.google.com with ESMTPS id e62sm23102594eee.10.2011.10.28.03.09.47 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 28 Oct 2011 03:09:48 -0700 (PDT) References: <17BC502F-5F03-4F81-B9B9-49198C28CBE6@gmail.com> In-Reply-To: Mime-Version: 1.0 (1.0) Message-Id: X-Mailer: iPhone Mail (9A334) From: Steven Ayre Subject: Re: libssh2_session_free changes nonblock state of already unused fd Date: Fri, 28 Oct 2011 12:09:45 +0200 To: libssh2 development X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9SA9rTG008677 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Oh ok, my mistake then. Steve on iPhone On 28 Oct 2011, at 11:44, Daniel Stenberg wrote: > On Fri, 28 Oct 2011, Steven Ayre wrote: > >> There is a libssh2_disconnect function that will send the disconnect SSH message and close the socket. Instead of closing the socket yourself you should be calling that. > > That's not correct. libssh2_session_disconnect_ex() exists yes and it disconnects the session SSH-wise, but it doesn't actually call close on the socket. > > The application created the socket before it handed it over to libssh2 and it is expected to also close the socket once libssh2 has given back control of it. > > -- > > / daniel.haxx.se > _______________________________________________ > libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 10:39:54 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9V9dTJe020185; Mon, 31 Oct 2011 10:39:51 +0100 Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9V9dQm2020153 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 31 Oct 2011 10:39:27 +0100 Received: by qadz32 with SMTP id z32so5634738qad.41 for ; Mon, 31 Oct 2011 02:39:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=7ycBy97zqIuuIIzmUb4ZIKmrEMuqAXM6jStOtLCJz5c=; b=fX2Ey1dlb7DoqWhUcUl9tHfffYYFrjrXfcUReNx6Ro7dsYw43m24nt/mftukKdRjBz uIgoU3HDQirwv7mptkH2fuiU2cIvyOb9/DQJz+A1SeIjm+93wRPY4k4532J+t34ntDW5 Z8KrQeoN/9V6Y1bMfq1QQ6KXlL9hfKwQpqVag= MIME-Version: 1.0 Received: by 10.224.176.200 with SMTP id bf8mr11314036qab.91.1320053960478; Mon, 31 Oct 2011 02:39:20 -0700 (PDT) Received: by 10.224.67.207 with HTTP; Mon, 31 Oct 2011 02:39:20 -0700 (PDT) Date: Mon, 31 Oct 2011 10:39:20 +0100 Message-ID: Subject: compilation error when cross compiling on linux to Windows From: Vincent Torri To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0283951963==" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --===============0283951963== Content-Type: multipart/alternative; boundary=20cf302d4cdc66115c04b09503aa --20cf302d4cdc66115c04b09503aa Content-Type: text/plain; charset=ISO-8859-1 Hey, when cross compiling to Windows, libssh2.h include Windows header files with upper case filenames : BaseTsd.h and WinSock2.h. These files have lowercase names with mingw-w64 (iirc, it's the same with mingw). And as on Windows, being lowercase or uppercase does not matter, I think that the following patch should work everywhere: --- ./include/libssh2.h 2011-09-06 22:56:34.000000000 +0200 +++ ../libssh2-1.3.0_new/include/libssh2.h 2011-10-31 10:34:11.000000000 +0100 @@ -88,8 +88,8 @@ extern "C" { #endif #ifdef _WIN32 -# include -# include +# include +# include #endif #include regards Vincent Torri --20cf302d4cdc66115c04b09503aa Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hey,

when cross compiling to Windows, libssh2.h include Windows head= er files with upper case filenames : BaseTsd.h and WinSock2.h.

These= files have lowercase names with mingw-w64 (iirc, it's the same with mi= ngw). And as on Windows, being lowercase or uppercase does not matter, I th= ink that the following patch should work everywhere:

--- ./include/libssh2.h=A0=A0=A0 2011-09-06 22:56:34.000000000 +0200+++ ../libssh2-1.3.0_new/include/libssh2.h=A0=A0=A0 2011-10-31 10:34:11.00= 0000000 +0100
@@ -88,8 +88,8 @@
=A0extern "C" {
=A0#endi= f
=A0#ifdef _WIN32
-# include <BaseTsd.h>
-# include <WinSock2.h>
+# include= <basetsd.h>
+# include <winsock2.h>
=A0#endif
=A0
= =A0#include <stddef.h>


regards

Vincent Torri
--20cf302d4cdc66115c04b09503aa-- --===============0283951963== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --===============0283951963==-- From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 10:53:59 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9V9rq8C026384; Mon, 31 Oct 2011 10:53:58 +0100 Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9V9rnsP026368 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 31 Oct 2011 10:53:50 +0100 Received: by qadz32 with SMTP id z32so5642512qad.41 for ; Mon, 31 Oct 2011 02:53:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=GNylQKFNce8TTFRtKFRLQe7pBkA4158Cz/dZjZOUDrs=; b=x72bZxKsnmSLKnbqaRS12/6yjNPkI9sQNaiq0o8t0UDtsqk63XA1My1QG1oj9y39+w vWZkz5bmthk4TaxY9z6Y8nwK1iJMtOhqcLeQmArCL/UHyzNkfuzmlo2dTxr0h/KQ9UQ9 RRrbgsZeOO3/kRInwFLAP87cYGTIGHYcqqs/0= MIME-Version: 1.0 Received: by 10.224.194.137 with SMTP id dy9mr11348295qab.65.1320054825184; Mon, 31 Oct 2011 02:53:45 -0700 (PDT) Received: by 10.224.67.207 with HTTP; Mon, 31 Oct 2011 02:53:45 -0700 (PDT) Date: Mon, 31 Oct 2011 10:53:45 +0100 Message-ID: Subject: some warnings when compiling for windows From: Vincent Torri To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1127833847==" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --===============1127833847== Content-Type: multipart/alternative; boundary=20cf300fb503f06c1b04b0953683 --20cf300fb503f06c1b04b0953683 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable hey i get some warnings when cross compiling (i use gcc 4.7.0) : /home/torri/local/opt/mingw-w64-x86_32/bin/../lib/gcc/i686-w64-mingw32/4.7.= 0/../../../../i686-w64-mingw32/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp] and a lot of /opt/efl/include/gcrypt.h:1590:35: warning: =91gcry_*******=92 is deprecate= d [-Wdeprecated-declarations] regards Vincent Torri --20cf300fb503f06c1b04b0953683 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable hey

i get some warnings when cross compiling (i use gcc 4.7.0) :
=
/home/torri/local/opt/mingw-w64-x86_32/bin/../lib/gcc/i686-w64-mingw32/= 4.7.0/../../../../i686-w64-mingw32/include/winsock2.h:15:2: warning: #warni= ng Please include winsock2.h before windows.h [-Wcpp]

and a lot of

/opt/efl/include/gcrypt.h:1590:35: warning: =91gcr= y_*******=92 is deprecated [-Wdeprecated-declarations]

regards
Vincent Torri
--20cf300fb503f06c1b04b0953683-- --===============1127833847== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --===============1127833847==-- From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 11:36:14 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VAa5Bj022576; Mon, 31 Oct 2011 11:36:13 +0100 Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VAa4Bn022571 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 31 Oct 2011 11:36:04 +0100 Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1]) by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id p9VAa3ao017911 for ; Mon, 31 Oct 2011 10:36:04 GMT Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged)) by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id p9VAZxYg007473 for ; Mon, 31 Oct 2011 11:35:59 +0100 Subject: Re: compilation error when cross compiling on linux to Windows From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= To: libssh2 development Date: Mon, 31 Oct 2011 11:35:59 +0100 In-Reply-To: References: X-Mailer: Evolution 3.0.3 (3.0.3-1.fc15) Message-ID: <1320057359.28399.24.camel@henriknordstrom.net> Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]); Mon, 31 Oct 2011 10:36:04 +0000 (UTC) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p9VAa5Bj022576 mÃ¥n 2011-10-31 klockan 10:39 +0100 skrev Vincent Torri: > Hey, > > when cross compiling to Windows, libssh2.h include Windows header > files with upper case filenames : BaseTsd.h and WinSock2.h. applied. Regards Henrik _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 12:41:52 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VBfaMe024267; Mon, 31 Oct 2011 12:41:50 +0100 Received: from giant.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VBfYSM024184 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 31 Oct 2011 12:41:34 +0100 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id p9VBfY6a024172 for ; Mon, 31 Oct 2011 12:41:34 +0100 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Mon, 31 Oct 2011 12:41:34 +0100 (CET) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: some warnings when compiling for windows In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-fromdanielhimself: yes MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1129329158-547337794-1320061294=:8176" X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1129329158-547337794-1320061294=:8176 Content-Type: TEXT/PLAIN; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8BIT On Mon, 31 Oct 2011, Vincent Torri wrote: > warning: #warning Please include winsock2.h before windows.h [-Wcpp] Is there an explanation to this somewhere? I know other libraries that don't do this as well but still seem to work fine on Windows so I'm a bit curious... > /opt/efl/include/gcrypt.h:1590:35: warning: ‘gcry_*******’ is deprecated > [-Wdeprecated-declarations] Surely those can't be "blamed" on us? -- / daniel.haxx.se --1129329158-547337794-1320061294=:8176 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --1129329158-547337794-1320061294=:8176-- From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 13:14:28 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VCEJVT012279; Mon, 31 Oct 2011 13:14:27 +0100 Received: from vps1.henriknordstrom.net (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VCEHeu012265 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 31 Oct 2011 13:14:17 +0100 Received: from henriknordstrom.net ([IPv6:2002:51d8:9fb7::1]) by vps1.henriknordstrom.net (8.14.2/8.14.2/Debian-2build1) with ESMTP id p9VCEGEI009419 for ; Mon, 31 Oct 2011 12:14:18 GMT Received: from [IPv6:::1] (localhost [IPv6:::1] (may be forged)) by henriknordstrom.net (8.12.11.20060308/8.12.8) with ESMTP id p9VCEFqC002156 for ; Mon, 31 Oct 2011 13:14:15 +0100 Subject: Re: some warnings when compiling for windows From: Henrik =?ISO-8859-1?Q?Nordstr=F6m?= To: libssh2 development Date: Mon, 31 Oct 2011 13:14:15 +0100 In-Reply-To: References: X-Mailer: Evolution 3.0.3 (3.0.3-1.fc15) Message-ID: <1320063255.28399.27.camel@henriknordstrom.net> Mime-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (vps1.henriknordstrom.net [IPv6:2a02:750:7::d0a]); Mon, 31 Oct 2011 12:14:18 +0000 (UTC) X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by giant.haxx.se id p9VCEJVT012279 mÃ¥n 2011-10-31 klockan 12:41 +0100 skrev Daniel Stenberg: > > /opt/efl/include/gcrypt.h:1590:35: warning: ‘gcry_*******’ is deprecated > > [-Wdeprecated-declarations] > > Surely those can't be "blamed" on us? Only if it's due to libssh2 using deprecated parts of libgcrypt. What exactly do the warnign say? And which version of libgcrypt are you compiling with? Regards Henrik _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 13:16:35 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VCGV4v013500; Mon, 31 Oct 2011 13:16:35 +0100 Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VCGTMc013447 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 31 Oct 2011 13:16:29 +0100 Received: by qadz32 with SMTP id z32so5758644qad.41 for ; Mon, 31 Oct 2011 05:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=OIj4kZVWqSqJmAVnkKC5pQPzlBnJWLqxCjT9h+1v51E=; b=wyK7bGXkP+QLLoU5C15uF9N4zh025gYNN8tWrW7VyrXKdnErBxBhmGbTf7n/Z88WPt nOqdRew3n8S0Br+YqQb8wDQlGXaby2IZplEGfs2VeKHRpw1U6VO1K4HdxrFMJoEwsO4e 2lXMSQr39uvLv3KBj3WEimQzs/qHjXnwfGT/M= MIME-Version: 1.0 Received: by 10.224.194.137 with SMTP id dy9mr11642960qab.65.1320063384349; Mon, 31 Oct 2011 05:16:24 -0700 (PDT) Received: by 10.224.67.207 with HTTP; Mon, 31 Oct 2011 05:16:24 -0700 (PDT) In-Reply-To: References: Date: Mon, 31 Oct 2011 13:16:24 +0100 Message-ID: Subject: Re: some warnings when compiling for windows From: Vincent Torri To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0486676485==" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --===============0486676485== Content-Type: multipart/alternative; boundary=20cf300fb5031aebb504b09735f6 --20cf300fb5031aebb504b09735f6 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On Mon, Oct 31, 2011 at 12:41 PM, Daniel Stenberg wrote: > On Mon, 31 Oct 2011, Vincent Torri wrote: > > warning: #warning Please include winsock2.h before windows.h [-Wcpp] >> > > Is there an explanation to this somewhere? I know other libraries that > don't do this as well but still seem to work fine on Windows so I'm a bit > curious... http://sourceforge.net/apps/trac/mingw-w64/wiki/winsock2.h%20include%20orde= r /opt/efl/include/gcrypt.h:1590:35: warning: =91gcry_*******=92 is deprecat= ed > [-Wdeprecated-declarations] > Surely those can't be "blamed" on us? > aren't you using deprecated API ? (just a thought, didn't look at the code) Vincent Torri --20cf300fb5031aebb504b09735f6 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable

On Mon, Oct 31, 2011 at 12:41 PM, Daniel= Stenberg <daniel@ha= xx.se> wrote:
On Mon, 31 Oct 2011, Vincent Torri wrote:

warning: #warning Please include winsock2.h before windows.h [-Wcpp]

Is there an explanation to this somewhere? I know other libraries that don&= #39;t do this as well but still seem to work fine on Windows so I'm a b= it curious...

=A0

/opt/efl/include/gcrypt.h:1590:35: warning: =91gcry_*******=92 is deprecate= d
[-Wdeprecated-declarations]

Surely those can't be "blamed" on us?
aren't you using deprecated API ? (just a thought, didn't look at= the code)

Vincent Torri

--20cf300fb5031aebb504b09735f6-- --===============0486676485== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --===============0486676485==-- From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 13:21:20 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VCLF6h017475; Mon, 31 Oct 2011 13:21:20 +0100 Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VCLDt6017259 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 31 Oct 2011 13:21:14 +0100 Received: by vcbfk26 with SMTP id fk26so915221vcb.41 for ; Mon, 31 Oct 2011 05:21:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=9kLuDX4cQ+imI8oT2mE7eWAhVBF+NWPAkRMY+L18zoU=; b=FKHueF+tpHxd98L5UjMXiTXkD4i+g3lnOqC65CHoRbbgE3UPBGODYeTK2oxG5PdDKB s/4qy1+4hwMFQROJw8SLAC4gNfcca3yNdXXVk2QHWjmtMcULrqixdnxEEhzPaZz4UbUg cc/m7xZaTNJ/V85Dl9pXPsXkHQV6CypO9CfrM= MIME-Version: 1.0 Received: by 10.52.97.35 with SMTP id dx3mr2901369vdb.2.1320063668661; Mon, 31 Oct 2011 05:21:08 -0700 (PDT) Received: by 10.52.66.238 with HTTP; Mon, 31 Oct 2011 05:21:08 -0700 (PDT) In-Reply-To: References: Date: Mon, 31 Oct 2011 10:21:08 -0200 Message-ID: Subject: Re: some warnings when compiling for windows From: Ivan Pechorin To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se 2011/10/31 Daniel Stenberg : > On Mon, 31 Oct 2011, Vincent Torri wrote: > >> warning: #warning Please include winsock2.h before windows.h [-Wcpp] > > Is there an explanation to this somewhere? I know other libraries that don't > do this as well but still seem to work fine on Windows so I'm a bit > curious... The official explanation is here: http://msdn.microsoft.com/en-us/library/ms737629(VS.85).aspx "The Winsock2.h header file internally includes core elements from the Windows.h header file, so there is not usually an #include line for the Windows.h header file in Winsock applications. If an #include line is needed for the Windows.h header file, this should be preceded with the #define WIN32_LEAN_AND_MEAN macro. For historical reasons, the Windows.h header defaults to including the Winsock.h header file for Windows Sockets 1.1. The declarations in the Winsock.h header file will conflict with the declarations in the Winsock2.h header file required by Windows Sockets 2.0. The WIN32_LEAN_AND_MEAN macro prevents the Winsock.h from being included by the Windows.h header." So, as far as I understand, the solution is : 1) either include winsock2.h before windows.h 2) or #define WIN32_LEAN_AND_MEAN, then include windows.h, then include winsock2.h Regards, Ivan _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 13:27:58 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VCRoAK022686; Mon, 31 Oct 2011 13:27:58 +0100 Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VCRlss022649 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 31 Oct 2011 13:27:48 +0100 Received: by qadz32 with SMTP id z32so5769174qad.41 for ; Mon, 31 Oct 2011 05:27:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=UXvnc6IkwWYKdrPecMzCpK0GMzAgGafolcs5z78vz80=; b=AhyEWqbQBm/4AGzjhZxBxcab9UCCC+bSwE88IgTr1wnyClsJivAyY9U6eA+E0bRCzc jvungNDG6NO3tlgqU5aYqkHq+5ues9w0orRAD/JendV66zIryLBV1sMMjTcQxytCa838 zVGZ/kJb0aFRdW/niyyqh08bXRZDVndmKum4E= MIME-Version: 1.0 Received: by 10.224.176.11 with SMTP id bc11mr11670763qab.0.1320064062927; Mon, 31 Oct 2011 05:27:42 -0700 (PDT) Received: by 10.224.67.207 with HTTP; Mon, 31 Oct 2011 05:27:42 -0700 (PDT) In-Reply-To: <1320063255.28399.27.camel@henriknordstrom.net> References: <1320063255.28399.27.camel@henriknordstrom.net> Date: Mon, 31 Oct 2011 13:27:42 +0100 Message-ID: Subject: Re: some warnings when compiling for windows From: Vincent Torri To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0153804126==" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --===============0153804126== Content-Type: multipart/alternative; boundary=20cf303b417f8d34f904b0975d52 --20cf303b417f8d34f904b0975d52 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 2011/10/31 Henrik Nordstr=F6m > m=E5n 2011-10-31 klockan 12:41 +0100 skrev Daniel Stenberg: > > > > /opt/efl/include/gcrypt.h:1590:35: warning: =91gcry_*******=92 is > deprecated > > > [-Wdeprecated-declarations] > > > > Surely those can't be "blamed" on us? > > Only if it's due to libssh2 using deprecated parts of libgcrypt. > > What exactly do the warnign say? > 1 example (there are tons of similar messages): /opt/efl/include/gcrypt.h:1512:1: warning: 'gcry_ac_key_t' is deprecated [-Wdeprecated-declarations] > > And which version of libgcrypt are you compiling with? > libgcrypt 1.5.0 regards Vincent Torri --20cf303b417f8d34f904b0975d52 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable

2011/10/31 Henrik Nordstr=F6m <henrik@henriknor= dstrom.net>
m=E5n 2011-10-31 klockan 12:41 +0100 skrev Daniel Stenberg:

> > /opt/efl/include/gcrypt.h:1590:35: warning: =91gcry_*******=92 is= deprecated
> > [-Wdeprecated-declarations]
>
> Surely those can't be "blamed" on us?

Only if it's due to libssh2 using deprecated parts of libgcrypt.<= br>
What exactly do the warnign say?

1 example (there = are tons of similar messages):

/opt/efl/include/gcrypt.h:1512:1: war= ning: 'gcry_ac_key_t' is deprecated [-Wdeprecated-declarations]

=A0

And which version of libgcrypt are you compiling with?

libgcrypt 1.5.0

regards

Vincent Torri
--20cf303b417f8d34f904b0975d52-- --===============0153804126== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --===============0153804126==-- From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 13:30:46 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VCUf9U024249; Mon, 31 Oct 2011 13:30:45 +0100 Received: from giant.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VCUeTJ024243 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 31 Oct 2011 13:30:40 +0100 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id p9VCUefg024239 for ; Mon, 31 Oct 2011 13:30:40 +0100 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Mon, 31 Oct 2011 13:30:40 +0100 (CET) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: some warnings when compiling for windows In-Reply-To: Message-ID: References: <1320063255.28399.27.camel@henriknordstrom.net> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-fromdanielhimself: yes MIME-Version: 1.0 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On Mon, 31 Oct 2011, Vincent Torri wrote: > 1 example (there are tons of similar messages): > > /opt/efl/include/gcrypt.h:1512:1: warning: 'gcry_ac_key_t' is deprecated > [-Wdeprecated-declarations] I spotted gcrypt's 1.5.0 changelog[*] saying their gcry_ac_* functions are now deprecated. But we don't use any of them... [*] = http://lists.gnu.org/archive/html/info-gnu/2011-06/msg00012.html -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 13:34:43 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VCYauQ025781; Mon, 31 Oct 2011 13:34:42 +0100 Received: from giant.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VCYZnd025772 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 31 Oct 2011 13:34:35 +0100 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id p9VCYZ9m025767 for ; Mon, 31 Oct 2011 13:34:35 +0100 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Mon, 31 Oct 2011 13:34:35 +0100 (CET) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: some warnings when compiling for windows In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-fromdanielhimself: yes MIME-Version: 1.0 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On Mon, 31 Oct 2011, Ivan Pechorin wrote: Thanks for this quote. I think it backs up our version. > "The Winsock2.h header file internally includes core elements from the > Windows.h header file, so there is not usually an #include line for > the Windows.h header file in Winsock applications. If an #include line > is needed for the Windows.h header file Note this last 'if'. If windows.h is needed. We don't need it, we don't add an include for it... > So, as far as I understand, the solution is : > 1) either include winsock2.h before windows.h > 2) or #define WIN32_LEAN_AND_MEAN, then include windows.h, then > include winsock2.h Right *if* we would want windows.h sure, but why do we have to add it now? If we haven't had to do it up until now with windows versions of libssh2 working just fine, why do mingw's new headers suddenly force us to? -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 13:47:48 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VClV58003840; Mon, 31 Oct 2011 13:47:46 +0100 Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VClTiD003801 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 31 Oct 2011 13:47:30 +0100 Received: by qadz32 with SMTP id z32so5787996qad.41 for ; Mon, 31 Oct 2011 05:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=D5JkQdcHW5b0Oi5xaRUILbZELpBuUh6k7IDp6WPRJww=; b=Qx9wD1iVXvvJpVz+gyQ4UEOtDOqVJAAOwn7sIv8VzDYssojW3dL3oFfLigsDIw9tGK kZ68PUUAZGHra8cyGppza98ffWqrl0WvNiA+7zERc2gXfKDNkYdJEdE54M97odUMAU/D vqeRY7r+YOR3fpioIrzHI5RcIBZxl3lKq3Bxc= MIME-Version: 1.0 Received: by 10.224.176.200 with SMTP id bf8mr11728969qab.91.1320065244978; Mon, 31 Oct 2011 05:47:24 -0700 (PDT) Received: by 10.224.67.207 with HTTP; Mon, 31 Oct 2011 05:47:24 -0700 (PDT) In-Reply-To: References: Date: Mon, 31 Oct 2011 13:47:24 +0100 Message-ID: Subject: Re: some warnings when compiling for windows From: Vincent Torri To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0781366419==" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --===============0781366419== Content-Type: multipart/alternative; boundary=20cf302d4cdc01dd6804b097a439 --20cf302d4cdc01dd6804b097a439 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Oct 31, 2011 at 1:34 PM, Daniel Stenberg wrote: > On Mon, 31 Oct 2011, Ivan Pechorin wrote: > > Thanks for this quote. I think it backs up our version. > > > "The Winsock2.h header file internally includes core elements from the >> Windows.h header file, so there is not usually an #include line for >> the Windows.h header file in Winsock applications. If an #include line >> is needed for the Windows.h header file >> > > Note this last 'if'. If windows.h is needed. We don't need it, we don't > add an include for it... > > > So, as far as I understand, the solution is : >> 1) either include winsock2.h before windows.h >> 2) or #define WIN32_LEAN_AND_MEAN, then include windows.h, then >> include winsock2.h >> > > Right *if* we would want windows.h sure, but why do we have to add it now? > > If we haven't had to do it up until now with windows versions of libssh2 > working just fine, why do mingw's new headers suddenly force us to? Btw, it's just a warning. Also, you ido nclude windows.h: in libssh2_priv.h (line 47): #include later line 95: #include "libssh2.h" (which includes winsock2.h) so a fix would be (line 47): #ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN #endif #include #undef WIN32_LEAN_AND_MEAN (note that I added a test on WIN32_LEAN_AND_MEAN because some stupid public headers define it, but do not undef it. I experienced that) regards Vincent Torri --20cf302d4cdc01dd6804b097a439 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Mon, Oct 31, 2011 at 1:34 PM, Daniel = Stenberg <daniel@hax= x.se> wrote:
On Mon, 31 Oct 2011, Ivan Pechorin wrote:

Thanks for this quote. I think it backs up our version.

"The Winsock2.h header file internally includes core elements from the=
Windows.h header file, so there is not usually an #include line for
the Windows.h header file in Winsock applications. If an #include line
is needed for the Windows.h header file

Note this last 'if'. If windows.h is needed. We don't need it, = we don't add an include for it...


So, as far as I understand, the solution is :
1) either include winsock2.h before windows.h
2) or #define WIN32_LEAN_AND_MEAN, then include windows.h, then
include winsock2.h

Right *if* we would want windows.h sure, but why do we have to add it now?<= br>
If we haven't had to do it up until now with windows versions of libssh= 2 working just fine, why do mingw's new headers suddenly force us to?

Btw, it's just a warning. Also, you ido nclude wind= ows.h:

in libssh2_priv.h (line=A0 47):

#include <windows.h>
later line 95:

#include "libssh2.h"

(which includ= es winsock2.h)

so a fix would be (line 47):

#ifndef WIN32_LEA= N_AND_MEAN
# define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#un= def WIN32_LEAN_AND_MEAN

(note that I added a test on WIN32_LEAN_AND_= MEAN because some stupid public headers define it, but do not undef it. I e= xperienced that)
regards

Vincent Torri
--20cf302d4cdc01dd6804b097a439-- --===============0781366419== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --===============0781366419==-- From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 13:50:17 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VCoDuP005088; Mon, 31 Oct 2011 13:50:17 +0100 Received: from giant.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VCoBkP005078 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 31 Oct 2011 13:50:11 +0100 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id p9VCoBN2005074 for ; Mon, 31 Oct 2011 13:50:11 +0100 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Mon, 31 Oct 2011 13:50:11 +0100 (CET) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: some warnings when compiling for windows In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) X-fromdanielhimself: yes MIME-Version: 1.0 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On Mon, 31 Oct 2011, Vincent Torri wrote: > Btw, it's just a warning. Also, you ido nclude windows.h: > > in libssh2_priv.h (line 47): > > #include You're right of course and I stand corrected... > so a fix would be (line 47): > > #ifndef WIN32_LEAN_AND_MEAN > # define WIN32_LEAN_AND_MEAN > #endif > #include > #undef WIN32_LEAN_AND_MEAN And this silences the warning nicely I presume? -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 14:10:56 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VDAlKU018321; Mon, 31 Oct 2011 14:10:55 +0100 Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VDAi0D018298 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 31 Oct 2011 14:10:45 +0100 Received: by qadz32 with SMTP id z32so5811827qad.41 for ; Mon, 31 Oct 2011 06:10:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=5exTyn55I7nFKPfah3A8wcG+04gaW/7T3qn5XPLCc8A=; b=HXBAZmnmp4WClh3Swe4bcHlbenMUIr/3Oa6mQRwsQqOpVOzJwqT8EvIetgsN04/dvz 4e6PQNZdTLr6pgPBER24MCjipBXIJ8eLfykisryp5WvCNTFaF/cekA0zqiIgVUezwW7I Yc12J10knE+qimU11OLQOltTjns0qTrJ9MNJQ= MIME-Version: 1.0 Received: by 10.224.188.139 with SMTP id da11mr11809843qab.93.1320066638870; Mon, 31 Oct 2011 06:10:38 -0700 (PDT) Received: by 10.224.67.207 with HTTP; Mon, 31 Oct 2011 06:10:38 -0700 (PDT) In-Reply-To: References: Date: Mon, 31 Oct 2011 14:10:38 +0100 Message-ID: Subject: Re: some warnings when compiling for windows From: Vincent Torri To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1744859387==" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --===============1744859387== Content-Type: multipart/alternative; boundary=20cf3033489b16f77304b097f7e1 --20cf3033489b16f77304b097f7e1 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Oct 31, 2011 at 1:50 PM, Daniel Stenberg wrote: > On Mon, 31 Oct 2011, Vincent Torri wrote: > > Btw, it's just a warning. Also, you ido nclude windows.h: >> >> in libssh2_priv.h (line 47): >> >> #include >> > > You're right of course and I stand corrected... > > > so a fix would be (line 47): >> >> #ifndef WIN32_LEAN_AND_MEAN >> # define WIN32_LEAN_AND_MEAN >> #endif >> #include >> #undef WIN32_LEAN_AND_MEAN >> > > And this silences the warning nicely I presume? yes, it does. Note that i looked at Microsoft windows.h header file (provided by Visual Studio) some years ago. In it, there is a: #ifndef WIN32_LEAN_AND_MEAN ... #include ... #endif iirc. So it's normal that it fixes the warning. Here is the patch below (and yes, it fixes the warning) : regards Vincent Torri --- ./src/libssh2_priv.h 2011-10-31 13:59:54.000000000 +0100 +++ ../libssh2-1.3.0_new/src/libssh2_priv.h 2011-10-31 14:03:20.000000000 +0100 @@ -44,7 +44,11 @@ #include "libssh2_config.h" #ifdef HAVE_WINDOWS_H +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif #include +#undef WIN32_LEAN_AND_MEAN #endif #ifdef HAVE_WS2TCPIP_H --20cf3033489b16f77304b097f7e1 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Mon, Oct 31, 2011 at 1:50 PM, Daniel = Stenberg <daniel@hax= x.se> wrote:
On Mon, 31 Oct 2011, Vincent Torri wrote:

Btw, it's just a warning. Also, you ido nclude windows.h:

in libssh2_priv.h (line =A047):

#include <windows.h>

You're right of course and I stand corrected...


so a fix would be (line 47):

#ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN

And this silences the warning nicely I presume?

yes, i= t does. Note that i looked at Microsoft windows.h header file (provided by = Visual Studio) some years ago. In it, there is a:

#ifndef WIN32_LEAN= _AND_MEAN
...
#include <winsock2.h>
=A0...
#endif

iirc. So it&#= 39;s normal that it fixes the warning. Here is the patch below (and yes, it= fixes the warning) :

regards

Vincent Torri

--- ./src/= libssh2_priv.h=A0=A0=A0 2011-10-31 13:59:54.000000000 +0100
+++ ../libssh2-1.3.0_new/src/libssh2_priv.h=A0=A0=A0 2011-10-31 14:03:20.00= 0000000 +0100
@@ -44,7 +44,11 @@
=A0#include "libssh2_config.h&q= uot;
=A0
=A0#ifdef HAVE_WINDOWS_H
+#ifndef WIN32_LEAN_AND_MEAN
= +#define WIN32_LEAN_AND_MEAN
+#endif
=A0#include <windows.h>
+#undef WIN32_LEAN_AND_MEAN
= =A0#endif
=A0
=A0#ifdef HAVE_WS2TCPIP_H


--20cf3033489b16f77304b097f7e1-- --===============1744859387== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --===============1744859387==-- From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 14:17:24 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VDHKxY021051; Mon, 31 Oct 2011 14:17:24 +0100 Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VDHGUC020955 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 31 Oct 2011 14:17:17 +0100 Received: by qadz32 with SMTP id z32so5818802qad.41 for ; Mon, 31 Oct 2011 06:17:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=3KnZ5pSuwlgfNeD+fvmCbupIgEZt+cu+2x7aG+VD3DA=; b=eso1/R1Gcx70Am/S6HILJjQ5XlEi1k5HJ9IPlXWZud0rtuT5/sfZna/m3VmFVmnfS9 fKzZoqX0MWjXfgk+RPedI6HiJgp9YkZT5nmDkVPtn5pl0OxQ7XI/kxjZuxiJh/y5S45p qjeit9upA1fQ5xPipdG1IaHRJMwu7XhnLlBmM= MIME-Version: 1.0 Received: by 10.229.214.11 with SMTP id gy11mr3065625qcb.156.1320067032281; Mon, 31 Oct 2011 06:17:12 -0700 (PDT) Received: by 10.229.29.148 with HTTP; Mon, 31 Oct 2011 06:17:12 -0700 (PDT) In-Reply-To: References: Date: Mon, 31 Oct 2011 13:17:12 +0000 X-Google-Sender-Auth: 41XPSVmL1BZXXAkpNusvKff9ZjQ Message-ID: Subject: Re: some warnings when compiling for windows From: Alexander Lamaison To: libssh2 development X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9VDHGUC020955 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by giant.haxx.se id p9VDHKxY021051 On 31 October 2011 13:10, Vincent Torri wrote: > > > On Mon, Oct 31, 2011 at 1:50 PM, Daniel Stenberg wrote: >> >> On Mon, 31 Oct 2011, Vincent Torri wrote: >> >>> Btw, it's just a warning. Also, you ido nclude windows.h: >>> >>> in libssh2_priv.h (line  47): >>> >>> #include >> >> You're right of course and I stand corrected... >> >>> so a fix would be (line 47): >>> >>> #ifndef WIN32_LEAN_AND_MEAN >>> # define WIN32_LEAN_AND_MEAN >>> #endif >>> #include >>> #undef WIN32_LEAN_AND_MEAN >> >> And this silences the warning nicely I presume? > > yes, it does. Note that i looked at Microsoft windows.h header file > (provided by Visual Studio) some years ago. In it, there is a: > > #ifndef WIN32_LEAN_AND_MEAN > ... > #include >  ... > #endif > > iirc. So it's normal that it fixes the warning. Here is the patch below (and > yes, it fixes the warning) : > > regards > > Vincent Torri > > --- ./src/libssh2_priv.h    2011-10-31 13:59:54.000000000 +0100 > +++ ../libssh2-1.3.0_new/src/libssh2_priv.h    2011-10-31 14:03:20.000000000 > +0100 > @@ -44,7 +44,11 @@ >  #include "libssh2_config.h" > >  #ifdef HAVE_WINDOWS_H > +#ifndef WIN32_LEAN_AND_MEAN > +#define WIN32_LEAN_AND_MEAN > +#endif >  #include > +#undef WIN32_LEAN_AND_MEAN >  #endif > >  #ifdef HAVE_WS2TCPIP_H Rather than working around this warning, shouldn't the question be why are we including windows.h rather than the winsock header? Alex _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 14:18:01 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VDHvZj021276; Mon, 31 Oct 2011 14:18:01 +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-2) with SMTP id p9VDHu4L021268 for ; Mon, 31 Oct 2011 14:17:56 +0100 Received: (qmail 24190 invoked by uid 501); 31 Oct 2011 13:17:56 -0000 Message-ID: <20111031131756.24189.qmail@stuge.se> Date: Mon, 31 Oct 2011 14:17:56 +0100 From: Peter Stuge To: libssh2-devel@cool.haxx.se Subject: Re: some warnings when compiling for windows Mail-Followup-To: libssh2-devel@cool.haxx.se References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Vincent Torri wrote: > Here is the patch below (and yes, it fixes the warning) : Thanks for fixing this in libssh2. But please start creating commits locally and send them either after running git format-patch to create a patch attachment, or using git send-email to send email directly from git to mailing list. By not sending a real git commit patch you unfortunately force others to do extra work to add your changes, which isn't so nice. Thanks! //Peter _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 14:21:27 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VDLLmh024922; Mon, 31 Oct 2011 14:21:27 +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-2) with SMTP id p9VDLJPd024888 for ; Mon, 31 Oct 2011 14:21:19 +0100 Received: (qmail 24713 invoked by uid 501); 31 Oct 2011 13:21:20 -0000 Message-ID: <20111031132120.24712.qmail@stuge.se> Date: Mon, 31 Oct 2011 14:21:20 +0100 From: Peter Stuge To: libssh2-devel@cool.haxx.se Subject: Re: some warnings when compiling for windows Mail-Followup-To: libssh2-devel@cool.haxx.se References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Alexander Lamaison wrote: > shouldn't the question be why are we including windows.h rather > than the winsock header? We want some stuff from windows.h, and to me it seems appropriate to include it explicitly, but of course we could go the other way and only include winsock2.h and rely on it including windows.h. Matter of taste? //Peter _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 14:32:35 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VDWRKd031936; Mon, 31 Oct 2011 14:32:34 +0100 Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VDWPhW031917 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 31 Oct 2011 14:32:26 +0100 Received: by qadz32 with SMTP id z32so5835152qad.41 for ; Mon, 31 Oct 2011 06:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ZmWK5AycwcsoxAkCdgN4d6DJ0QB773KfWzEgzSkgCOo=; b=kqZ42/GMvraHGNR5e2jselbLdfa/thFQKJnt9hQTcvz01dc8AJ+35cqWrk9FdXxJg4 MR+cjiy/UwkWz9ZNZcXHOCI3cPO4hWwc1jEUij8Xq4rbfFgW/bVbDRkMqRv5eTZSRyg+ ClPfngwkLY4NG6R4vgoX5ekZynlhxckNXLvbo= MIME-Version: 1.0 Received: by 10.224.203.7 with SMTP id fg7mr11801531qab.78.1320067941102; Mon, 31 Oct 2011 06:32:21 -0700 (PDT) Received: by 10.224.67.207 with HTTP; Mon, 31 Oct 2011 06:32:21 -0700 (PDT) In-Reply-To: <20111031131756.24189.qmail@stuge.se> References: <20111031131756.24189.qmail@stuge.se> Date: Mon, 31 Oct 2011 14:32:21 +0100 Message-ID: Subject: Re: some warnings when compiling for windows From: Vincent Torri To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0305190751==" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --===============0305190751== Content-Type: multipart/alternative; boundary=20cf300fb3e5b5740f04b09844d0 --20cf300fb3e5b5740f04b09844d0 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Oct 31, 2011 at 2:17 PM, Peter Stuge wrote: > Vincent Torri wrote: > > Here is the patch below (and yes, it fixes the warning) : > > Thanks for fixing this in libssh2. But please start creating commits > locally and send them either after running git format-patch to create > a patch attachment, or using git send-email to send email directly > from git to mailing list. By not sending a real git commit patch you > unfortunately force others to do extra work to add your changes, > which isn't so nice. > note also, according to the patch, that i'm working with the 1.3.0 release. I've not checked out the git repo. I would have use git stuff otherwise of course. and honestly, for such trivial patches, copy/paste is fast enough, imho. That's what I do myself when one send me trivial patches of 3 or 4 lines like that for the project I'm involved with. but i'll remember your note thank you Vincent Torri --20cf300fb3e5b5740f04b09844d0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Mon, Oct 31, 2011 at 2:17 PM, Peter S= tuge <peter@stuge.se= > wrote:
Vincent Torri wrote:
> Here is the patch below (and yes, it fixes the warning) :

Thanks for fixing this in libssh2. But please start creating commits<= br> locally and send them either after running git format-patch to create
a patch attachment, or using git send-email to send email directly
from git to mailing list. By not sending a real git commit patch you
unfortunately force others to do extra work to add your changes,
which isn't so nice.

note also, according to t= he patch, that i'm working with the 1.3.0 release. I've not checked= out the git repo. I would have use git stuff otherwise of course.

and honestly, for such trivial patches, copy/paste is fast enough, imho= . That's what I do myself when one send me trivial patches of 3 or 4 li= nes like that for the project I'm involved with.

but i'll re= member your note

thank you

Vincent Torri

--20cf300fb3e5b5740f04b09844d0-- --===============0305190751== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --===============0305190751==-- From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 14:39:15 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VDd7tc002397; Mon, 31 Oct 2011 14:39:15 +0100 Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VDd4YI002288 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 31 Oct 2011 14:39:05 +0100 Received: by qyk35 with SMTP id 35so3623539qyk.20 for ; Mon, 31 Oct 2011 06:39:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=FR2UkT4fCAC9nh6TowYHUfHZmEK3R7qtOrzcb42vxgg=; b=KWlebKLC93PBvw71F39+D7WJTsLc8CT2MHvFdXp1HazFhk8PNmQTHUSluUS8g1Bb3W dhkrKqGMqQXEdyhPBzwkwzO2dvYSNszeXC3hEq09EJVDY3vFFdeW0RvTALFqFeYMbXYZ BhrOqJmo6p3tkL3qISmMHbNRsHjvTNay7Svqg= MIME-Version: 1.0 Received: by 10.229.190.20 with SMTP id dg20mr575042qcb.194.1320068340142; Mon, 31 Oct 2011 06:39:00 -0700 (PDT) Received: by 10.229.29.148 with HTTP; Mon, 31 Oct 2011 06:38:59 -0700 (PDT) In-Reply-To: <20111031132120.24712.qmail@stuge.se> References: <20111031132120.24712.qmail@stuge.se> Date: Mon, 31 Oct 2011 13:38:59 +0000 X-Google-Sender-Auth: hRseBa9M2TPsmbpO2Dh2nPZMFHo Message-ID: Subject: Re: some warnings when compiling for windows From: Alexander Lamaison To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On 31 October 2011 13:21, Peter Stuge wrote: > Alexander Lamaison wrote: >> shouldn't the question be why are we including windows.h rather >> than the winsock header? > > We want some stuff from windows.h, and to me it seems appropriate to > include it explicitly, but of course we could go the other way and > only include winsock2.h and rely on it including windows.h. Matter of > taste? Unless I'm reading the documentation incorrectly, it is not a matter of taste in this case but, rather, the way the headers are meant to be used: "The Winsock2.h header file internally includes core elements from the Windows.h header file, so there is not usually an #include line for the Windows.h header file in Winsock applications." Alex _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 14:42:03 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VDfvOj006990; Mon, 31 Oct 2011 14:42:02 +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-2) with SMTP id p9VDfuZj006948 for ; Mon, 31 Oct 2011 14:41:56 +0100 Received: (qmail 27586 invoked by uid 501); 31 Oct 2011 13:41:56 -0000 Message-ID: <20111031134156.27585.qmail@stuge.se> Date: Mon, 31 Oct 2011 14:41:56 +0100 From: Peter Stuge To: libssh2-devel@cool.haxx.se Subject: Re: some warnings when compiling for windows Mail-Followup-To: libssh2-devel@cool.haxx.se References: <20111031131756.24189.qmail@stuge.se> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Vincent Torri wrote: > and honestly, for such trivial patches, copy/paste is fast enough, imho. Doesn't change the fact that you are forcing others to do the work for you. //Peter _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 14:43:06 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VDh01L008686; Mon, 31 Oct 2011 14:43:06 +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-2) with SMTP id p9VDh0wI008674 for ; Mon, 31 Oct 2011 14:43:00 +0100 Received: (qmail 27754 invoked by uid 501); 31 Oct 2011 13:43:00 -0000 Message-ID: <20111031134300.27753.qmail@stuge.se> Date: Mon, 31 Oct 2011 14:43:00 +0100 From: Peter Stuge To: libssh2-devel@cool.haxx.se Subject: Re: some warnings when compiling for windows Mail-Followup-To: libssh2-devel@cool.haxx.se References: <20111031132120.24712.qmail@stuge.se> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se Alexander Lamaison wrote: > > Matter of taste? > > Unless I'm reading the documentation incorrectly, it is not a matter > of taste in this case but, rather, the way the headers are meant to be > used: "The Winsock2.h header file internally includes core elements > from the Windows.h header file, so there is not usually an #include > line for the Windows.h header file in Winsock applications." I think "usually" leaves that open to doing things according to taste. //Peter _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 14:55:39 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VDtRGC014789; Mon, 31 Oct 2011 14:55:38 +0100 Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VDsOx2013752 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 31 Oct 2011 14:54:25 +0100 Received: by qyk35 with SMTP id 35so3640201qyk.20 for ; Mon, 31 Oct 2011 06:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=sbTpeKYhofxOSTseWoCms09FcRXDjN00uskKujGk2dA=; b=mKn/SQg6D0W+kf34fbiVIoc5RTLCnsyCYrMgnWyUXHaGAren+TZx3GAgFqegBGImSo ocmRFY4WOdC6cqmkLZ2wVrmOA/YZ9PJbfgF8mD5ozA9gtCCJ+oIqsKp1UAAgeC1tu/9A ZPDzOLtqGeSQkxh0N2RrUzEPIoZmEMcTPqnwY= MIME-Version: 1.0 Received: by 10.229.67.66 with SMTP id q2mr3106630qci.118.1320069259444; Mon, 31 Oct 2011 06:54:19 -0700 (PDT) Received: by 10.229.29.148 with HTTP; Mon, 31 Oct 2011 06:54:19 -0700 (PDT) In-Reply-To: <20111031134300.27753.qmail@stuge.se> References: <20111031132120.24712.qmail@stuge.se> <20111031134300.27753.qmail@stuge.se> Date: Mon, 31 Oct 2011 13:54:19 +0000 X-Google-Sender-Auth: dC2S_ivw6LIGH65B2crs-jHWWHo Message-ID: Subject: Re: some warnings when compiling for windows From: Alexander Lamaison To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se On 31 October 2011 13:43, Peter Stuge wrote: > Alexander Lamaison wrote: >> > Matter of taste? >> >> Unless I'm reading the documentation incorrectly, it is not a matter >> of taste in this case but, rather, the way the headers are meant to be >> used: "The Winsock2.h header file internally includes core elements >> from the Windows.h header file, so there is not usually an #include >> line for the Windows.h header file in Winsock applications." > > I think "usually" leaves that open to doing things according to > taste. Possibly so :-P I have no great objection to this patch going in as it is. Alex _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Oct 31 15:05:14 2011 Return-Path: Received: from www.haxx.se (localhost.localdomain [127.0.0.1]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VE58v9023934; Mon, 31 Oct 2011 15:05:13 +0100 Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id p9VE55xd023051 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Mon, 31 Oct 2011 15:05:06 +0100 Received: by qadz32 with SMTP id z32so5871681qad.41 for ; Mon, 31 Oct 2011 07:05:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=h5YAx1b+jds7qFvAMEUELVTLtXucJeuvRoFp1v2o4fU=; b=lualFFcJohSc3alh9l8ZcWjlgKu3ceNQJyJuiUUiawCONzvAnSiq4406fAjyTUuh/G KmCgzbDIL+X1eJFyyCRBvKEUBLaX6iaxL28qAC7EJRTrXzCYU1MK4AKKeTQruKJ9Bwhd fIEkBKV0UZJgPRkMC/v39Jp3zQV0y50PEAh7I= MIME-Version: 1.0 Received: by 10.224.203.7 with SMTP id fg7mr11900307qab.78.1320069901326; Mon, 31 Oct 2011 07:05:01 -0700 (PDT) Received: by 10.224.67.207 with HTTP; Mon, 31 Oct 2011 07:05:01 -0700 (PDT) In-Reply-To: <20111031134156.27585.qmail@stuge.se> References: <20111031131756.24189.qmail@stuge.se> <20111031134156.27585.qmail@stuge.se> Date: Mon, 31 Oct 2011 15:05:01 +0100 Message-ID: Subject: Re: some warnings when compiling for windows From: Vincent Torri To: libssh2 development X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.14 Precedence: list Reply-To: libssh2 development List-Id: libssh2 development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0192649529==" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: libssh2-devel-bounces@cool.haxx.se --===============0192649529== Content-Type: multipart/alternative; boundary=20cf300fb3e58c18b604b098b989 --20cf300fb3e58c18b604b098b989 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Oct 31, 2011 at 2:41 PM, Peter Stuge wrote: > Vincent Torri wrote: > > and honestly, for such trivial patches, copy/paste is fast enough, imho. > > Doesn't change the fact that you are forcing others to do the work > for you. > as i said, i'm also doing that kind of work and it does not annoy me. Actually, i'm already happy to just have patches from other people for the project i mentioned :) btw, I don't force anybody to apply the patches i propose. I'm already patching libssh2 myself, i just report upstream these modifications. regards Vincent Torri --20cf300fb3e58c18b604b098b989 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Mon, Oct 31, 2011 at 2:41 PM, Peter S= tuge <peter@stuge.se= > wrote:
Vincent Torri wrote:
> and honestly, for such trivial patches, copy/paste is fast enough, imh= o.

Doesn't change the fact that you are forcing others to do the wor= k
for you.

as i said, i'm also doing that kind o= f work and it does not annoy me. Actually, i'm already happy to just ha= ve patches from other people for the project i mentioned :)

btw, I d= on't force anybody to apply the patches i propose. I'm already patc= hing libssh2 myself, i just report upstream these modifications.

regards

Vincent Torri

--20cf300fb3e58c18b604b098b989-- --===============0192649529== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel --===============0192649529==--