diff options
author | Murray Stokely <murray@FreeBSD.org> | 2008-12-15 08:27:44 +0000 |
---|---|---|
committer | Murray Stokely <murray@FreeBSD.org> | 2008-12-15 08:27:44 +0000 |
commit | 7f92799f678efdf44f0f4d3322f49498749e4468 (patch) | |
tree | 9ece849067a9d612c3bf00d2dd2a07b33b383a74 /lib/libfetch/fetch.3 | |
parent | 0a420d08ae2e066c872a51dba7646a5a6528f9d0 (diff) | |
download | src-7f92799f678efdf44f0f4d3322f49498749e4468.tar.gz src-7f92799f678efdf44f0f4d3322f49498749e4468.zip |
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
Notes
Notes:
svn path=/head/; revision=186124
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 81b716409059..9b312b0a1f1f 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 |