aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/transport/plugin_transport_tcp.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c
index 89c64021e..65abf5fa4 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -404,6 +404,13 @@ struct Plugin
404}; 404};
405 405
406 406
407
408/**
409 * Handle for request of hostname resolution, non-NULL if pending.
410 */
411static struct GNUNET_RESOLVER_RequestHandle *hostname_dns;
412
413
407/** 414/**
408 * Find the session handle for the given peer. 415 * Find the session handle for the given peer.
409 */ 416 */
@@ -2093,11 +2100,11 @@ libgnunet_plugin_transport_tcp_init (void *cls)
2093 GNUNET_SERVER_disconnect_notify (plugin->server, &disconnect_notify, 2100 GNUNET_SERVER_disconnect_notify (plugin->server, &disconnect_notify,
2094 plugin); 2101 plugin);
2095 GNUNET_OS_network_interfaces_list (&process_interfaces, plugin); 2102 GNUNET_OS_network_interfaces_list (&process_interfaces, plugin);
2096 GNUNET_RESOLVER_hostname_resolve (env->sched, 2103 hostname_dns = GNUNET_RESOLVER_hostname_resolve (env->sched,
2097 env->cfg, 2104 env->cfg,
2098 AF_UNSPEC, 2105 AF_UNSPEC,
2099 HOSTNAME_RESOLVE_TIMEOUT, 2106 HOSTNAME_RESOLVE_TIMEOUT,
2100 &process_hostname_ips, plugin); 2107 &process_hostname_ips, plugin);
2101 return api; 2108 return api;
2102} 2109}
2103 2110
@@ -2114,6 +2121,11 @@ libgnunet_plugin_transport_tcp_done (void *cls)
2114 2121
2115 while (NULL != (session = plugin->sessions)) 2122 while (NULL != (session = plugin->sessions))
2116 disconnect_session (session); 2123 disconnect_session (session);
2124 if (NULL != hostname_dns)
2125 {
2126 GNUNET_RESOLVER_request_cancel (hostname_dns);
2127 hostname_dns = NULL;
2128 }
2117 GNUNET_SERVICE_stop (plugin->service); 2129 GNUNET_SERVICE_stop (plugin->service);
2118 GNUNET_free (plugin->handlers); 2130 GNUNET_free (plugin->handlers);
2119 GNUNET_free (plugin); 2131 GNUNET_free (plugin);