diff options
Diffstat (limited to 'src/util/client.c')
-rw-r--r-- | src/util/client.c | 24 |
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 | |||
253 | 253 | ||
254 | }; | 254 | }; |
255 | 255 | ||
256 | |||
256 | /** | 257 | /** |
257 | * Try to connect to the service. | 258 | * Try to connect to the service. |
258 | * | 259 | * |
@@ -272,7 +273,7 @@ do_connect (const char *service_name, | |||
272 | unsigned long long port; | 273 | unsigned long long port; |
273 | 274 | ||
274 | #if AF_UNIX | 275 | #if AF_UNIX |
275 | if (0 == attempt % 2) | 276 | if (0 == (attempt % 2)) |
276 | { | 277 | { |
277 | /* on even rounds, try UNIX */ | 278 | /* on even rounds, try UNIX */ |
278 | if (GNUNET_OK == | 279 | if (GNUNET_OK == |
@@ -314,6 +315,27 @@ do_connect (const char *service_name, | |||
314 | service_name); | 315 | service_name); |
315 | return NULL; | 316 | return NULL; |
316 | } | 317 | } |
318 | if (port == 0) | ||
319 | { | ||
320 | #if AF_UNIX | ||
321 | if (0 != (attempt % 2)) | ||
322 | { | ||
323 | /* try UNIX */ | ||
324 | if (GNUNET_OK == | ||
325 | GNUNET_CONFIGURATION_get_value_string (cfg, | ||
326 | service_name, | ||
327 | "UNIXPATH", &unixpath)) | ||
328 | { | ||
329 | sock = GNUNET_CONNECTION_create_from_connect_to_unixpath (cfg, | ||
330 | unixpath); | ||
331 | GNUNET_free (unixpath); | ||
332 | if (sock != NULL) | ||
333 | return sock; | ||
334 | } | ||
335 | } | ||
336 | #endif | ||
337 | return NULL; | ||
338 | } | ||
317 | sock = GNUNET_CONNECTION_create_from_connect (cfg, | 339 | sock = GNUNET_CONNECTION_create_from_connect (cfg, |
318 | hostname, | 340 | hostname, |
319 | port); | 341 | port); |