summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-01-01 00:48:40 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-01-01 00:49:37 +0100
commitfce912139a2e331cc43e674c01d46edfbde65628 (patch)
treeacffa8beaee3ab306fdbaadf3d52ad8b61531dae
parent3c7483efb4ed95d0a866325ce36db673e25e5117 (diff)
downloadcurl-fce912139a2e331cc43e674c01d46edfbde65628.tar.gz
c-hyper: add timecondition to the request
Test 77-78 Closes #6391
-rw-r--r--lib/c-hyper.c6
-rw-r--r--lib/http.c13
-rw-r--r--lib/http.h9
3 files changed, 23 insertions, 5 deletions
diff --git a/lib/c-hyper.c b/lib/c-hyper.c
index 2825e2ce9..b6eb7466d 100644
--- a/lib/c-hyper.c
+++ b/lib/c-hyper.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, 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
@@ -823,6 +823,10 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
if(result)
return result;
+ result = Curl_add_timecondition(conn, headers);
+ if(result)
+ return result;
+
result = Curl_add_custom_headers(conn, FALSE, headers);
if(result)
return result;
diff --git a/lib/http.c b/lib/http.c
index 691c0937f..5ab1522e8 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, 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
@@ -1863,7 +1863,12 @@ CURLcode Curl_add_custom_headers(struct connectdata *conn,
#ifndef CURL_DISABLE_PARSEDATE
CURLcode Curl_add_timecondition(const struct connectdata *conn,
- struct dynbuf *req)
+#ifndef USE_HYPER
+ struct dynbuf *req
+#else
+ void *req
+#endif
+ )
{
struct Curl_easy *data = conn->data;
const struct tm *tm;
@@ -1922,7 +1927,11 @@ CURLcode Curl_add_timecondition(const struct connectdata *conn,
tm->tm_min,
tm->tm_sec);
+#ifndef USE_HYPER
result = Curl_dyn_add(req, datestr);
+#else
+ result = Curl_hyper_header(data, req, datestr);
+#endif
return result;
}
diff --git a/lib/http.h b/lib/http.h
index a250ba8f7..b5e6ae915 100644
--- a/lib/http.h
+++ b/lib/http.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, 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
@@ -66,7 +66,12 @@ CURLcode Curl_buffer_send(struct dynbuf *in,
#endif
CURLcode Curl_add_timecondition(const struct connectdata *conn,
- struct dynbuf *buf);
+#ifndef USE_HYPER
+ struct dynbuf *req
+#else
+ void *headers
+#endif
+ );
CURLcode Curl_add_custom_headers(struct connectdata *conn,
bool is_connect,
#ifndef USE_HYPER