From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: Re: SSHv2 doesn't actually have compression levels Date: Fri, 23 Aug 2019 14:21:18 +0200 Message-ID: <87blwg843l.fsf@gnu.org> References: <87ef28fflj.fsf@nckx> <87mug0j2gt.fsf@gnu.org> <877e746et0.fsf@nckx> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:57556) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i18ZK-0000K4-Mm for guix-devel@gnu.org; Fri, 23 Aug 2019 08:21:29 -0400 In-Reply-To: <877e746et0.fsf@nckx> (Tobias Geerinckx-Rice's message of "Fri, 23 Aug 2019 00:00:43 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Tobias Geerinckx-Rice Cc: guix-devel Tobias Geerinckx-Rice skribis: > Ludo', > > Welcome back :-) > > Ludovic Court=C3=A8s =E5=86=99=E9=81=93=EF=BC=9A >> I don=E2=80=99t get it: the =E2=80=98compression-level=E2=80=99 field de= faults to 3, and >> OpenSSH >> does: >> >> static int >> start_compression_out(struct ssh *ssh, int level) >> { >> if (level < 1 || level > 9) >> return SSH_ERR_INVALID_ARGUMENT; >> debug("Enabling compression at level %d.", level); >> >> [...] >> >> } >> >> What=E2=80=99s wrong? > > Exactly! Exactly what? :-) > ~/openssh-8.0p1 =CE=BB grep -r start_compression_out > packet.c:start_compression_out(struct ssh *ssh, int level) > packet.c: if ((r =3D start_compression_out(ssh, 6)) !=3D 0) libssh (which is what =E2=80=98guix offload=E2=80=99 uses) appears to honor= the user-provided compression level: --8<---------------cut here---------------start------------->8--- int compress_buffer(ssh_session session, ssh_buffer buf) { ssh_buffer dest =3D NULL; dest =3D gzip_compress(session, buf, session->opts.compressionlevel); --8<---------------cut here---------------end--------------->8--- Apologies if I=E2=80=99m missing the obvious! Thanks, Ludo=E2=80=99.