From 0e3810e405760a18df762ef74af335f8bfa261cc Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Mon, 3 May 2010 15:18:51 +0000 Subject: [PATCH] --- src/transport/Makefile.am | 1 + src/transport/plugin_transport_http.c | 17 +++++++++++++++-- .../test_plugin_transport_data_http.conf | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index c6f2bc2ff..a7dd645ee 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am @@ -123,6 +123,7 @@ libgnunet_plugin_transport_http_la_LIBADD = \ $(top_builddir)/src/hello/libgnunethello.la \ $(top_builddir)/src/statistics/libgnunetstatistics.la \ $(top_builddir)/src/peerinfo/libgnunetpeerinfo.la \ + @LIBCURL@ \ $(top_builddir)/src/util/libgnunetutil.la libgnunet_plugin_transport_http_la_LDFLAGS = \ $(GN_LIBMHD) \ diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index 7ede6da3c..52a6ff0dc 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c @@ -33,6 +33,7 @@ #include "gnunet_transport_service.h" #include "plugin_transport.h" #include "microhttpd.h" +#include #define VERBOSE GNUNET_YES #define DEBUG GNUNET_YES @@ -137,6 +138,11 @@ struct Plugin */ static struct MHD_Daemon *http_daemon; +/** + * Curl multi for managing client operations. + */ +static CURLM *curl_multi; + /** * Function that can be used by the transport service to transmit * a message using the plugin. @@ -377,11 +383,14 @@ libgnunet_plugin_transport_http_init (void *cls) MHD_OPTION_END); } } - if ( NULL != http_daemon ) + + curl_multi = curl_multi_init (); + + if ( (NULL != http_daemon) && (NULL != curl_multi)) return api; else { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR,"Starting MHD on port %u with IPv6 disabled\n",port); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR,"Initializing http plugin failed\n"); return NULL; } } @@ -401,6 +410,10 @@ libgnunet_plugin_transport_http_done (void *cls) MHD_stop_daemon (http_daemon); http_daemon = NULL; } + + curl_multi_cleanup (curl_multi); + curl_multi = NULL; + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Shutting down http plugin...\n"); GNUNET_free (plugin); diff --git a/src/transport/test_plugin_transport_data_http.conf b/src/transport/test_plugin_transport_data_http.conf index 77f4bdbbb..c4139380c 100644 --- a/src/transport/test_plugin_transport_data_http.conf +++ b/src/transport/test_plugin_transport_data_http.conf @@ -5,4 +5,4 @@ SERVICEHOME = /tmp/test-gnunetd-transport-peer-1/ [transport-http] PORT = 12389 DEBUG = YES -USE_IPV6 = NO \ No newline at end of file +USE_IPV6 = YES \ No newline at end of file -- 2.25.1