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)
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,
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,
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
*/
env.receive = &receive;
env.notify_address = ¬ify_address;
env.max_connections = max_connect_per_transport;
+ env.session_end = &plugin_env_session_end;
}
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*/