+ GNUNET_free (ip);
+ }
+ else
+ sa = NULL;
+
+ daemon_handle_v6 = MHD_start_daemon (MHD_USE_IPv6 | MHD_USE_DEBUG,
+ (uint16_t) port,
+ &accept_policy_callback, NULL,
+ &access_handler_callback, NULL,
+ MHD_OPTION_CONNECTION_LIMIT,
+ (unsigned int) 16,
+ MHD_OPTION_PER_IP_CONNECTION_LIMIT,
+ (unsigned int) 1,
+ MHD_OPTION_CONNECTION_TIMEOUT,
+ (unsigned int) 16,
+ MHD_OPTION_CONNECTION_MEMORY_LIMIT,
+ (size_t) (16 * 1024),
+ MHD_OPTION_SOCK_ADDR,
+ sa,
+ MHD_OPTION_END);
+ daemon_handle_v4 = MHD_start_daemon (MHD_NO_FLAG | MHD_USE_DEBUG,
+ (uint16_t) port,
+ &accept_policy_callback, NULL,
+ &access_handler_callback, NULL,
+ MHD_OPTION_CONNECTION_LIMIT,
+ (unsigned int) 16,
+ MHD_OPTION_PER_IP_CONNECTION_LIMIT,
+ (unsigned int) 1,
+ MHD_OPTION_CONNECTION_TIMEOUT,
+ (unsigned int) 16,
+ MHD_OPTION_CONNECTION_MEMORY_LIMIT,
+ (size_t) (16 * 1024),
+ MHD_OPTION_SOCK_ADDR,
+ sa,
+ MHD_OPTION_END);
+
+ if ((NULL == daemon_handle_v6) && (NULL == daemon_handle_v4))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Could not start hostlist HTTP server on port %u\n"),
+ (unsigned short) port);
+ return GNUNET_SYSERR;
+ }