aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/transport/plugin_transport_unix.c32
-rw-r--r--src/transport/transport.conf.in2
2 files changed, 12 insertions, 22 deletions
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c
index 9fc4ba735..56e1de426 100644
--- a/src/transport/plugin_transport_unix.c
+++ b/src/transport/plugin_transport_unix.c
@@ -50,13 +50,6 @@
50 */ 50 */
51#define HOSTNAME_RESOLVE_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5) 51#define HOSTNAME_RESOLVE_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
52 52
53/**
54 * Default "port" to use, if configuration does not specify.
55 * Essentially just a number appended to the UNIX path.
56 */
57#define UNIX_NAT_DEFAULT_PORT 22086
58
59
60#define LOG(kind,...) GNUNET_log_from (kind, "transport-unix",__VA_ARGS__) 53#define LOG(kind,...) GNUNET_log_from (kind, "transport-unix",__VA_ARGS__)
61 54
62 55
@@ -316,11 +309,6 @@ struct Plugin
316 */ 309 */
317 int with_ws; 310 int with_ws;
318 311
319 /**
320 * Integer to append to unix domain socket.
321 */
322 uint16_t port;
323
324}; 312};
325 313
326 314
@@ -1572,7 +1560,6 @@ void *
1572libgnunet_plugin_transport_unix_init (void *cls) 1560libgnunet_plugin_transport_unix_init (void *cls)
1573{ 1561{
1574 struct GNUNET_TRANSPORT_PluginEnvironment *env = cls; 1562 struct GNUNET_TRANSPORT_PluginEnvironment *env = cls;
1575 unsigned long long port;
1576 struct GNUNET_TRANSPORT_PluginFunctions *api; 1563 struct GNUNET_TRANSPORT_PluginFunctions *api;
1577 struct Plugin *plugin; 1564 struct Plugin *plugin;
1578 int sockets_created; 1565 int sockets_created;
@@ -1588,16 +1575,19 @@ libgnunet_plugin_transport_unix_init (void *cls)
1588 api->string_to_address = &unix_string_to_address; 1575 api->string_to_address = &unix_string_to_address;
1589 return api; 1576 return api;
1590 } 1577 }
1591 if (GNUNET_OK != 1578
1592 GNUNET_CONFIGURATION_get_value_number (env->cfg, "transport-unix", "PORT",
1593 &port))
1594 port = UNIX_NAT_DEFAULT_PORT;
1595 plugin = GNUNET_new (struct Plugin); 1579 plugin = GNUNET_new (struct Plugin);
1596 plugin->port = port; 1580 if (GNUNET_OK !=
1581 GNUNET_CONFIGURATION_get_value_filename(env->cfg, "transport-unix", "UNIXPATH",
1582 &plugin->unix_socket_path))
1583 {
1584 LOG (GNUNET_ERROR_TYPE_ERROR,
1585 _("No UNIXPATH given in configuration!\n"));
1586 GNUNET_free (plugin);
1587 return NULL;
1588 }
1589
1597 plugin->env = env; 1590 plugin->env = env;
1598 GNUNET_asprintf (&plugin->unix_socket_path,
1599 "/tmp/unix-plugin-sock.%d",
1600 plugin->port);
1601 1591
1602 /* Initialize my flags */ 1592 /* Initialize my flags */
1603 myoptions = 0; 1593 myoptions = 0;
diff --git a/src/transport/transport.conf.in b/src/transport/transport.conf.in
index 575f4dc20..00807c701 100644
--- a/src/transport/transport.conf.in
+++ b/src/transport/transport.conf.in
@@ -32,7 +32,7 @@ UNIX_MATCH_GID = YES
32 32
33 33
34[transport-unix] 34[transport-unix]
35PORT = 22086 35UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-transport-plugin-unix.sock
36TESTING_IGNORE_KEYS = ACCEPT_FROM; 36TESTING_IGNORE_KEYS = ACCEPT_FROM;
37 37
38[transport-tcp] 38[transport-tcp]