file: add support for CURLOPT_TIMECONDITION
This commit is contained in:
parent
99dcb11ed8
commit
b89122a2bf
@ -1552,9 +1552,9 @@ not set.
|
|||||||
|
|
||||||
If this option is used several times, the last one will be used.
|
If this option is used several times, the last one will be used.
|
||||||
.IP "-z/--time-cond <date expression>"
|
.IP "-z/--time-cond <date expression>"
|
||||||
(HTTP/FTP) Request a file that has been modified later than the given time and
|
(HTTP/FTP/FILE) Request a file that has been modified later than the given time
|
||||||
date, or one that has been modified before that time. The date expression can
|
and date, or one that has been modified before that time. The date expression
|
||||||
be all sorts of date strings or if it doesn't match any internal ones, it
|
can be all sorts of date strings or if it doesn't match any internal ones, it
|
||||||
tries to get the time from a given file name instead! See the
|
tries to get the time from a given file name instead! See the
|
||||||
\fIcurl_getdate(3)\fP man pages for date expression details.
|
\fIcurl_getdate(3)\fP man pages for date expression details.
|
||||||
|
|
||||||
|
@ -1648,8 +1648,8 @@ given limit. This concerns both FTP and HTTP transfers.
|
|||||||
.IP CURLOPT_TIMECONDITION
|
.IP CURLOPT_TIMECONDITION
|
||||||
Pass a long as parameter. This defines how the \fICURLOPT_TIMEVALUE\fP time
|
Pass a long as parameter. This defines how the \fICURLOPT_TIMEVALUE\fP time
|
||||||
value is treated. You can set this parameter to \fICURL_TIMECOND_IFMODSINCE\fP
|
value is treated. You can set this parameter to \fICURL_TIMECOND_IFMODSINCE\fP
|
||||||
or \fICURL_TIMECOND_IFUNMODSINCE\fP. This feature applies to HTTP, FTP, and
|
or \fICURL_TIMECOND_IFUNMODSINCE\fP. This feature applies to HTTP, FTP, RTSP,
|
||||||
RTSP.
|
and FILE.
|
||||||
|
|
||||||
The last modification time of a file is not always known and in such instances
|
The last modification time of a file is not always known and in such instances
|
||||||
this feature will have no effect even if the given time condition would not
|
this feature will have no effect even if the given time condition would not
|
||||||
|
@ -463,6 +463,13 @@ static CURLcode file_do(struct connectdata *conn, bool *done)
|
|||||||
fstated = TRUE;
|
fstated = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(fstated && !data->state.range && data->set.timecondition) {
|
||||||
|
if(!Curl_meets_timecondition(data, data->info.filetime)) {
|
||||||
|
*done = TRUE;
|
||||||
|
return CURLE_OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* If we have selected NOBODY and HEADER, it means that we only want file
|
/* If we have selected NOBODY and HEADER, it means that we only want file
|
||||||
information. Which for FILE can't be much more than the file size and
|
information. Which for FILE can't be much more than the file size and
|
||||||
date. */
|
date. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user