From owner-freebsd-bugs@freebsd.org Thu Jan 19 16:39:40 2017 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B36FCB8212 for ; Thu, 19 Jan 2017 16:39:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 311341CF4 for ; Thu, 19 Jan 2017 16:39:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v0JGdeiI033862 for ; Thu, 19 Jan 2017 16:39:40 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 212065] fetch -r fails on a complete file, even with -S 12345 (OS version independent) Date: Thu, 19 Jan 2017 16:39:40 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 10.3-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: cem@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2017 16:39:40 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212065 Conrad Meyer changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cem@freebsd.org --- Comment #1 from Conrad Meyer --- libfetch does appear to recognize that 416 errors might just be empty range= s: 1806 case HTTP_BAD_RANGE: 1807 /* 1808 * This can happen if we ask for 0 bytes becau= se 1809 * we already have the whole file. Consider t= his 1810 * a success for now, and check sizes later. 1811 */ 1812 break; And if the HTTP server returns a Content-Range header along with the 416, it treats that as no error: 1926 /* requested range not satisfiable */ 1927 if (conn->err =3D=3D HTTP_BAD_RANGE) { 1928 if (url->offset =3D=3D size && url->length =3D= =3D 0) { 1929 /* asked for 0 bytes; fake it */ 1930 offset =3D url->offset; 1931 clength =3D -1; 1932 conn->err =3D HTTP_OK; 1933 break; Otherwise, it treats it as an error: 1934 } else { 1935 http_seterr(conn->err); 1936 goto ouch; 1937 } https://tools.ietf.org/html/rfc2616#section-14.16 > The Content-Range entity-header is sent with a partial entity-body to > specify where in the full entity-body the partial body should be > applied. > A server sending a response with status code 416 (Requested range not > satisfiable) SHOULD include a Content-Range field with a byte-range- > resp-spec of "*". The instance-length specifies the current length of > the selected resource.=20 The byte-range-resp-spec is the left side of the A-B/C style response of Content-Range. So httpds should respond to zero byte range requests with 4= 16 + Content-Range: bytes */1234, if the total file size is 1234. It appears that ec2's web server isn't following this SHOULD recommendation= .=20 That's allowed, it's not a MUST. So maybe libfetch needs to be a little mo= re tolerant of such responses. --=20 You are receiving this mail because: You are the assignee for the bug.=