[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 122/264: CURLINFO_CONDITION_UNMET: return true for 304 http stat
From: |
gnunet |
Subject: |
[gnurl] 122/264: CURLINFO_CONDITION_UNMET: return true for 304 http status code |
Date: |
Thu, 30 Apr 2020 16:07:05 +0200 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 54ecc11cc4c4cf4a6ed958fd2906f3a791d1c8d2
Author: Kwon-Young Choi <address@hidden>
AuthorDate: Sat Apr 4 17:27:18 2020 +0200
CURLINFO_CONDITION_UNMET: return true for 304 http status code
In libcurl, CURLINFO_CONDITION_UNMET is used to avoid writing to the
output file if the server did not transfered a file based on time
condition. In the same manner, getting a 304 HTTP response back from the
server, for example after passing a custom If-Match-* header, also
fulfill this condition.
Fixes #5181
Closes #5183
---
docs/libcurl/curl_easy_getinfo.3 | 2 +-
docs/libcurl/opts/CURLINFO_CONDITION_UNMET.3 | 6 ++++--
lib/getinfo.c | 7 +++++--
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/docs/libcurl/curl_easy_getinfo.3 b/docs/libcurl/curl_easy_getinfo.3
index c7b124a24..647165358 100644
--- a/docs/libcurl/curl_easy_getinfo.3
+++ b/docs/libcurl/curl_easy_getinfo.3
@@ -210,7 +210,7 @@ TLS session info that can be used for further processing.
See
\fICURLINFO_TLS_SESSION(3)\fP. Deprecated option, use
\fICURLINFO_TLS_SSL_PTR(3)\fP instead!
.IP CURLINFO_CONDITION_UNMET
-Whether or not a time conditional was met.
+Whether or not a time conditional was met or 304 HTTP response.
See \fICURLINFO_CONDITION_UNMET(3)\fP
.IP CURLINFO_RTSP_SESSION_ID
RTSP session ID.
diff --git a/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.3
b/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.3
index 27488656e..78c28fa02 100644
--- a/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.3
+++ b/docs/libcurl/opts/CURLINFO_CONDITION_UNMET.3
@@ -22,7 +22,7 @@
.\"
.TH CURLINFO_CONDITION_UNMET 3 "1 Sep 2015" "libcurl 7.44.0"
"curl_easy_getinfo options"
.SH NAME
-CURLINFO_CONDITION_UNMET \- get info on unmet time conditional
+CURLINFO_CONDITION_UNMET \- get info on unmet time conditional or 304 HTTP
response.
.SH SYNOPSIS
#include <curl/curl.h>
@@ -32,7 +32,9 @@ 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(3)\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 this argument points to will
-get a zero stored if the condition instead was met.
+get a zero stored if the condition instead was met. This can also return 1 if
+the server responded with a 304 HTTP status code, for example after sending a
+custom "If-Match-*" header.
.SH PROTOCOLS
HTTP and some
.SH EXAMPLE
diff --git a/lib/getinfo.c b/lib/getinfo.c
index 18274e964..84d9fc1c6 100644
--- a/lib/getinfo.c
+++ b/lib/getinfo.c
@@ -239,8 +239,11 @@ static CURLcode getinfo_long(struct Curl_easy *data,
CURLINFO info,
*param_longp = data->info.conn_local_port;
break;
case CURLINFO_CONDITION_UNMET:
- /* return if the condition prevented the document to get transferred */
- *param_longp = data->info.timecond ? 1L : 0L;
+ if(data->info.httpcode == 304)
+ *param_longp = 1L;
+ else
+ /* return if the condition prevented the document to get transferred */
+ *param_longp = data->info.timecond ? 1L : 0L;
break;
case CURLINFO_RTSP_CLIENT_CSEQ:
*param_longp = data->state.rtsp_next_client_CSeq;
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 107/264: vquic: add support for GnuTLS backend of ngtcp2, (continued)
- [gnurl] 107/264: vquic: add support for GnuTLS backend of ngtcp2, gnunet, 2020/04/30
- [gnurl] 112/264: ftpserver.pl: log before and after data connection is closed, gnunet, 2020/04/30
- [gnurl] 113/264: runtests.pl: log host OS as detected by Perl environment, gnunet, 2020/04/30
- [gnurl] 136/264: warnless: remove code block for icc that didn't work, gnunet, 2020/04/30
- [gnurl] 109/264: vquic/ngtcp2.h: update copyright year range, gnunet, 2020/04/30
- [gnurl] 81/264: openssl: adapt to functions marked as deprecated since version 3, gnunet, 2020/04/30
- [gnurl] 110/264: RELEASE-PROCEDURE.md: run the copyright.pl script!, gnunet, 2020/04/30
- [gnurl] 111/264: RELEASE-NOTES: synced, gnunet, 2020/04/30
- [gnurl] 114/264: CI: increase Azure Pipelines timeouts due to performance issues, gnunet, 2020/04/30
- [gnurl] 141/264: select: remove typecast from SOCKET_WRITABLE/READABLE macros, gnunet, 2020/04/30
- [gnurl] 122/264: CURLINFO_CONDITION_UNMET: return true for 304 http status code,
gnunet <=
- [gnurl] 236/264: gnutls: bump lowest supported version to 3.1.10, gnunet, 2020/04/30
- [gnurl] 137/264: configure: remove use of -vec-report0 from CFLAGS with icc, gnunet, 2020/04/30
- [gnurl] 117/264: sockfilt: fix handling of ready closed sockets on Windows, gnunet, 2020/04/30
- [gnurl] 124/264: KNOWN_BUGS: fixed "USE_UNIX_SOCKETS on Windows", gnunet, 2020/04/30
- [gnurl] 154/264: CI/macos: convert CRLF to LF and align indentation, gnunet, 2020/04/30
- [gnurl] 152/264: server/resolve: remove AI_CANONNAME to make macos tell the truth, gnunet, 2020/04/30
- [gnurl] 213/264: tests/FILEFORMAT: converted to markdown and extended, gnunet, 2020/04/30
- [gnurl] 259/264: doh: Constify some input pointers, gnunet, 2020/04/30
- [gnurl] 161/264: release-notes.pl: detect the start of the references in cleanup mode, gnunet, 2020/04/30
- [gnurl] 214/264: mime: properly check Content-Type even if it has parameters, gnunet, 2020/04/30