From 846811d2607485498262a61865a088625a06e874 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Tue, 13 Jul 2010 08:31:53 +0000 Subject: --- src/transport/plugin_transport_http.c | 15 ++++++++++++--- src/transport/test_plugin_transport_http.c | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index f2bdc90dc..88a147013 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c @@ -1722,7 +1722,8 @@ http_plugin_disconnect (void *cls, while (ps!=NULL) { - + /* Telling transport that session is getting disconnected */ + plugin->env->session_end(plugin, target, ps); if (ps->direction==OUTBOUND) { if (ps->send_endpoint!=NULL) @@ -2152,7 +2153,11 @@ libgnunet_plugin_transport_http_init (void *cls) unsigned int timeout = (gn_timeout.value) / 1000; if ((plugin->http_server_daemon_v4 == NULL) && (plugin->http_server_daemon_v6 == NULL) && (port != 0)) { - plugin->http_server_daemon_v6 = MHD_start_daemon (MHD_USE_IPv6 | MHD_USE_DEBUG, + plugin->http_server_daemon_v6 = MHD_start_daemon ( +#if DEBUG_HTTP + MHD_USE_DEBUG | +#endif + MHD_USE_IPv6, port, &mhd_accept_cb, plugin , &mdh_access_cb, plugin, @@ -2162,7 +2167,11 @@ libgnunet_plugin_transport_http_init (void *cls) MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (16 * 1024), MHD_OPTION_NOTIFY_COMPLETED, &mhd_termination_cb, NULL, MHD_OPTION_END); - plugin->http_server_daemon_v4 = MHD_start_daemon (MHD_NO_FLAG | MHD_USE_DEBUG, + plugin->http_server_daemon_v4 = MHD_start_daemon ( +#if DEBUG_HTTP + MHD_USE_DEBUG | +#endif + MHD_NO_FLAG, port, &mhd_accept_cb, plugin , &mdh_access_cb, plugin, diff --git a/src/transport/test_plugin_transport_http.c b/src/transport/test_plugin_transport_http.c index 2970cfbf1..4f88ede27 100644 --- a/src/transport/test_plugin_transport_http.c +++ b/src/transport/test_plugin_transport_http.c @@ -881,6 +881,15 @@ notify_address (void *cls, fail_notify_address = GNUNET_NO; } +static void +plugin_env_session_end (void *cls, + const struct GNUNET_PeerIdentity *peer, + struct Session *session) +{ + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Session ended: `%s' %X\n", GNUNET_i2s(peer), session); +} + + /** * Setup plugin environment */ @@ -895,6 +904,7 @@ setup_plugin_environment () env.receive = &receive; env.notify_address = ¬ify_address; env.max_connections = max_connect_per_transport; + env.session_end = &plugin_env_session_end; } @@ -1071,8 +1081,8 @@ static void run_connection_tests( int phase , void * cls) GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("\nPhase 3: send multiple or big messages after disconnect\n\n")); /* disconnect from peer, so new connections are created */ - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Disconnect from peer: `%s'\n", GNUNET_i2s(&my_identity)); - api->disconnect(api->cls, &my_identity); + //GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Disconnect from peer: `%s'\n", GNUNET_i2s(&my_identity)); + //api->disconnect(api->cls, &my_identity); /* send a multiple GNUNET_messages at a time*/ -- cgit v1.2.3