|
|
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: Thu, 12 Feb 2009 08:05:04 +0000
Bugs item #2565128, was opened at 2009-02-04 20:51
Please note that this message will contain a full copy of the comment thread,
Initial Comment:
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)
Message:
----------------------------------------------------------------------
Comment By: Jocelyn (jocelynj)
Message:
----------------------------------------------------------------------
Comment By: Jocelyn (jocelynj)
Message:
It looks like that the info variable is always set when I don't set
For reference, my real name is Jocelyn Jaubert.
Thanks.
----------------------------------------------------------------------
Comment By: Daniel Stenberg (bagder)
Message:
Thanks for the report!
----------------------------------------------------------------------
Comment By: Daniel Stenberg (bagder)
Message:
If you tell me your real name I'll give you proper credit for this work in
----------------------------------------------------------------------
Comment By: Jocelyn (jocelynj)
Message:
A better name could be CURLINFO_CONDITIONAL_FAILED or
----------------------------------------------------------------------
Comment By: Daniel Stenberg (bagder)
Message:
Existing libcurl versions of course already exist and need to be dealt
> If libcurl fails to download the file because of the time condition,
Mostly libcurl doesn't touch target files at all, as your app would deal
----------------------------------------------------------------------
Comment By: Jocelyn (jocelynj)
Message:
There is still the problem on how to handle already existing applications,
If libcurl fails to download the file because of the time condition, will
----------------------------------------------------------------------
Comment By: Daniel Stenberg (bagder)
Message:
I'm now more thinking of a new info-variable to be readable after a
What do you think about that idea?
----------------------------------------------------------------------
Comment By: Jocelyn (jocelynj)
Message:
- we trust everything that the server sends, so libcurl doesn't have to
- we don't trust the server, so libcurl do another check on time. In this
If I understand your point, you prefer the second possibility. In this
If you prefer not sending CURLE_OK, that's fine - I suppose that the
----------------------------------------------------------------------
Comment By: Daniel Stenberg (bagder)
Message:
The option you pass to libcurl is about requesting a document modified
What I think could be argued is how this is signaled to the application,
----------------------------------------------------------------------
You can respond by visiting:
These mail archives are generated by hypermail. |
Page updated November 12, 2010.
web site info