timeout);
#endif
- plugin->server_v6 = NULL;
- if (plugin->use_ipv6 == GNUNET_YES)
+ plugin->server_v4 = NULL;
+ if (plugin->use_ipv4 == GNUNET_YES)
{
- plugin->server_v6 = MHD_start_daemon (
+ plugin->server_v4 = MHD_start_daemon (
#if VERBOSE_SERVER
MHD_USE_DEBUG |
#endif
#if BUILD_HTTPS
MHD_USE_SSL |
#endif
- MHD_USE_IPv6, plugin->port,
+ MHD_NO_FLAG, plugin->port,
&server_accept_cb, plugin,
&server_access_cb, plugin,
MHD_OPTION_SOCK_ADDR,
- (struct sockaddr_in6 *)
- plugin->server_addr_v6,
+ (struct sockaddr_in *)
+ plugin->server_addr_v4,
MHD_OPTION_CONNECTION_LIMIT,
(unsigned int)
plugin->max_connections,
&server_disconnect_cb, plugin,
MHD_OPTION_EXTERNAL_LOGGER,
server_log, NULL, MHD_OPTION_END);
- if (plugin->server_v6 == NULL)
+ if (plugin->server_v4 == NULL)
{
GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, plugin->name,
- "Failed to start %s IPv6 server component on port %u\n",
+ "Failed to start %s IPv4 server component on port %u\n",
plugin->name, plugin->port);
}
else
- server_reschedule (plugin, plugin->server_v6, GNUNET_NO);
+ server_reschedule (plugin, plugin->server_v4, GNUNET_NO);
}
- plugin->server_v4 = NULL;
- if (plugin->use_ipv4 == GNUNET_YES)
+
+ plugin->server_v6 = NULL;
+ if (plugin->use_ipv6 == GNUNET_YES)
{
- plugin->server_v4 = MHD_start_daemon (
+ plugin->server_v6 = MHD_start_daemon (
#if VERBOSE_SERVER
MHD_USE_DEBUG |
#endif
#if BUILD_HTTPS
MHD_USE_SSL |
#endif
- MHD_NO_FLAG, plugin->port,
+ MHD_USE_IPv6, plugin->port,
&server_accept_cb, plugin,
&server_access_cb, plugin,
MHD_OPTION_SOCK_ADDR,
- (struct sockaddr_in *)
- plugin->server_addr_v4,
+ (struct sockaddr_in6 *)
+ plugin->server_addr_v6,
MHD_OPTION_CONNECTION_LIMIT,
(unsigned int)
plugin->max_connections,
&server_disconnect_cb, plugin,
MHD_OPTION_EXTERNAL_LOGGER,
server_log, NULL, MHD_OPTION_END);
- if (plugin->server_v4 == NULL)
+ if (plugin->server_v6 == NULL)
{
GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, plugin->name,
- "Failed to start %s IPv4 server component on port %u\n",
+ "Failed to start %s IPv6 server component on port %u\n",
plugin->name, plugin->port);
}
else
- server_reschedule (plugin, plugin->server_v4, GNUNET_NO);
+ server_reschedule (plugin, plugin->server_v6, GNUNET_NO);
}
msg = "No";
- if ((plugin->server_v6 == NULL) && (plugin->server_v6 == NULL))
+ if ((plugin->server_v6 == NULL) && (plugin->server_v4 == NULL))
{
GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, plugin->name,
"%s %s server component started on port %u\n",
msg, plugin->name, plugin->port);
+ sleep (10);
return GNUNET_SYSERR;
}
- else if ((plugin->server_v6 != NULL) && (plugin->server_v6 != NULL))
+ else if ((plugin->server_v6 != NULL) && (plugin->server_v4 != NULL))
msg = "IPv4 and IPv6";
else if (plugin->server_v6 != NULL)
msg = "IPv6";
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
"%s %s server component started on port %u\n",
msg, plugin->name, plugin->port);
-
return GNUNET_OK;
}