cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-2565128 ] "not new enough" file when using CURL_TIMECOND_IFMODSINCE

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Wed, 04 Feb 2009 20:44:07 +0000

Bugs item #2565128, was opened at 2009-02-04 20:51
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2565128&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: http
Group: wrong behaviour
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jocelyn (jocelynj)
Assigned to: Daniel Stenberg (bagder)
Summary: "not new enough" file when using CURL_TIMECOND_IFMODSINCE

Initial Comment:
Hi,

I'm using libcurl 7.18.2-8 in a C program, and I get the message "The requested document is not new enough" even if the server sends a file with response 200 OK. The problem I have with this behaviour is that the program depends on the HTTP response code to know if there was a more recent file or not on the server, and expects to receive a file when getting 200 OK. But in this case, curl doesn't modify the http headers, and makes a 0-byte file.

This behaviour happens if the server doesn't have a correct time, and is in the past. If the client sends a request with an If-Modified-Since header with a future date for the server, then the server can send a 200 OK response. I'm joining a file to show one transfer like this.

In my opinion, curl shouldn't check the file time in addition to the check done by the server, except if there is a good reason. I have checked curl code, and it seems that if there is a 304 http response received, libcurl already behaves correctly, and there is an additional code to check the filetime returned by the server (line 498 of lib/transfer.c on revision 7.19.3)

Thanks !

----------------------------------------------------------------------

>Comment By: Daniel Stenberg (bagder)
Date: 2009-02-04 21:44

Message:
I beg to differ.

The option you pass to libcurl is about requesting a document modified
since a specific date, and libcurl takes measures to only deliver the
document if newer (or older) than the specified time. Why would you like to
get the document that hasn't changed even though you explicitly asked you
didn't want it then?

What I think could be argued is how this is signaled to the application,
as just returning CURLE_OK doesn't feel quite right to me as that would
imply a normal transfer which with it isn't exactly...

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2565128&group_id=976
Received on 2009-02-04

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET