Changelog
+Daniel Stenberg (11 Feb 2009)
+- CURLINFO_CONDITION_UNMET was added to allow an application to get to know if
+ the condition in the previous request was unmet. This is typically a time
+ condition set with CURLOPT_TIMECONDITION and was previously not possible to
+ reliably figure out. From bug report #2565128
+ (http://curl.haxx.se/bug/view.cgi?id=2565128)
+
Daniel Fandrich (4 Feb 2009)
- Don't add the standard /usr/lib or /usr/include paths to LDFLAGS and CPPFLAGS
(respectively) when --with-ssl=/usr is used (patch based on FreeBSD).
o Improved IPv6 support when built with with c-ares >= 1.6.1
o Added CURLPROXY_HTTP_1_0 and --proxy1.0
o Added docs/libcurl/symbols-in-versions
+ o Added CURLINFO_CONDITION_UNMET
This release includes the following bugfixes:
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
.\" * $Id$
.\" **************************************************************************
.\"
-.TH curl_easy_getinfo 3 "16 Oct 2008" "libcurl 7.19.1" "libcurl Manual"
+.TH curl_easy_getinfo 3 "11 Feb 2009" "libcurl 7.19.4" "libcurl Manual"
.SH NAME
curl_easy_getinfo - extract information from a curl handle
.SH SYNOPSIS
for the specific named data. See also the certinfo.c example. NOTE: this
option is only available in libcurl built with OpenSSL support. (Added in
7.19.1)
+.IP CURLINFO_CONDITION_UNMET
+Pass a pointer to a long to receive the number 1 if the condition provided in
+the previous request didn't match (see \fICURLOPT_TIMECONDITION\fP). Alas, if
+this returns a 1 you know that the reason you didn't get data in return is
+because it didn't fulfill the condition. The long ths argument points to will
+get a zero stored if the condition instead was met. (Added in 7.19.4)
.SH TIMES
.NF
An overview of the six time values available from curl_easy_getinfo()
or \fICURL_TIMECOND_IFUNMODSINCE\fP. This feature applies to HTTP and FTP.
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 have
-been met.
+this feature will have no effect even if the given time condition would not
+have been met. \fIcurl_easy_getinfo(3)\fP with the
+\fICURLINFO_CONDITION_UNMET\fP option can be used after a transfer to learn if
+a zero-byte successful "transfer" was due to this condition not matching.
.IP CURLOPT_TIMEVALUE
Pass a long as parameter. This should be the time in seconds since 1 Jan 1970,
and the time will be used in a condition as specified with
CURLFTPSSL_CCC_PASSIVE 7.16.1
CURLINFO_APPCONNECT_TIME 7.19.0
CURLINFO_CERTINFO 7.19.1
+CURLINFO_CONDITION_UNMET 7.19.4
CURLINFO_CONNECT_TIME 7.4.1
CURLINFO_CONTENT_LENGTH_DOWNLOAD 7.6.1
CURLINFO_CONTENT_LENGTH_UPLOAD 7.6.1
CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,
CURLINFO_CERTINFO = CURLINFO_SLIST + 34,
+ CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35,
/* Fill in new entries below here! */
- CURLINFO_LASTONE = 34
+ CURLINFO_LASTONE = 35
} CURLINFO;
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
if(data->info.filetime <= data->set.timevalue) {
infof(data, "The requested document is not new enough\n");
ftp->transfer = FTPTRANSFER_NONE; /* mark this to not transfer data */
+ data->info.timecond = TRUE;
state(conn, FTP_STOP);
return CURLE_OK;
}
if(data->info.filetime > data->set.timevalue) {
infof(data, "The requested document is not old enough\n");
ftp->transfer = FTPTRANSFER_NONE; /* mark this to not transfer data */
+ data->info.timecond = TRUE;
state(conn, FTP_STOP);
return CURLE_OK;
}
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
ptr.to_certinfo = &data->info.certs;
*param_slistp = ptr.to_slist;
break;
+ case CURLINFO_CONDITION_UNMET:
+ /* return if the condition prevented the document to get transfered */
+ *param_longp = data->info.timecond;
+ break;
default:
return CURLE_BAD_FUNCTION_ARGUMENT;
}
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
infof(data,
"The requested document is not new enough\n");
*done = TRUE;
+ data->info.timecond = TRUE;
return CURLE_OK;
}
break;
infof(data,
"The requested document is not old enough\n");
*done = TRUE;
+ data->info.timecond = TRUE;
return CURLE_OK;
}
break;
* MUST NOT contain a message-body, and thus is always
* terminated by the first empty line after the header
* fields. */
+ if(data->set.timecondition)
+ data->info.timecond = TRUE;
k->size=0;
k->maxdownload=0;
k->ignorecl = TRUE; /* ignore Content-Length headers */
was unretrievable. We cannot have this of type time_t,
since time_t is unsigned on several platforms such as
OpenVMS. */
+ bool timecond; /* set to TRUE if the time condition didn't match, which
+ thus made the document NOT get fetched */
long header_size; /* size of read header(s) in bytes */
long request_size; /* the amount of bytes sent in the request(s) */
long proxyauthavail; /* what proxy auth types were announced */