Date: Tue, 28 Jan 2014 11:04:56 +0100 From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no> To: Michael Gmelin <freebsd@grem.de> Cc: Baptiste Daroussin <bapt@FreeBSD.org>, Rainer Hurling <rhurlin@gwdg.de>, FreeBSD ports list <freebsd-ports@FreeBSD.org> Subject: Re: r341435: deletion of graphics/fotoxx Message-ID: <86y520bewn.fsf@nine.des.no> In-Reply-To: <20140127233352.4d82aad1@bsd64.grem.de> (Michael Gmelin's message of "Mon, 27 Jan 2014 23:33:52 %2B0100") References: <52E6A7E8.90301@gwdg.de> <52E6A9FB.7080602@gwdg.de> <20140127194905.GD33006@ithaqua.etoilebsd.net> <52E6C085.4050808@gwdg.de> <20140127233352.4d82aad1@bsd64.grem.de>
index | next in thread | previous in thread | raw e-mail
Michael Gmelin <freebsd@grem.de> 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
===================================================================
--- 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 = ETIMEDOUT;
fetch_syserr();
return (-1);
DES
--
Dag-Erling Smørgrav - des@des.no
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86y520bewn.fsf>
