Date: Thu, 30 Aug 2001 13:17:56 +0000 From: Joseph Mallett <jmallett@NewGold.NET> To: "Andrey A. Chernov" <ache@nagual.pp.ru> Cc: Mike Barcroft <mike@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, jmallett@xMach.org Subject: Re: cvs commit: src/usr.bin/ftp fetch.c Message-ID: <20010830131756.C75112@NewGold.NET> In-Reply-To: <20010830130536.A75112@NewGold.NET> References: <200108300057.f7U0vZ438235@freefall.freebsd.org> <20010830123337.A83774@nagual.pp.ru> <20010830130536.A75112@NewGold.NET>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Aug 30, 2001 at 01:05:37PM +0000, Joseph Mallett wrote: > On Thu, Aug 30, 2001 at 12:33:39PM +0400, Andrey A. Chernov wrote: > > On Wed, Aug 29, 2001 at 17:57:35 -0700, Mike Barcroft wrote: > > > mike 2001/08/29 17:57:35 PDT > > > > > > Modified files: > > > usr.bin/ftp fetch.c > > > Log: > > > Add support for HTTP/1.1 name-based virtual hosts. Also, use > > > > Are you sure that fetch can handle HTTP/1.1 "206 Partial Content" response > > (which may happens if you issue HTTP/1.1 request)? > > > > Currently, I believe it only reacts to "200" (or so a header leads me to > think), I'll go through the standard and read about this and see if I can > make a patch, and if one is needed. > OK, this is what I thought it was. There's no way we need this. 206 is like you get with "download resuming" software. You request just a part of a document because you already have some of it, and the server will respond to you. In other words, it may not happen just because you are using HTTP/1.1. Quote: "The semantics of the GET method change to a "partial GET" if the request message includes a Range header field. A partial GET requests that only part of the entity be transferred, as described in section 14.35. The partial GET method is intended to reduce unnecessary network usage by allowing partially-retrieved entities to be completed without transferring data already held by the client. " Quote: "10.2.7 206 Partial Content The server has fulfilled the partial GET request for the resource. The request MUST have included a Range header field (section 14.35) indicating the desired range, and MAY have included an If-Range header field (section 14.27) to make the request conditional. The response MUST include the following header fields: - Either a Content-Range header field (section 14.16) indicating the range included with this response, or a multipart/byteranges Content-Type including Content-Range fields for each part. If a Content-Length header field is present in the response, its value MUST match the actual number of OCTETs transmitted in the message-body. - Date - ETag and/or Content-Location, if the header would have been sent in a 200 response to the same request - Expires, Cache-Control, and/or Vary, if the field-value might differ from that sent in any previous response for the same variant If the 206 response is the result of an If-Range request that used a strong cache validator (see section 13.3.3), the response SHOULD NOT include other entity-headers. If the response is the result of an If-Range request that used a weak validator, the response MUST NOT include other entity-headers; this prevents inconsistencies between cached entity-bodies and updated headers. Otherwise, the response MUST include all of the entity-headers that would have been returned with a 200 (OK) response to the same request. A cache MUST NOT combine a 206 response with other previously cached content if the ETag or Last-Modified headers do not match exactly, see 13.5.4. A cache that does not support the Range and Content-Range headers MUST NOT cache 206 (Partial) responses." If you would like ftp(1) support to do this (really is easy), I could give you a patch for it, but I don't see that it's really a good thing, because the way I would do it is [pseudocode]: if filename exists on disk request with partial length header from size of existing file open filename for appending write data to filename as normal close filename fi Which is pretty trivial. By the way, this was for ftp(1) not fetch(1). The latter already support(ed|s) name based virtual hosting. /joseph To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010830131756.C75112>