From: Matthias Wachs Date: Tue, 13 Jul 2010 12:26:46 +0000 (+0000) Subject: (no commit message) X-Git-Tag: initial-import-from-subversion-38251~20958 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ff5c11ff35fee9da496d06e44f238126f70f5f88;p=oweals%2Fgnunet.git --- diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index 2d897f622..0eba52a6d 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am @@ -143,6 +143,7 @@ TESTS = \ test_transport_api_udp \ test_transport_api_udp_nat \ test_plugin_transport_http \ + test_transport_api_http \ test_transport_api_reliability_tcp \ test_transport_api_reliability_tcp_nat diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index 44914f2f3..9abf0cf37 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c @@ -40,8 +40,8 @@ #include -#define DEBUG_CURL GNUNET_YES -#define DEBUG_HTTP GNUNET_YES +#define DEBUG_CURL GNUNET_NO +#define DEBUG_HTTP GNUNET_NO #define DEBUG_CONNECTIONS GNUNET_YES #define INBOUND GNUNET_NO @@ -1730,6 +1730,8 @@ http_plugin_disconnect (void *cls, struct Session *ps = NULL; //struct Session *tmp = NULL; + return; + pc = GNUNET_CONTAINER_multihashmap_get (plugin->peers, &target->hashPubKey); if (pc==NULL) return; @@ -2010,11 +2012,13 @@ process_interfaces (void *cls, t6->u6_port = htons (plugin->port_inbound); plugin->env->notify_address(plugin->env->cls,"http",t6,sizeof (struct IPv6HttpAddress) , GNUNET_TIME_UNIT_FOREVER_REL); } - return GNUNET_OK; + return GNUNET_NO; + /* FIXME: return GNUNET_OK; */ } int remove_peer_context_Iterator (void *cls, const GNUNET_HashCode *key, void *value) { + struct Plugin *plugin = cls; struct HTTP_PeerContext * pc = value; struct Session * ps = pc->head; struct Session * tmp = NULL; @@ -2025,7 +2029,8 @@ int remove_peer_context_Iterator (void *cls, const GNUNET_HashCode *key, void *v while (ps!=NULL) { - tmp = ps->next; + plugin->env->session_end(plugin, &pc->identity, ps); + tmp = ps->next; GNUNET_free_non_null (ps->addr); GNUNET_free(ps->url); @@ -2064,22 +2069,8 @@ libgnunet_plugin_transport_http_done (void *cls) struct GNUNET_TRANSPORT_PluginFunctions *api = cls; struct Plugin *plugin = api->cls; CURLMcode mret; - GNUNET_assert(cls !=NULL); - if (plugin->http_server_daemon_v4 != NULL) - { - MHD_stop_daemon (plugin->http_server_daemon_v4); - plugin->http_server_daemon_v4 = NULL; - } - if (plugin->http_server_daemon_v6 != NULL) - { - MHD_stop_daemon (plugin->http_server_daemon_v6); - plugin->http_server_daemon_v6 = NULL; - } - - - if ( plugin->http_server_task_v4 != GNUNET_SCHEDULER_NO_TASK) { GNUNET_SCHEDULER_cancel(plugin->env->sched, plugin->http_server_task_v4); @@ -2092,6 +2083,18 @@ libgnunet_plugin_transport_http_done (void *cls) plugin->http_server_task_v6 = GNUNET_SCHEDULER_NO_TASK; } + + if (plugin->http_server_daemon_v4 != NULL) + { + MHD_stop_daemon (plugin->http_server_daemon_v4); + plugin->http_server_daemon_v4 = NULL; + } + if (plugin->http_server_daemon_v6 != NULL) + { + MHD_stop_daemon (plugin->http_server_daemon_v6); + plugin->http_server_daemon_v6 = NULL; + } + if ( plugin->http_curl_task != GNUNET_SCHEDULER_NO_TASK) { GNUNET_SCHEDULER_cancel(plugin->env->sched, plugin->http_curl_task); @@ -2103,7 +2106,7 @@ libgnunet_plugin_transport_http_done (void *cls) { GNUNET_CONTAINER_multihashmap_iterate (plugin->peers, &remove_peer_context_Iterator, - NULL); + plugin); GNUNET_CONTAINER_multihashmap_destroy (plugin->peers); } if (plugin->multi_handle!=NULL) @@ -2223,6 +2226,7 @@ libgnunet_plugin_transport_http_init (void *cls) /* Initializing cURL */ curl_global_init(CURL_GLOBAL_ALL); plugin->multi_handle = curl_multi_init(); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"curl version is: `%s'\n", curl_version()); if ( NULL == plugin->multi_handle ) { diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c index 8a1129bbd..fe9461452 100644 --- a/src/transport/test_transport_api.c +++ b/src/transport/test_transport_api.c @@ -36,7 +36,7 @@ #include "gnunet_transport_service.h" #include "transport.h" -#define VERBOSE GNUNET_NO +#define VERBOSE GNUNET_YES #define VERBOSE_ARM GNUNET_NO