-unregister nat on error, indentation, DCE
authorChristian Grothoff <christian@grothoff.org>
Mon, 25 Jul 2016 21:35:36 +0000 (21:35 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 25 Jul 2016 21:35:36 +0000 (21:35 +0000)
src/transport/plugin_transport_tcp.c
src/transport/plugin_transport_udp.c

index 2a8ca2eb91593f9c23acf2ce9f4d9e7149b4361f..02c0afaad3e5781d3d8cb61607466cddd98495b4 100644 (file)
@@ -462,11 +462,6 @@ struct Plugin
    */
   struct TCPProbeContext *probe_tail;
 
-  /**
-   * Handle for (DYN)DNS lookup of our external IP.
-   */
-  struct GNUNET_RESOLVER_RequestHandle *ext_dns;
-
   /**
    * Function to call about session status changes.
    */
@@ -2002,7 +1997,8 @@ tcp_plugin_address_pretty_printer (void *cls,
                                                        sbs,
                                                        ! numeric,
                                                        timeout,
-                                                       &append_port, ppc);
+                                                       &append_port,
+                                                      ppc);
   if (NULL == ppc->resolver_handle)
   {
     GNUNET_break (0);
@@ -3011,10 +3007,12 @@ libgnunet_plugin_transport_tcp_init (void *cls)
                              GNUNET_YES,
                              aport,
                              (unsigned int) ret_s,
-                             (const struct sockaddr **) addrs, addrlens,
+                             (const struct sockaddr **) addrs,
+                            addrlens,
                              &tcp_nat_port_map_callback,
                              &try_connection_reversal,
-                             plugin, NULL);
+                             plugin,
+                            NULL);
     for (ret = ret_s -1; ret >= 0; ret--)
       GNUNET_free (addrs[ret]);
     GNUNET_free_non_null (addrs);
@@ -3075,7 +3073,9 @@ libgnunet_plugin_transport_tcp_init (void *cls)
                                           GNUNET_YES);
   }
   plugin->handlers = GNUNET_malloc (sizeof (my_handlers));
-  GNUNET_memcpy (plugin->handlers, my_handlers, sizeof(my_handlers));
+  GNUNET_memcpy (plugin->handlers,
+                my_handlers,
+                sizeof(my_handlers));
   for (i = 0;i < sizeof(my_handlers) / sizeof(struct GNUNET_SERVER_MessageHandler);i++)
     plugin->handlers[i].callback_cls = plugin;
 
index 7b9a78eb4cc897ed570c133333d97faa9c121b94..35ae92460e7cf6ae8594608b94bcdb6b9aaea8d1 100644 (file)
@@ -3997,6 +3997,8 @@ libgnunet_plugin_transport_udp_init (void *cls)
     GNUNET_CONTAINER_multipeermap_destroy (p->sessions);
     GNUNET_CONTAINER_heap_destroy (p->defrag_ctxs);
     GNUNET_SERVER_mst_destroy (p->mst);
+    if (NULL != p->nat)
+      GNUNET_NAT_unregister (p->nat);
     GNUNET_free (p);
     return NULL;
   }