(no commit message)
authorMatthias Wachs <wachs@net.in.tum.de>
Tue, 13 Jul 2010 08:31:53 +0000 (08:31 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Tue, 13 Jul 2010 08:31:53 +0000 (08:31 +0000)
src/transport/plugin_transport_http.c
src/transport/test_plugin_transport_http.c

index f2bdc90dc5647400acfdb70fdc805eec02b2bb37..88a14701318d2faca7e99e9a83c11bf9caf2506f 100644 (file)
@@ -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,
index 2970cfbf19abf2816d4613c12de7baac401d5b58..4f88ede27426d26951860cf2c130b069e668d708 100644 (file)
@@ -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 = &notify_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*/