From libssh2-devel-bounces@cool.haxx.se Sun Dec 2 01:58:27 2012 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 qB20w1F2025255; Sun, 2 Dec 2012 01:58:21 +0100 Received: from smtp5.hushmail.com (smtp5.hushmail.com [65.39.178.142]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id qB20vvFl025248 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 2 Dec 2012 01:57:58 +0100 Received: from smtp5.hushmail.com (localhost.localdomain [127.0.0.1]) by smtp5.hushmail.com (Postfix) with SMTP id 32038512C2 for ; Sun, 2 Dec 2012 00:57:54 +0000 (UTC) Received: from smtp.hushmail.com (w7.hushmail.com [65.39.178.32]) by smtp5.hushmail.com (Postfix) with ESMTP for ; Sun, 2 Dec 2012 00:57:54 +0000 (UTC) Received: by smtp.hushmail.com (Postfix, from userid 99) id 0C2AB6F443; Sun, 2 Dec 2012 00:57:54 +0000 (UTC) MIME-Version: 1.0 Date: Sun, 02 Dec 2012 00:57:53 +0000 To: libssh2-devel@cool.haxx.se Subject: zlib and scp/sftp From: scout_game@hushmail.me Message-Id: <20121202005754.0C2AB6F443@smtp.hushmail.com> X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.15 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="===============0734202710==" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: "libssh2-devel" --===============0734202710== Content-Type: multipart/alternative; boundary="=_229d039791c9d54fe7779c5114f31aac" --=_229d039791c9d54fe7779c5114f31aac Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="UTF-8" Hello, I have a question, i built libssh2 with zlib support. Does that mean that scp and sftp functions will automatically uses zlib compression by default or should I inform libssh2 to use zlib by calling a special function from library ? also an other question because I figured that sftp is slow and haven't seen any optimization in delay the transfer of files takes from local computer to server. Is there any think can be done to speed up sftp transfers ? probably something like activating keep alive ? Thank you for reading. --=_229d039791c9d54fe7779c5114f31aac Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="UTF-8" Hello,
I have a que= stion, i built libssh2 with zlib support. Does that mean that scp and sftp = functions will automatically uses zlib compression by default or should I i= nform libssh2 to use zlib by calling a special function from library ? also= an other question because I figured that sftp is slow and haven't seen any= optimization in delay the transfer of files takes from local computer to s= erver. Is there any think can be done to speed up sftp transfers ? probably= something like activating keep alive ?

Thank you for reading.
--=_229d039791c9d54fe7779c5114f31aac-- --===============0734202710== 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 --===============0734202710==-- From libssh2-devel-bounces@cool.haxx.se Sun Dec 2 15:31:36 2012 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 qB2EV3Q3016843; Sun, 2 Dec 2012 15:31:30 +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 qB2EV2iH016774 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 2 Dec 2012 15:31:02 +0100 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id qB2EV16x016707 for ; Sun, 2 Dec 2012 15:31:01 +0100 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Sun, 2 Dec 2012 15:31:01 +0100 (CET) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: zlib and scp/sftp In-Reply-To: <20121202005754.0C2AB6F443@smtp.hushmail.com> Message-ID: References: <20121202005754.0C2AB6F443@smtp.hushmail.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.15 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" On Sun, 2 Dec 2012, scout_game@hushmail.me wrote: > I have a question, i built libssh2 with zlib support. Does that mean that > scp and sftp functions will automatically uses zlib compression by default > or should I inform libssh2 to use zlib by calling a special function from > library ? libssh2_session_flag() with the LIBSSH2_FLAG_COMPRESS bit set. But in general compression is not such a good idea as it sounds... > another question because I figured that sftp is slow and haven't seen any > optimization in delay the transfer of files takes from local computer to > server. We've discussed how to optimize SFTP transfers on this list many times but I don't think we've ever actually documented them. We should make a "best practises" document for application that want high speed SFTP. Two quick tips are: * never force the buffer to have to get completely sent until you send the next buffer - see the sftp_write_sliding.c for an example of a sliding upload buffer that doesn't wait for a full "block" to be sent before it moves on to send more. * Use very large buffers. SFTP suffers from round-trip delays for each 30K of data so the trick is really to be able to send as many 30K blocks as possible "at once". By providing several hundred K at once to libssh2 gives it the chance to do more work in parallel. > Is there any think can be done to speed up sftp transfers ? probably > something like activating keep alive ? Keep alive doesn't help your performance while transfering data, but of course keeping connections alive will make the time to get the subsequent transfer to start to possibly be faster by avoiding a connect/disconnect sequence. -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Wed Dec 5 00:34:29 2012 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 qB4NY1Gt018292; Wed, 5 Dec 2012 00:34:22 +0100 Received: from homiemail-a47.g.dreamhost.com (caibbdcaaaaf.dreamhost.com [208.113.200.5]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id qB4NXxML018185 for ; Wed, 5 Dec 2012 00:33:59 +0100 Received: from homiemail-a47.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a47.g.dreamhost.com (Postfix) with ESMTP id 4A8E028405C for ; Tue, 4 Dec 2012 15:33:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cantrip.org; h=message-id :date:from:mime-version:to:subject:content-type: content-transfer-encoding; s=cantrip.org; bh=VBUmFt/m0YmwW1WTsgV V9Bmm//8=; b=iXmMFeulkYG2J9HKrEoLH4OFRqALRqBy2pKR5FhClFWF1qojdnl B8tQzKFmB5RwfdnNXhXx67fNswfDt8ppJdiZNtZyXfWxivtj85QvCqgsqjURa3bk 1ZIGU/EEYZfNIwMd5Mk7GcL+U9JDWJC/lDYb+rA4uFA0HX8OGVI9+7RE= Received: from [10.0.111.1] (smtp.asperasoft.com [64.201.246.50]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: ncm@cantrip.org) by homiemail-a47.g.dreamhost.com (Postfix) with ESMTPSA id 351B328405B for ; Tue, 4 Dec 2012 15:33:58 -0800 (PST) Message-ID: <50BE8865.9070209@cantrip.org> Date: Tue, 04 Dec 2012 15:33:57 -0800 From: Nathan Myers User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:10.0.10) Gecko/20121028 Icedove/10.0.10 MIME-Version: 1.0 To: libssh2-devel@cool.haxx.se Subject: libssh2_channel_write_ex() returning 0 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.15 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" In increasing order of apparent importance: 1. This code in src/channel.c, circa line 1767: rc = 1; /* set to >0 to let the while loop start */ ... while (rc > 0) rc = _libssh2_transport_read(session); would better be do rc = _libssh2_transport_read(session); while (rc > 0); 2. The page www.libssh2.org lists features of libssh2, but the list is incomplete. In particular, libssh2 supports CTR modes now, and host-key file management probably deserves mention. Recent U.S. federal procurement guidelines require preferring CTR cipher modes over CBC, so it could make an important difference in adoption. 3. In release 1.4.3, src/channel.c, _libssh2_channel_write(), line 2017: return (rc==LIBSSH2_ERROR_EAGAIN?rc:0); Here rc is the result from _libssh2_transport_read(session). When the output buffer is full, but the input buffer wasn't, this returns 0. It seems to me (and please correct me if I am mistaken) that libssh2_channel_write_ex() should only return 0 if the buflen argument is itself zero. I think that the correct line here would be simply return LIBSSH2_ERROR_EAGAIN; This fixes an infinite loop in typical fwrite()-like code that assumes that (the equivalent of) write() will prefer reporting EAGAIN over returning zero. I am sorry to discover this only immediately after a release, but I suppose that's what releases are really for. Nathan Myers ncm@cantrip.org _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Wed Dec 5 11:49:09 2012 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 qB5Amq4U007981; Wed, 5 Dec 2012 11:49:04 +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 qB5Amn3Y007976 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 5 Dec 2012 11:48:49 +0100 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id qB5AmnHA007971 for ; Wed, 5 Dec 2012 11:48:49 +0100 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Wed, 5 Dec 2012 11:48:49 +0100 (CET) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: "Would block waiting for status message" error In-Reply-To: <50B80BDF.1080200@rogers.com> Message-ID: References: <81854DCF-90EA-4114-8436-00EBA7B50533@freaksw.com> <50B80BDF.1080200@rogers.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.15 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" On Thu, 29 Nov 2012, Leo wrote: > But PDF and ZIP files fail with this error: > > "Would block waiting for status message" A serious lack of detail prevents anyone to actually help out. What exactly do you do and how and which libssh2 version are you using on what OS? -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Wed Dec 5 22:35:18 2012 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 qB5LYrpG013080; Wed, 5 Dec 2012 22:35:11 +0100 Received: from homiemail-a81.g.dreamhost.com (caibbdcaaaaf.dreamhost.com [208.113.200.5]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id qB5LYpW2013005 for ; Wed, 5 Dec 2012 22:34:52 +0100 Received: from homiemail-a81.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a81.g.dreamhost.com (Postfix) with ESMTP id 03D4CA8076 for ; Wed, 5 Dec 2012 13:34:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cantrip.org; h=message-id :date:from:mime-version:to:subject:content-type: content-transfer-encoding; s=cantrip.org; bh=GR3Ym3N/r7UzwUhBaCA IBFlNovQ=; b=G5XqaLzkBx+Xm15mdFxcy2xrFI7dsUpEiM9uxRS0VgdjvJ8hbJv pYd18vMx17HUvwTEsJn+MWgB/U4igf7zRA/nz5/4LQIO+QmHHT7HIMxBOKPT5S69 a2ym5Y2ClhjhcYehqNPR6BgntFTpt81jZf33A3OgeDo8/xkrg3RR6PC0= Received: from [10.0.111.1] (smtp.asperasoft.com [64.201.246.50]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: ncm@cantrip.org) by homiemail-a81.g.dreamhost.com (Postfix) with ESMTPSA id DC0E8A8075 for ; Wed, 5 Dec 2012 13:34:50 -0800 (PST) Message-ID: <50BFBDF8.8010900@cantrip.org> Date: Wed, 05 Dec 2012 13:34:48 -0800 From: Nathan Myers User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:10.0.10) Gecko/20121028 Icedove/10.0.10 MIME-Version: 1.0 To: libssh2-devel@cool.haxx.se Subject: Re: libssh2_channel_write_ex() returning 0 X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.15 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" I wrote: > 3. In release 1.4.3, src/channel.c, _libssh2_channel_write(), line 2017: > > return (rc==LIBSSH2_ERROR_EAGAIN?rc:0); > > > Here rc is the result from _libssh2_transport_read(session). > > When the output buffer is full, but the input buffer wasn't, this > returns 0. It seems to me (and please correct me if I am mistaken) > that libssh2_channel_write_ex() should only return 0 if the buflen > argument is itself zero. I think that the correct line here would > be simply > > return LIBSSH2_ERROR_EAGAIN; > > This fixes an infinite loop in typical fwrite()-like code that > assumes that (the equivalent of) write() will prefer reporting > EAGAIN over returning zero. On a related note... if the output socket gets shut down or otherwise blocked when the send window is exactly full, it's not clear to me how libssh2_channel_write_ex() will ever return anything other than 0 or LIBSSH2_ERROR_EAGAIN. Presumably calling send() would return an error, allowing a flag (local.eof?) to be set, but how can it ever get called? Shouldn't _ssh_transport_read() call send_existing()? Would that break the logjam? Nathan Myers ncm@cantrip.org _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Fri Dec 7 06:59:07 2012 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 qB75weW7027090; Fri, 7 Dec 2012 06:58:59 +0100 Received: from nm24.access.bullet.mail.sp2.yahoo.com (nm24.access.bullet.mail.sp2.yahoo.com [98.139.44.151]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id qB75wZHA027051 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 7 Dec 2012 06:58:37 +0100 Received: from [98.139.44.106] by nm24.access.bullet.mail.sp2.yahoo.com with NNFMP; 07 Dec 2012 05:58:31 -0000 Received: from [67.195.23.184] by tm11.access.bullet.mail.sp2.yahoo.com with NNFMP; 07 Dec 2012 05:58:31 -0000 Received: from [127.0.0.1] by smtp108.rog.mail.gq1.yahoo.com with NNFMP; 07 Dec 2012 05:58:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rogers.com; s=s1024; t=1354859911; bh=TgUCdosVVYeA/Or62+vtZzFW0awMx/8LzvnCFf9HKno=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=yIWmfk0NS8RjkTU0gEqK8Kc+Y7f3wqcJ0dsNKeuljUfT/leCjZpcY3fLFJgNZC9C5U5jpc3CXOxFVUQV75fA9nozN973dmpCHj6TI858r/6eHwuQr8XeE6uN6ehDAYHP2wInf+M/nssLwu3UWqsLWSvwhqhAA20SJ1ltD5JcwIo= X-Yahoo-Newman-Id: 46767.45703.bm@smtp108.rog.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: OPJZghYVM1lqgwEkzj2ibSFeUPVirJfZ5NxXMDRJt.vXtew 6cAi7zPvbETJnmR6xHhOOHIRuLgsIokNl2P1OoZZZMx2Z317KvdnKF5YzoJh .kwvJuYiaw8JhbJ5KuiBr67vtdVddtdGM0L9zynSlKeVAqtNHCpdmuiZoMnZ u1XEOYS0tPYeihrp9ca3w621fK0y88csPbSIQguQRvxx.8cti0j14IJHOfRM IuruKunHLkKa1xmt5G8ChjshLJGdYUdXiXeFnWjEXlCQGct6nNYXkDtl8uzB LaxFVW4Ut_pqnj6TgZZt9N8toGxsFEiucyd.nh1qGNB_Zpk3NcKL1nfHZYj4 13sU6kLU4eYbJdSxU2LL0BDLJ6yM5JZafjBSQZGXUOGUqT4sKIJdyqTx838P LWa1UTbXdGrDp1ZZe2QEZnoKBfRZBBPWS5j.WrdTv1ks4.vyWnWyrXr0qPkk qerPSvekvVhXXwggIJppV3oA- X-Yahoo-SMTP: ittiXmaswBDhscNhfQG6tb7_aoECVeenw6ekc88- Received: from cpe406c8f28047e-cm0019474754f2.cpe.net.cable.rogers.com (leo.r@99.231.50.212 with plain) by smtp108.rog.mail.gq1.yahoo.com with SMTP; 06 Dec 2012 21:58:30 -0800 PST Message-ID: <50C18586.80609@rogers.com> Date: Fri, 07 Dec 2012 00:58:30 -0500 From: Leo User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: libssh2 development Subject: Re: "Would block waiting for status message" error References: <81854DCF-90EA-4114-8436-00EBA7B50533@freaksw.com> <50B80BDF.1080200@rogers.com> In-Reply-To: X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.15 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" On 12/5/12 5:48 AM, Daniel Stenberg wrote: > On Thu, 29 Nov 2012, Leo wrote: > >> But PDF and ZIP files fail with this error: >> >> "Would block waiting for status message" > A serious lack of detail prevents anyone to actually help out. What exactly do > you do and how and which libssh2 version are you using on what OS? > Thanks Daniel! By asking which libssh2 version I'm using you solved the problem. I realized that a newer version may exist, downloaded it - and everything is working now. Thanks again, Leo _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Sat Dec 8 19:01:24 2012 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 qB8I0rAN005784; Sat, 8 Dec 2012 19:01:17 +0100 Received: from mail01.procurios.net (mail01.procurios.net [213.193.247.34]) by giant.haxx.se (8.14.4/8.14.4/Debian-2) with ESMTP id qB8I0pAN005778 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 8 Dec 2012 19:00:52 +0100 Received: from [192.168.1.23] (535388CA.cm-6-4c.dynamic.ziggo.nl [83.83.136.202]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: casper.casper) by mail01.procurios.net (Postfix) with ESMTPSA id 727F31398022 for ; Sat, 8 Dec 2012 19:00:49 +0100 (CET) Message-ID: <50C38050.5090502@php.net> Date: Sat, 08 Dec 2012 19:00:48 +0100 From: Casper Langemeijer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: libssh2 development Subject: Re: zlib and scp/sftp References: <20121202005754.0C2AB6F443@smtp.hushmail.com> In-Reply-To: X-BeenThere: libssh2-devel@cool.haxx.se X-Mailman-Version: 2.1.15 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="===============1381099311==" Errors-To: libssh2-devel-bounces@cool.haxx.se Sender: "libssh2-devel" This is a multi-part message in MIME format. --===============1381099311== Content-Type: multipart/alternative; boundary="------------050607080101050809050602" This is a multi-part message in MIME format. --------------050607080101050809050602 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 12/02/2012 03:31 PM, Daniel Stenberg wrote: > On Sun, 2 Dec 2012, scout_game@hushmail.me wrote: > >> I have a question, i built libssh2 with zlib support. Does that mean >> that scp and sftp functions will automatically uses zlib compression >> by default or should I inform libssh2 to use zlib by calling a >> special function from library ? > > libssh2_session_flag() with the LIBSSH2_FLAG_COMPRESS bit set. But in > general compression is not such a good idea as it sounds... Hi Daniel, could you elaborate on that? Are you talking about the extra cpu load on already compressed data like jpg, mp3, zip, gz etc being sent over a sftp and scp? A PHP ssh extension user is suggesting LIBSSH2_FLAG_COMPRESS should always be set, to allow for connections to servers which only accept zlib compressed connections. I'm sure this is an edge-case scenario, but if it does no harm I could enable compression for all connections. Greetings, Casper --------------050607080101050809050602 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 12/02/2012 03:31 PM, Daniel Stenberg wrote:
On Sun, 2 Dec 2012, scout_game@hushmail.me wrote:

I have a question, i built libssh2 with zlib support. Does that mean that scp and sftp functions will automatically uses zlib compression by default or should I inform libssh2 to use zlib by calling a special function from library ?

libssh2_session_flag() with the LIBSSH2_FLAG_COMPRESS bit set. But in general compression is not such a good idea as it sounds...

Hi Daniel, could you elaborate on that? Are you talking about the extra cpu load on already compressed data like jpg, mp3, zip, gz etc being sent over a sftp and scp?

A PHP ssh extension user is suggesting LIBSSH2_FLAG_COMPRESS should always be set, to allow for connections to servers which only accept zlib compressed connections. I'm sure this is an edge-case scenario, but if it does no harm I could enable compression for all connections.

Greetings, Casper
--------------050607080101050809050602-- --===============1381099311== 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 --===============1381099311==-- From libssh2-devel-bounces@cool.haxx.se Sat Dec 8 21:55:00 2012 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 qB8KskaU015157; Sat, 8 Dec 2012 21:54:57 +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 qB8Ksipv015142 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 8 Dec 2012 21:54:44 +0100 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id qB8KsiD2015137 for ; Sat, 8 Dec 2012 21:54:44 +0100 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Sat, 8 Dec 2012 21:54:44 +0100 (CET) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: zlib and scp/sftp In-Reply-To: <50C38050.5090502@php.net> Message-ID: References: <20121202005754.0C2AB6F443@smtp.hushmail.com> <50C38050.5090502@php.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.15 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" On Sat, 8 Dec 2012, Casper Langemeijer wrote: >> libssh2_session_flag() with the LIBSSH2_FLAG_COMPRESS bit set. But in >> general compression is not such a good idea as it sounds... > > Hi Daniel, could you elaborate on that? Are you talking about the extra cpu > load on already compressed data like jpg, mp3, zip, gz etc being sent over a > sftp and scp? Right, most things you transfer over SSH turn out to not compress very well and already compressed data only waste CPU and in fact make the transfer larger than without compression. > A PHP ssh extension user is suggesting LIBSSH2_FLAG_COMPRESS should always > be set, to allow for connections to servers which only accept zlib > compressed connections. If you find such odd servers than sure, enabling compression sounds like the correct action, but having it enabled by default because of that I don't know... -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel From libssh2-devel-bounces@cool.haxx.se Mon Dec 17 23:39:41 2012 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 qBHMdFlv005623; Mon, 17 Dec 2012 23:39:36 +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 qBHMdD34005616 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Mon, 17 Dec 2012 23:39:13 +0100 Received: from localhost (dast@localhost) by giant.haxx.se (8.14.4/8.14.4/Submit) with ESMTP id qBHMdDGu005612 for ; Mon, 17 Dec 2012 23:39:13 +0100 X-Authentication-Warning: giant.haxx.se: dast owned process doing -bs Date: Mon, 17 Dec 2012 23:39:13 +0100 (CET) From: Daniel Stenberg X-X-Sender: dast@giant.haxx.se To: libssh2 development Subject: Re: libssh2_channel_write_ex() returning 0 In-Reply-To: <50BE8865.9070209@cantrip.org> Message-ID: References: <50BE8865.9070209@cantrip.org> 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.15 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" On Tue, 4 Dec 2012, Nathan Myers wrote: > In increasing order of apparent importance: Hi, I just wanted to mention that I've not forgotten this mail, I've just been sucked up in other stuff... -- / daniel.haxx.se _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel