Bug 87841 - fetch(1) should have options to set http "if-modified-since"
Summary: fetch(1) should have options to set http "if-modified-since"
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 4.11-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Murray Stokely
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-22 13:50 UTC by jau
Modified: 2010-08-04 03:36 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jau 2005-10-22 13:50:12 UTC
              Quite often there is a need to fetch a new copy of a file only when
the source file to be copied over has changed since the local version was last
updated.
To avoid an unnecessary fetch over http(s) it would be useful to add two new
command line options to fetch.
- One to specify the time to use in the if-modified-since header of the request
directly from the command line.
- Another to specify a reference file whose modify time to use as the content
of the if-modified-since request header.

None of this of course would work for ftp, but for http and https it would be
a major benefit to be able to avoid pointless downloads when the local data
is already as fresh as the data that would be pulled in.
When fetching with http or https over a long distance connection the amount of
time saved could be huge.

Fix: 

The only known fix is to add the if-modified-since header and
ability to parse to the potential "not modified" response.
How-To-Repeat:               Just copy a few large files over a long distance connection using
fetch when your local copy is already as fresh as the one you receive, and you
should instantly understand why I am proposing this.
Comment 1 Gavin Atkinson freebsd_committer freebsd_triage 2007-06-23 16:58:48 UTC
Responsible Changed
From-To: freebsd-bugs->des


Over to fetch(1) maintainer
Comment 2 murray.stokely 2008-12-10 07:24:11 UTC
Jukka, if you are still interested in this, please try this patch
against FreeBSD 6.4.  Apply from /usr/src, then cd
/usr/src/lib/libfetch; make all install; cd /usr/src/usr.bin/fetch;
make all install

http://people.freebsd.org/~murray/patches/fetch-if-modified-since-6.4.diff

       - Murray
Comment 3 Murray Stokely freebsd_committer freebsd_triage 2008-12-15 08:28:00 UTC
State Changed
From-To: open->patched

This change has been committed to HEAD.  Will MFC to 7.x after 7.1 is 
released. 



Comment 4 Murray Stokely freebsd_committer freebsd_triage 2008-12-15 08:28:00 UTC
Responsible Changed
From-To: des->murray

This change has been committed to HEAD.  Will MFC to 7.x after 7.1 is 
released.
Comment 5 murray.stokely 2009-01-11 01:47:01 UTC
This has been merged to FreeBSD 7.x-STABLE.  Will also merge it soon to 6.x.

Murray
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2010-08-04 03:34:31 UTC
State Changed
From-To: patched->closed

Murray has returned his src bit for safekeeping. 

With the EOL of 6.x rapidly approaching, I'm just going to go ahead and 
close this with my bugmeister's hat on.