2
0

CURLOPT_TIMECONDITION.3 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2016, 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. #include <curl/curl.h>
  28. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TIMECONDITION, long cond);
  29. .SH DESCRIPTION
  30. Pass a long as parameter. This defines how the \fICURLOPT_TIMEVALUE(3)\fP time
  31. value is treated. You can set this parameter to \fICURL_TIMECOND_IFMODSINCE\fP
  32. or \fICURL_TIMECOND_IFUNMODSINCE\fP.
  33. The last modification time of a file is not always known and in such instances
  34. this feature will have no effect even if the given time condition would not
  35. have been met. \fIcurl_easy_getinfo(3)\fP with the
  36. \fICURLINFO_CONDITION_UNMET\fP option can be used after a transfer to learn if
  37. a zero-byte successful "transfer" was due to this condition not matching.
  38. .SH DEFAULT
  39. CURL_TIMECOND_NONE (0)
  40. .SH PROTOCOLS
  41. HTTP, FTP, RTSP, and FILE
  42. .SH EXAMPLE
  43. .nf
  44. CURL *curl = curl_easy_init();
  45. if(curl) {
  46. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  47. /* January 1, 2020 is 1577833200 */
  48. curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
  49. /* If-Modified-Since the above time stamp */
  50. curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
  51. /* Perform the request */
  52. curl_easy_perform(curl);
  53. }
  54. .fi
  55. .SH AVAILABILITY
  56. Always
  57. .SH RETURN VALUE
  58. Returns CURLE_OK
  59. .SH "SEE ALSO"
  60. .BR CURLOPT_TIMEVALUE "(3), "