summaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http_server.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-12-23 22:15:22 +0000
committerChristian Grothoff <christian@grothoff.org>2014-12-23 22:15:22 +0000
commit5a3d846bc0c48e48b71189d89975eaefa8c21a90 (patch)
treeb16883d9aef92e43b56d61d92c951989c6c36ab2 /src/transport/plugin_transport_http_server.c
parent1aad2ce1a9604aa631d92fc7aebcd0def34736cc (diff)
-fix call to MHD_start_daemon, properly pass MHD_USE_IPv6 if needed
Diffstat (limited to 'src/transport/plugin_transport_http_server.c')
-rw-r--r--src/transport/plugin_transport_http_server.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 00ee26d30..31bd7ba4f 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -2199,11 +2199,13 @@ server_load_certificate (struct HTTP_Server_Plugin *plugin)
*
* @param plugin our plugin
* @param addr listen address to use
+ * @param v6 MHD_NO_FLAG or MHD_USE_IPv6, depending on context
* @return NULL on error
*/
static struct MHD_Daemon *
run_mhd_start_daemon (struct HTTP_Server_Plugin *plugin,
- const struct sockaddr_in *addr)
+ const struct sockaddr_in *addr,
+ int v6)
{
struct MHD_Daemon *server;
unsigned int timeout;
@@ -2226,7 +2228,8 @@ run_mhd_start_daemon (struct HTTP_Server_Plugin *plugin,
#if BUILD_HTTPS
MHD_USE_SSL |
#endif
- MHD_USE_SUSPEND_RESUME,
+ MHD_USE_SUSPEND_RESUME |
+ v6,
plugin->port,
&server_accept_cb, plugin,
&server_access_cb, plugin,
@@ -2306,7 +2309,8 @@ server_start (struct HTTP_Server_Plugin *plugin)
{
plugin->server_v4
= run_mhd_start_daemon (plugin,
- (const struct sockaddr_in *) plugin->server_addr_v4);
+ (const struct sockaddr_in *) plugin->server_addr_v4,
+ MHD_NO_FLAG);
if (NULL == plugin->server_v4)
{
@@ -2327,7 +2331,8 @@ server_start (struct HTTP_Server_Plugin *plugin)
{
plugin->server_v6
= run_mhd_start_daemon (plugin,
- (const struct sockaddr_in *) plugin->server_addr_v6);
+ (const struct sockaddr_in *) plugin->server_addr_v6,
+ MHD_USE_IPv6);
if (NULL == plugin->server_v6)
{
LOG (GNUNET_ERROR_TYPE_ERROR,