gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r9323 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r9323 - gnunet/src/transport
Date: Tue, 27 Oct 2009 16:27:40 -0600

Author: grothoff
Date: 2009-10-27 16:27:40 -0600 (Tue, 27 Oct 2009)
New Revision: 9323

Modified:
   gnunet/src/transport/plugin_transport_tcp.c
Log:
making use of resolver cancellation to avoid callback into unloaded plugin

Modified: gnunet/src/transport/plugin_transport_tcp.c
===================================================================
--- gnunet/src/transport/plugin_transport_tcp.c 2009-10-27 22:27:11 UTC (rev 
9322)
+++ gnunet/src/transport/plugin_transport_tcp.c 2009-10-27 22:27:40 UTC (rev 
9323)
@@ -404,7 +404,14 @@
 };
 
 
+
 /**
+ * Handle for request of hostname resolution, non-NULL if pending.
+ */
+static struct GNUNET_RESOLVER_RequestHandle *hostname_dns;
+
+
+/**
  * Find the session handle for the given peer.
  */
 static struct Session *
@@ -2093,11 +2100,11 @@
   GNUNET_SERVER_disconnect_notify (plugin->server, &disconnect_notify,
                                    plugin);
   GNUNET_OS_network_interfaces_list (&process_interfaces, plugin);
-  GNUNET_RESOLVER_hostname_resolve (env->sched,
-                                    env->cfg,
-                                    AF_UNSPEC,
-                                    HOSTNAME_RESOLVE_TIMEOUT,
-                                    &process_hostname_ips, plugin);
+  hostname_dns = GNUNET_RESOLVER_hostname_resolve (env->sched,
+                                                  env->cfg,
+                                                  AF_UNSPEC,
+                                                  HOSTNAME_RESOLVE_TIMEOUT,
+                                                  &process_hostname_ips, 
plugin);
   return api;
 }
 
@@ -2114,6 +2121,11 @@
 
   while (NULL != (session = plugin->sessions))
     disconnect_session (session);    
+  if (NULL != hostname_dns)
+    {
+      GNUNET_RESOLVER_request_cancel (hostname_dns);
+      hostname_dns = NULL;
+    }
   GNUNET_SERVICE_stop (plugin->service);
   GNUNET_free (plugin->handlers);
   GNUNET_free (plugin);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]