gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r31329 - gnunet/src/transport
Date: Thu, 12 Dec 2013 19:29:57 +0100

Author: grothoff
Date: 2013-12-12 19:29:57 +0100 (Thu, 12 Dec 2013)
New Revision: 31329

Modified:
   gnunet/src/transport/plugin_transport_http_server.c
Log:
-fix leak, style

Modified: gnunet/src/transport/plugin_transport_http_server.c
===================================================================
--- gnunet/src/transport/plugin_transport_http_server.c 2013-12-12 18:28:05 UTC 
(rev 31328)
+++ gnunet/src/transport/plugin_transport_http_server.c 2013-12-12 18:29:57 UTC 
(rev 31329)
@@ -3037,16 +3037,17 @@
   return NULL;
 }
 
-const char *http_plugin_address_to_string (void *cls,
-                                           const void *addr,
-                                           size_t addrlen)
+
+static const char *
+http_plugin_address_to_string (void *cls,
+                               const void *addr,
+                               size_t addrlen)
 {
 #if BUILD_HTTPS
-       return http_common_plugin_address_to_string (cls, PLUGIN_NAME, addr, 
addrlen);
+  return http_common_plugin_address_to_string (cls, PLUGIN_NAME, addr, 
addrlen);
 #else
-       return http_common_plugin_address_to_string (cls, PLUGIN_NAME, addr, 
addrlen);
+  return http_common_plugin_address_to_string (cls, PLUGIN_NAME, addr, 
addrlen);
 #endif
-
 }
 
 
@@ -3079,9 +3080,6 @@
   struct GNUNET_TRANSPORT_PluginFunctions *api;
   struct HTTP_Server_Plugin *plugin;
 
-  plugin = GNUNET_new (struct HTTP_Server_Plugin);
-  plugin->env = env;
-
   if (NULL == env->receive)
   {
     /* run in 'stub' mode (i.e. as part of gnunet-peerinfo), don't fully
@@ -3093,7 +3091,8 @@
     api->address_pretty_printer = &http_common_plugin_address_pretty_printer;
     return api;
   }
-
+  plugin = GNUNET_new (struct HTTP_Server_Plugin);
+  plugin->env = env;
   api = GNUNET_new (struct GNUNET_TRANSPORT_PluginFunctions);
   api->cls = plugin;
   api->send = &http_server_plugin_send;
@@ -3118,8 +3117,8 @@
   /* Configure plugin */
   if (GNUNET_SYSERR == server_configure_plugin (plugin))
   {
-      LIBGNUNET_PLUGIN_TRANSPORT_DONE (api);
-      return NULL;
+    LIBGNUNET_PLUGIN_TRANSPORT_DONE (api);
+    return NULL;
   }
 
   /* Check IPv6 support */
@@ -3132,8 +3131,8 @@
 
   if (GNUNET_SYSERR == server_start (plugin))
   {
-      LIBGNUNET_PLUGIN_TRANSPORT_DONE (api);
-      return NULL;
+    LIBGNUNET_PLUGIN_TRANSPORT_DONE (api);
+    return NULL;
   }
   return api;
 }




reply via email to

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