summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-11-19 10:55:23 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-11-19 10:57:13 +0100
commitf629d75f40376c4caa1cc96c6a1da7cecfafd37c (patch)
tree2e02588cf7875b1fc3065592f509547249ddcc8f
parentba0657c343f0c3eff28f7d56cff3196c6443e0b9 (diff)
downloadcurl-f629d75f40376c4caa1cc96c6a1da7cecfafd37c.tar.gz
http: enable haproxy support for hyper backend
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
-rw-r--r--lib/http.c11
-rw-r--r--lib/http.h4
-rw-r--r--tests/data/DISABLED2
3 files changed, 8 insertions, 9 deletions
diff --git a/lib/http.c b/lib/http.c
index 78ad10ede..58d209584 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -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 */
/* ------------------------------------------------------------------------- */
@@ -2666,9 +2663,13 @@ CURLcode Curl_http_bodysend(struct Curl_easy *data, struct connectdata *conn,
http->postdata = (char *)&http->postdata;
}
}
+#ifdef USE_HYPER
+ result = CURLE_OK;
+#else
/* issue the request */
result = Curl_buffer_send(r, data, &data->info.request_size, included_body,
FIRSTSOCKET);
+#endif
if(result)
failf(data, "Failed sending HTTP POST request");
@@ -2682,9 +2683,13 @@ CURLcode Curl_http_bodysend(struct Curl_easy *data, struct connectdata *conn,
if(result)
return result;
+#ifdef USE_HYPER
+ result = CURLE_OK;
+#else
/* issue the request */
result = Curl_buffer_send(r, data, &data->info.request_size, 0,
FIRSTSOCKET);
+#endif
if(result)
failf(data, "Failed sending HTTP request");
diff --git a/lib/http.h b/lib/http.h
index cb5b56faf..b4aaba2a2 100644
--- a/lib/http.h
+++ b/lib/http.h
@@ -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
diff --git a/tests/data/DISABLED b/tests/data/DISABLED
index 82609cf60..eaa0e2053 100644
--- a/tests/data/DISABLED
+++ b/tests/data/DISABLED
@@ -59,8 +59,6 @@
1021
1156
1417
-1455
-1456
1525
1526
1527