Date: Thu, 19 Jan 2017 16:39:40 +0000 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) Message-ID: <bug-212065-8-utWcxJyiK6@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-212065-8@https.bugs.freebsd.org/bugzilla/> References: <bug-212065-8@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212065 Conrad Meyer <cem@freebsd.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cem@freebsd.org --- Comment #1 from Conrad Meyer <cem@freebsd.org> --- 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.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-212065-8-utWcxJyiK6>