fix only cache variable long/short
[oweals/gnunet.git] / src / gns / gnunet-bcd.c
index 05eaecff400c245ad91a71b6899b246ef3144c46..4e018c12d6232170f76f486e5debcb87f9ee771b 100644 (file)
@@ -215,7 +215,7 @@ access_handler_callback (void *cls, struct MHD_Connection *connection,
       GNUNET_free (gpg1);
     }
     FPRINTF (f,
-             "\\def\\gns{gnunet://gns/%s/%s}\n",
+             "\\def\\gns{%s/%s}\n",
              gnskey,
              (NULL == gns_nick) ? "" : gns_nick);
     FCLOSE (f);
@@ -249,6 +249,10 @@ access_handler_callback (void *cls, struct MHD_Connection *connection,
     {
       GNUNET_break (0);
       GNUNET_break (0 == CLOSE (fd));
+      GNUNET_free (deffile);
+      GNUNET_free (p);
+      GNUNET_DISK_directory_remove (tmp);
+      GNUNET_free (tmp);
       return MHD_NO;
     }
     (void) MHD_add_response_header (response,
@@ -258,6 +262,7 @@ access_handler_callback (void *cls, struct MHD_Connection *connection,
                               MHD_HTTP_OK,
                               response);
     MHD_destroy_response (response);
+    GNUNET_free (deffile);
     GNUNET_free (p);
     GNUNET_DISK_directory_remove (tmp);
     GNUNET_free (tmp);
@@ -321,7 +326,7 @@ prepare_daemon (struct MHD_Daemon *daemon_handle)
   GNUNET_assert (MHD_YES == MHD_get_fdset (daemon_handle, &rs, &ws, &es, &max));
   haveto = MHD_get_timeout (daemon_handle, &timeout);
   if (haveto == MHD_YES)
-    tv.rel_value_us = (uint64_t) timeout;
+    tv.rel_value_us = (uint64_t) timeout * 1000LL;
   else
     tv = GNUNET_TIME_UNIT_FOREVER_REL;
   GNUNET_NETWORK_fdset_copy_native (wrs, &rs, max + 1);
@@ -360,7 +365,7 @@ server_start ()
                                     &access_handler_callback, NULL,
                                     MHD_OPTION_CONNECTION_LIMIT, (unsigned int) 512,
                                     MHD_OPTION_PER_IP_CONNECTION_LIMIT, (unsigned int) 2,
-                                    MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 16,
+                                    MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 60,
                                     MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (16 * 1024),
                                     MHD_OPTION_END);
   if (NULL == daemon_handle)