summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util/client.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/util/client.c b/src/util/client.c
index d957dd00a..ed554d96c 100644
--- a/src/util/client.c
+++ b/src/util/client.c
@@ -253,6 +253,7 @@ struct GNUNET_CLIENT_Connection
};
+
/**
* Try to connect to the service.
*
@@ -272,7 +273,7 @@ do_connect (const char *service_name,
unsigned long long port;
#if AF_UNIX
- if (0 == attempt % 2)
+ if (0 == (attempt % 2))
{
/* on even rounds, try UNIX */
if (GNUNET_OK ==
@@ -314,6 +315,27 @@ do_connect (const char *service_name,
service_name);
return NULL;
}
+ if (port == 0)
+ {
+#if AF_UNIX
+ if (0 != (attempt % 2))
+ {
+ /* try UNIX */
+ if (GNUNET_OK ==
+ GNUNET_CONFIGURATION_get_value_string (cfg,
+ service_name,
+ "UNIXPATH", &unixpath))
+ {
+ sock = GNUNET_CONNECTION_create_from_connect_to_unixpath (cfg,
+ unixpath);
+ GNUNET_free (unixpath);
+ if (sock != NULL)
+ return sock;
+ }
+ }
+#endif
+ return NULL;
+ }
sock = GNUNET_CONNECTION_create_from_connect (cfg,
hostname,
port);