mirror of
https://github.com/curl/curl.git
synced 2026-06-04 14:04:16 +03:00
remove the asserts, let SOCKS filter create fail without hostname
This commit is contained in:
parent
088398af06
commit
a08c40df06
2 changed files with 3 additions and 6 deletions
|
|
@ -1297,8 +1297,6 @@ connect_sub_chain:
|
|||
if(ctx->state < CF_SETUP_CNNCT_SOCKS && cf->conn->bits.socksproxy) {
|
||||
/* Where do we need the SOCKS to connect to? */
|
||||
if(cf->conn->bits.httpproxy) {
|
||||
DEBUGASSERT(cf->conn->http_proxy.host.name);
|
||||
DEBUGASSERT(cf->conn->http_proxy.port > 0);
|
||||
result = Curl_cf_socks_proxy_insert_after(
|
||||
cf, data, cf->conn->socks_proxy.proxytype, "HTTP proxy",
|
||||
cf->conn->http_proxy.host.name, (int)cf->conn->http_proxy.port,
|
||||
|
|
@ -1315,8 +1313,6 @@ connect_sub_chain:
|
|||
cf->conn->bits.conn_to_port ? cf->conn->conn_to_port :
|
||||
cf->conn->remote_port;
|
||||
|
||||
DEBUGASSERT(sx_hostname);
|
||||
DEBUGASSERT(sx_remote_port > 0);
|
||||
result = Curl_cf_socks_proxy_insert_after(
|
||||
cf, data, cf->conn->socks_proxy.proxytype, NULL,
|
||||
sx_hostname, sx_remote_port,
|
||||
|
|
|
|||
|
|
@ -1216,6 +1216,9 @@ CURLcode Curl_cf_socks_proxy_insert_after(struct Curl_cfilter *cf_at,
|
|||
struct socks_state *sx;
|
||||
CURLcode result;
|
||||
|
||||
if(!remote_host)
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
|
||||
(void)data;
|
||||
sx = calloc(1, sizeof(*sx));
|
||||
if(!sx)
|
||||
|
|
@ -1228,8 +1231,6 @@ CURLcode Curl_cf_socks_proxy_insert_after(struct Curl_cfilter *cf_at,
|
|||
sx->remote_type = remote_type;
|
||||
sx->hostname = remote_host;
|
||||
sx->remote_port = remote_port;
|
||||
DEBUGASSERT(sx->hostname);
|
||||
DEBUGASSERT(sx->remote_port > 0);
|
||||
sx->proxy_user = proxy_user;
|
||||
sx->proxy_password = proxy_password;
|
||||
sx = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue