]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
c-hyper: add timecondition to the request
authorDaniel Stenberg <daniel@haxx.se>
Thu, 31 Dec 2020 23:48:40 +0000 (00:48 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 31 Dec 2020 23:49:37 +0000 (00:49 +0100)
Test 77-78

Closes #6391

lib/c-hyper.c
lib/http.c
lib/http.h

index 2825e2ce90e6a42e0c940d0099cac2273bb6af1a..b6eb7466d5370e5cab085311f509cf3ed2982eb7 100644 (file)
@@ -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;
index 691c0937f1a3b6b28842fabb2b0ff67e0a220d94..5ab1522e82ff68aff18ffaf99b03a918985c1ccd 100644 (file)
@@ -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;
 }
index a250ba8f77e147240c8e6a3c0b0135fad5adff1f..b5e6ae915772d1b3a640a119f22f1cde1155acd5 100644 (file)
@@ -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