proxy: haproxy filter is only available when PROXY and HTTP are

Closes #9935
This commit is contained in:
Stefan Eissing 2022-11-17 10:29:50 +01:00 committed by Daniel Stenberg
parent 14d5589032
commit 7a19dd8a81
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
3 changed files with 8 additions and 15 deletions

View File

@ -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]);

View File

@ -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 */

View File

@ -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 */