CURLOPT_TIMECONDITION.3 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" **************************************************************************
  22. .\"
  23. .TH CURLOPT_TIMECONDITION 3 "17 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_TIMECONDITION \- select condition for a time request
  26. .SH SYNOPSIS
  27. .nf
  28. #include <curl/curl.h>
  29. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TIMECONDITION, long cond);
  30. .fi
  31. .SH DESCRIPTION
  32. Pass a long as parameter. This defines how the \fICURLOPT_TIMEVALUE(3)\fP time
  33. value is treated. You can set this parameter to \fICURL_TIMECOND_IFMODSINCE\fP
  34. or \fICURL_TIMECOND_IFUNMODSINCE\fP.
  35. The last modification time of a file is not always known and in such instances
  36. this feature will have no effect even if the given time condition would not
  37. have been met. \fIcurl_easy_getinfo(3)\fP with the
  38. \fICURLINFO_CONDITION_UNMET\fP option can be used after a transfer to learn if
  39. a zero-byte successful "transfer" was due to this condition not matching.
  40. .SH DEFAULT
  41. CURL_TIMECOND_NONE (0)
  42. .SH PROTOCOLS
  43. HTTP, FTP, RTSP, and FILE
  44. .SH EXAMPLE
  45. .nf
  46. CURL *curl = curl_easy_init();
  47. if(curl) {
  48. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  49. /* January 1, 2020 is 1577833200 */
  50. curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
  51. /* If-Modified-Since the above time stamp */
  52. curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
  53. /* Perform the request */
  54. curl_easy_perform(curl);
  55. }
  56. .fi
  57. .SH AVAILABILITY
  58. Always
  59. .SH RETURN VALUE
  60. Returns CURLE_OK
  61. .SH "SEE ALSO"
  62. .BR CURLOPT_TIMEVALUE "(3), "