aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2010-07-13 08:31:53 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2010-07-13 08:31:53 +0000
commit846811d2607485498262a61865a088625a06e874 (patch)
treeab419e01be1f07cd42fb25001cfb61e07a4131cd
parent5bf28a25b59ba49caa645c04368b72e075ae9c31 (diff)
downloadgnunet-846811d2607485498262a61865a088625a06e874.tar.gz
gnunet-846811d2607485498262a61865a088625a06e874.zip
-rw-r--r--src/transport/plugin_transport_http.c15
-rw-r--r--src/transport/test_plugin_transport_http.c14
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,
1722 1722
1723 while (ps!=NULL) 1723 while (ps!=NULL)
1724 { 1724 {
1725 1725 /* Telling transport that session is getting disconnected */
1726 plugin->env->session_end(plugin, target, ps);
1726 if (ps->direction==OUTBOUND) 1727 if (ps->direction==OUTBOUND)
1727 { 1728 {
1728 if (ps->send_endpoint!=NULL) 1729 if (ps->send_endpoint!=NULL)
@@ -2152,7 +2153,11 @@ libgnunet_plugin_transport_http_init (void *cls)
2152 unsigned int timeout = (gn_timeout.value) / 1000; 2153 unsigned int timeout = (gn_timeout.value) / 1000;
2153 if ((plugin->http_server_daemon_v4 == NULL) && (plugin->http_server_daemon_v6 == NULL) && (port != 0)) 2154 if ((plugin->http_server_daemon_v4 == NULL) && (plugin->http_server_daemon_v6 == NULL) && (port != 0))
2154 { 2155 {
2155 plugin->http_server_daemon_v6 = MHD_start_daemon (MHD_USE_IPv6 | MHD_USE_DEBUG, 2156 plugin->http_server_daemon_v6 = MHD_start_daemon (
2157#if DEBUG_HTTP
2158 MHD_USE_DEBUG |
2159#endif
2160 MHD_USE_IPv6,
2156 port, 2161 port,
2157 &mhd_accept_cb, 2162 &mhd_accept_cb,
2158 plugin , &mdh_access_cb, plugin, 2163 plugin , &mdh_access_cb, plugin,
@@ -2162,7 +2167,11 @@ libgnunet_plugin_transport_http_init (void *cls)
2162 MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (16 * 1024), 2167 MHD_OPTION_CONNECTION_MEMORY_LIMIT, (size_t) (16 * 1024),
2163 MHD_OPTION_NOTIFY_COMPLETED, &mhd_termination_cb, NULL, 2168 MHD_OPTION_NOTIFY_COMPLETED, &mhd_termination_cb, NULL,
2164 MHD_OPTION_END); 2169 MHD_OPTION_END);
2165 plugin->http_server_daemon_v4 = MHD_start_daemon (MHD_NO_FLAG | MHD_USE_DEBUG, 2170 plugin->http_server_daemon_v4 = MHD_start_daemon (
2171#if DEBUG_HTTP
2172 MHD_USE_DEBUG |
2173#endif
2174 MHD_NO_FLAG,
2166 port, 2175 port,
2167 &mhd_accept_cb, 2176 &mhd_accept_cb,
2168 plugin , &mdh_access_cb, plugin, 2177 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,
881 fail_notify_address = GNUNET_NO; 881 fail_notify_address = GNUNET_NO;
882} 882}
883 883
884static void
885plugin_env_session_end (void *cls,
886 const struct GNUNET_PeerIdentity *peer,
887 struct Session *session)
888{
889 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Session ended: `%s' %X\n", GNUNET_i2s(peer), session);
890}
891
892
884/** 893/**
885 * Setup plugin environment 894 * Setup plugin environment
886 */ 895 */
@@ -895,6 +904,7 @@ setup_plugin_environment ()
895 env.receive = &receive; 904 env.receive = &receive;
896 env.notify_address = &notify_address; 905 env.notify_address = &notify_address;
897 env.max_connections = max_connect_per_transport; 906 env.max_connections = max_connect_per_transport;
907 env.session_end = &plugin_env_session_end;
898} 908}
899 909
900 910
@@ -1071,8 +1081,8 @@ static void run_connection_tests( int phase , void * cls)
1071 1081
1072 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("\nPhase 3: send multiple or big messages after disconnect\n\n")); 1082 GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("\nPhase 3: send multiple or big messages after disconnect\n\n"));
1073 /* disconnect from peer, so new connections are created */ 1083 /* disconnect from peer, so new connections are created */
1074 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Disconnect from peer: `%s'\n", GNUNET_i2s(&my_identity)); 1084 //GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,"Disconnect from peer: `%s'\n", GNUNET_i2s(&my_identity));
1075 api->disconnect(api->cls, &my_identity); 1085 //api->disconnect(api->cls, &my_identity);
1076 1086
1077 /* send a multiple GNUNET_messages at a time*/ 1087 /* send a multiple GNUNET_messages at a time*/
1078 1088