transport service hello reduction, klocwork fixes
[oweals/gnunet.git] / src / transport / plugin_transport_http.c
index 9169af5d123b4e9aa09ebb2556f44e086e844806..952078865020fc62d8e5248513d8702753894763 100644 (file)
@@ -42,6 +42,7 @@
 
 #define DEBUG_HTTP GNUNET_NO
 #define DEBUG_CURL GNUNET_NO
+#define DEBUG_MHD GNUNET_YES
 #define DEBUG_CONNECTIONS GNUNET_NO
 #define DEBUG_SESSION_SELECTION GNUNET_NO
 
@@ -418,13 +419,13 @@ static char * create_url(void * cls, const void * addr, size_t addrlen, size_t i
 {
   struct Plugin *plugin = cls;
   char *url = NULL;
+  char *addr_str = (char *) http_plugin_address_to_string(NULL, addr, addrlen);
 
   GNUNET_assert ((addr!=NULL) && (addrlen != 0));
   GNUNET_asprintf(&url,
-                  "%s://%s/%s;%u", PROTOCOL_PREFIX,
-                  http_plugin_address_to_string(NULL, addr, addrlen),
+                  "%s://%s/%s;%u", PROTOCOL_PREFIX, addr_str,
                   (char *) (&plugin->my_ascii_hash_ident),id);
-
+  GNUNET_free_non_null(addr_str);
   return url;
 }
 
@@ -2454,7 +2455,7 @@ libgnunet_plugin_transport_http_init (void *cls)
   {
        struct sockaddr * tmp = (struct sockaddr *) plugin->bind6_address;
     plugin->http_server_daemon_v6 = MHD_start_daemon (
-#if DEBUG_CONNECTIONS
+#if DEBUG_MHD
                                                                   MHD_USE_DEBUG |
 #endif
                                                                   MHD_USE_IPv6,
@@ -2473,7 +2474,7 @@ libgnunet_plugin_transport_http_init (void *cls)
   if ((plugin->http_server_daemon_v4 == NULL) && (plugin->use_ipv4 == GNUNET_YES) && (port != 0))
   {
   plugin->http_server_daemon_v4 = MHD_start_daemon (
-#if DEBUG_CONNECTIONS
+#if DEBUG_MHD
                                                                   MHD_USE_DEBUG |
 #endif
                                                                   MHD_NO_FLAG,