From: Stefan Eissing Date: Thu, 17 Nov 2022 09:29:50 +0000 (+0100) Subject: proxy: haproxy filter is only available when PROXY and HTTP are X-Git-Tag: curl-7_87_0~148 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7a19dd8a814d094cede7ca7b03e0e8b7fe7d4def;p=thirdparty%2Fcurl.git proxy: haproxy filter is only available when PROXY and HTTP are Closes #9935 --- diff --git a/lib/cfilters.c b/lib/cfilters.c index 7c439cd63a..5b5b08ecf6 100644 --- a/lib/cfilters.c +++ b/lib/cfilters.c @@ -329,13 +329,13 @@ CURLcode Curl_cfilter_setup(struct Curl_easy *data, (void)ssl_mode; #endif /* USE_SSL */ -#ifndef CURL_DISABLE_PROXY +#if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP) if(data->set.haproxyprotocol) { result = Curl_cfilter_haproxy_add(data, conn, sockindex); if(result) goto out; } -#endif /* !CURL_DISABLE_PROXY */ +#endif /* !CURL_DISABLE_PROXY && !CURL_DISABLE_HTTP */ } DEBUGASSERT(conn->cfilter[sockindex]); diff --git a/lib/http_proxy.c b/lib/http_proxy.c index 9740302050..bb5f04f90f 100644 --- a/lib/http_proxy.c +++ b/lib/http_proxy.c @@ -672,7 +672,7 @@ static CURLcode recv_CONNECT_resp(struct Curl_easy *data, return result; } -#else +#else /* USE_HYPER */ /* The Hyper version of CONNECT */ static CURLcode start_CONNECT(struct Curl_easy *data, struct connectdata *conn, @@ -951,7 +951,7 @@ static CURLcode recv_CONNECT_resp(struct Curl_easy *data, return result; } -#endif +#endif /* USE_HYPER */ static CURLcode CONNECT(struct Curl_cfilter *cf, struct Curl_easy *data, @@ -1188,9 +1188,6 @@ CURLcode Curl_cfilter_http_proxy_add(struct Curl_easy *data, return result; } -#endif /* !CURL_DISABLE_PROXY && !defined(CURL_DISABLE_HTTP) */ - -#if !defined(CURL_DISABLE_PROXY) static CURLcode send_haproxy_header(struct Curl_cfilter*cf, struct Curl_easy *data) @@ -1205,7 +1202,7 @@ static CURLcode send_haproxy_header(struct Curl_cfilter*cf, /* the buffer is large enough to hold this! */ result = Curl_dyn_addn(&req, STRCONST("PROXY UNKNOWN\r\n")); else { -#endif +#endif /* USE_UNIX_SOCKETS */ /* Emit the correct prefix for IPv6 */ tcp_version = cf->conn->bits.ipv6 ? "TCP6" : "TCP4"; @@ -1218,7 +1215,7 @@ static CURLcode send_haproxy_header(struct Curl_cfilter*cf, #ifdef USE_UNIX_SOCKETS } -#endif +#endif /* USE_UNIX_SOCKETS */ if(!result) result = Curl_buffer_send(&req, data, &data->info.request_size, @@ -1275,4 +1272,4 @@ CURLcode Curl_cfilter_haproxy_add(struct Curl_easy *data, return result; } -#endif /* !CURL_DISABLE_PROXY */ +#endif /* !CURL_DISABLE_PROXY &6 ! CURL_DISABLE_HTTP */ diff --git a/lib/http_proxy.h b/lib/http_proxy.h index 7e27f32414..d6629a9708 100644 --- a/lib/http_proxy.h +++ b/lib/http_proxy.h @@ -36,14 +36,10 @@ CURLcode Curl_cfilter_http_proxy_add(struct Curl_easy *data, struct connectdata *conn, int sockindex); -#endif - -#if !defined(CURL_DISABLE_PROXY) - CURLcode Curl_cfilter_haproxy_add(struct Curl_easy *data, struct connectdata *conn, int sockindex); -#endif +#endif /* !CURL_DISABLE_PROXY && !CURL_DISABLE_HTTP */ #endif /* HEADER_CURL_HTTP_PROXY_H */