diff options
author | murray <murray@FreeBSD.org> | 2008-12-15 08:27:44 +0000 |
---|---|---|
committer | murray <murray@FreeBSD.org> | 2008-12-15 08:27:44 +0000 |
commit | 72a890ccd7d1c4fd04c561303e0ad5e45a6a4aaa (patch) | |
tree | 9ece849067a9d612c3bf00d2dd2a07b33b383a74 /lib/libfetch/fetch.3 | |
parent | 3475c71ce83c2101fd0d42512193048affde82cc (diff) | |
download | FreeBSD-src-72a890ccd7d1c4fd04c561303e0ad5e45a6a4aaa.zip FreeBSD-src-72a890ccd7d1c4fd04c561303e0ad5e45a6a4aaa.tar.gz |
Add support for HTTP 1.1 If-Modified-Since behavior.
fetch(1) accepts a new argument -i <file> that if specified will cause
the file to be downloaded only if it is more recent than the mtime of
<file>.
libfetch(3) accepts the mtime in the url structure and a flag to
indicate when this behavior is desired.
PR: bin/87841
Submitted by: Jukka A. Ukkonen <jau@iki.fi> (partially)
Reviewed by: des, ru
MFC after: 3 weeks
Diffstat (limited to 'lib/libfetch/fetch.3')
-rw-r--r-- | lib/libfetch/fetch.3 | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/libfetch/fetch.3 b/lib/libfetch/fetch.3 index 81b7164..9b312b0 100644 --- a/lib/libfetch/fetch.3 +++ b/lib/libfetch/fetch.3 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 18, 2007 +.Dd December 14, 2008 .Dt FETCH 3 .Os .Sh NAME @@ -165,9 +165,16 @@ struct url { char *doc; off_t offset; size_t length; + time_t ims_time; }; .Ed .Pp +The +.Va ims_time +field stores the time value for +.Li If-Modified-Since +HTTP requests. +.Pp The pointer returned by .Fn fetchMakeURL or @@ -353,6 +360,22 @@ and .Fn fetchPutHTTP will use a direct connection even if a proxy server is defined. .Pp +If the +.Ql i +(if-modified-since) flag is specified, and +the +.Va ims_time +field is set in +.Vt "struct url" , +then +.Fn fetchXGetHTTP +and +.Fn fetchGetHTTP +will send a conditional +.Li If-Modified-Since +HTTP header to only fetch the content if it is newer than +.Va ims_time . +.Pp Since there seems to be no good way of implementing the HTTP PUT method in a manner consistent with the rest of the .Nm fetch |