From: Matthias Wachs Date: Tue, 4 Sep 2012 09:58:15 +0000 (+0000) Subject: - fix X-Git-Tag: initial-import-from-subversion-38251~11956 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cf17dc692dbedbb72083b1a0d031144f1e7f1626;p=oweals%2Fgnunet.git - fix --- diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index e4ee9b696..064b95f43 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c @@ -1924,18 +1924,6 @@ server_start (struct HTTP_Server_Plugin *plugin) void server_stop (struct HTTP_Server_Plugin *plugin) { - if (plugin->server_v4_task != GNUNET_SCHEDULER_NO_TASK) - { - GNUNET_SCHEDULER_cancel (plugin->server_v4_task); - plugin->server_v4_task = GNUNET_SCHEDULER_NO_TASK; - } - - if (plugin->server_v6_task != GNUNET_SCHEDULER_NO_TASK) - { - GNUNET_SCHEDULER_cancel (plugin->server_v6_task); - plugin->server_v6_task = GNUNET_SCHEDULER_NO_TASK; - } - if (plugin->server_v4 != NULL) { MHD_stop_daemon (plugin->server_v4); @@ -1947,6 +1935,18 @@ server_stop (struct HTTP_Server_Plugin *plugin) plugin->server_v6 = NULL; } + + if (plugin->server_v4_task != GNUNET_SCHEDULER_NO_TASK) + { + GNUNET_SCHEDULER_cancel (plugin->server_v4_task); + plugin->server_v4_task = GNUNET_SCHEDULER_NO_TASK; + } + + if (plugin->server_v6_task != GNUNET_SCHEDULER_NO_TASK) + { + GNUNET_SCHEDULER_cancel (plugin->server_v6_task); + plugin->server_v6_task = GNUNET_SCHEDULER_NO_TASK; + } p = NULL; #if BUILD_HTTPS diff --git a/src/transport/test_plugin_transport.c b/src/transport/test_plugin_transport.c index dae1130df..5ebe4759f 100644 --- a/src/transport/test_plugin_transport.c +++ b/src/transport/test_plugin_transport.c @@ -287,6 +287,28 @@ env_receive (void *cls, return GNUNET_TIME_relative_get_zero_(); } +/** + * Take the given address and append it to the set of results sent back to + * the client. + * + * @param cls the transmission context used ('struct GNUNET_SERVER_TransmitContext*') + * @param buf text to transmit + */ +static void +address_pretty_printer_cb (void *cls, const char *buf) +{ + if (NULL != buf) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Pretty address : `%s'\n", buf); + } + else + { + GNUNET_break (0); + end_badly_now (); + } +} + static void env_notify_address (void *cls, @@ -312,6 +334,11 @@ env_notify_address (void *cls, memcpy (w->addr, addr, addrlen); GNUNET_CONTAINER_DLL_insert(head, tail, w); + api->address_pretty_printer (api->cls, plugin, addr, addrlen, + GNUNET_YES, GNUNET_TIME_UNIT_MINUTES, + &address_pretty_printer_cb, + w); + a2s = strdup (api->address_to_string (api, w->addr, w->addrlen)); if (NULL == a2s) {