From owner-freebsd-ports@FreeBSD.ORG Tue Jan 28 10:04:54 2014 Return-Path: Delivered-To: freebsd-ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2CDA61FF; Tue, 28 Jan 2014 10:04:54 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id A83141CFD; Tue, 28 Jan 2014 10:04:53 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 4F7A720CF; Tue, 28 Jan 2014 10:04:52 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id DCD4D31E05; Tue, 28 Jan 2014 11:04:56 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Michael Gmelin Subject: Re: r341435: deletion of graphics/fotoxx References: <52E6A7E8.90301@gwdg.de> <52E6A9FB.7080602@gwdg.de> <20140127194905.GD33006@ithaqua.etoilebsd.net> <52E6C085.4050808@gwdg.de> <20140127233352.4d82aad1@bsd64.grem.de> Date: Tue, 28 Jan 2014 11:04:56 +0100 In-Reply-To: <20140127233352.4d82aad1@bsd64.grem.de> (Michael Gmelin's message of "Mon, 27 Jan 2014 23:33:52 +0100") Message-ID: <86y520bewn.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Baptiste Daroussin , Rainer Hurling , FreeBSD ports list X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2014 10:04:54 -0000 Michael Gmelin writes: > His web server reports a content length of 2696186, but only provides > 2696168 bytes of data. Tools like wget and curl just stop downloading > data, while fetch hangs waiting for those 18 extra bytes. Actually, the file *is* 2696168 bytes long. With the following patch, fetch(1) will still hang getting the last 1018 bytes, but the file will be complete and the download will be successful. Index: lib/libfetch/common.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- lib/libfetch/common.c (revision 260631) +++ lib/libfetch/common.c (working copy) @@ -1036,6 +1036,13 @@ if (fetchTimeout > 0) { gettimeofday(&now, NULL); if (!timercmp(&timeout, &now, >)) { + /* + * Return a short read instead of + * a timeout if we have anything + * at all. + */ + if (total > 0) + return (total); errno =3D ETIMEDOUT; fetch_syserr(); return (-1); DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no