aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsaac Boukris <iboukris@gmail.com>2017-02-24 11:28:08 +0200
committerJay Satiro <raysatiro@yahoo.com>2017-02-25 18:21:15 -0500
commit1f8023ceb5dc6b142c51fe161e0574b4d7f14b5e (patch)
tree02945019b418f874f73f8d4876f993bb66c37c99
parentf7285cc02b6a3aabf7ccc6959f46f0d17d179ab6 (diff)
url: fix unix-socket support for proxy-disabled builds
Prior to this change if curl was built with Unix Socket support (--enable-unix-sockets) and without Proxy support (--disable-proxy) then unix socket options would erroneously be ignored. Regression introduced in: 0b8d682f81ee9acb763dd4c9ad805fe08d1227c0 Bug: https://github.com/curl/curl/issues/1274 Reported-by: mccormickt12@users.noreply.github.com Closes https://github.com/curl/curl/pull/1289
-rw-r--r--lib/url.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/lib/url.c b/lib/url.c
index b2dac8bcb..94c9bc681 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -6256,6 +6256,17 @@ static CURLcode create_conn(struct Curl_easy *data,
}
}
+#ifdef USE_UNIX_SOCKETS
+ if(data->set.str[STRING_UNIX_SOCKET_PATH]) {
+ conn->unix_domain_socket = strdup(data->set.str[STRING_UNIX_SOCKET_PATH]);
+ if(conn->unix_domain_socket == NULL) {
+ result = CURLE_OUT_OF_MEMORY;
+ goto out;
+ }
+ conn->abstract_unix_socket = data->set.abstract_unix_socket;
+ }
+#endif
+
#ifndef CURL_DISABLE_PROXY
/*************************************************************
* Extract the user and password from the authentication string
@@ -6310,17 +6321,10 @@ static CURLcode create_conn(struct Curl_easy *data,
Curl_safefree(no_proxy);
#ifdef USE_UNIX_SOCKETS
- if(data->set.str[STRING_UNIX_SOCKET_PATH]) {
- if(proxy) {
- free(proxy); /* Unix domain sockets cannot be proxied, so disable it */
- proxy = NULL;
- }
- conn->unix_domain_socket = strdup(data->set.str[STRING_UNIX_SOCKET_PATH]);
- if(conn->unix_domain_socket == NULL) {
- result = CURLE_OUT_OF_MEMORY;
- goto out;
- }
- conn->abstract_unix_socket = data->set.abstract_unix_socket;
+ /* For the time being do not mix proxy and unix domain sockets. See #1274 */
+ if(proxy && conn->unix_domain_socket) {
+ free(proxy);
+ proxy = NULL;
}
#endif