]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http: enable haproxy support for hyper backend
authorDaniel Stenberg <daniel@haxx.se>
Fri, 19 Nov 2021 09:55:23 +0000 (10:55 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 19 Nov 2021 13:06:42 +0000 (14:06 +0100)
This is done by having native code do the haproxy header output before
hyper issues its request. The little downside with this approach is that
we need the entire Curl_buffer_send() function built, which is otherwise
not used for hyper builds.

If hyper ends up getting native support for the haproxy protocols we can
backpedal on this.

Enables test 1455 and 1456

Closes #8034

lib/http.c
lib/http.h
tests/data/DISABLED

index 78ad10edeadd5874e4a112125648f5abc9cb52a8..1bef121a9c2ded1b44e15092d93a905fc50753b6 100644 (file)
@@ -1153,7 +1153,6 @@ static bool http_should_fail(struct Curl_easy *data)
   return data->state.authproblem;
 }
 
-#ifndef USE_HYPER
 /*
  * readmoredata() is a "fread() emulation" to provide POST and/or request
  * data. It is used when a huge POST is to be made and the entire chunk wasn't
@@ -1412,8 +1411,6 @@ CURLcode Curl_buffer_send(struct dynbuf *in,
   return result;
 }
 
-#endif
-
 /* end of the add_buffer functions */
 /* ------------------------------------------------------------------------- */
 
@@ -2375,6 +2372,9 @@ CURLcode Curl_http_bodysend(struct Curl_easy *data, struct connectdata *conn,
 #ifndef USE_HYPER
   /* Hyper always handles the body separately */
   curl_off_t included_body = 0;
+#else
+  /* from this point down, this function should not be used */
+#define Curl_buffer_send(a,b,c,d,e) CURLE_OK
 #endif
   CURLcode result = CURLE_OK;
   struct HTTP *http = data->req.p.http;
@@ -2685,7 +2685,6 @@ CURLcode Curl_http_bodysend(struct Curl_easy *data, struct connectdata *conn,
     /* issue the request */
     result = Curl_buffer_send(r, data, &data->info.request_size, 0,
                               FIRSTSOCKET);
-
     if(result)
       failf(data, "Failed sending HTTP request");
     else
index cb5b56faf37e0371b1ff3d038727b1e756a2001b..b4aaba2a26bbcaecb9ff8a9be5232e43db3c7d13 100644 (file)
@@ -54,15 +54,11 @@ char *Curl_copy_header_value(const char *header);
 char *Curl_checkProxyheaders(struct Curl_easy *data,
                              const struct connectdata *conn,
                              const char *thisheader);
-#ifndef USE_HYPER
 CURLcode Curl_buffer_send(struct dynbuf *in,
                           struct Curl_easy *data,
                           curl_off_t *bytes_written,
                           curl_off_t included_body_bytes,
                           int socketindex);
-#else
-#define Curl_buffer_send(a,b,c,d,e) CURLE_OK
-#endif
 
 CURLcode Curl_add_timecondition(struct Curl_easy *data,
 #ifndef USE_HYPER
index 82609cf60668c96856244c7b9e2bb4da10cf1a5d..eaa0e20532e4a7d8c50cc4a284f0b609053f892d 100644 (file)
@@ -59,8 +59,6 @@
 1021
 1156
 1417
-1455
-1456
 1525
 1526
 1527