From 920f6c8c466a11852d1bd7298e3f76deda69b6f3 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Wed, 18 Dec 2013 14:18:46 +0000 Subject: [PATCH] session time out for http client/server --- src/transport/plugin_transport_http_client.c | 9 ++++++--- src/transport/plugin_transport_http_server.c | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/transport/plugin_transport_http_client.c b/src/transport/plugin_transport_http_client.c index 504cf48ff..ce493ab4e 100644 --- a/src/transport/plugin_transport_http_client.c +++ b/src/transport/plugin_transport_http_client.c @@ -543,7 +543,6 @@ http_client_plugin_send (void *cls, } client_schedule (s->plugin, GNUNET_YES); - client_reschedule_session_timeout (s); return msgbuf_size; } @@ -861,8 +860,6 @@ client_send_cb (void *stream, size_t size, size_t nmemb, void *cls) GNUNET_STATISTICS_update (plugin->env->stats, stat_txt, len, GNUNET_NO); GNUNET_free (stat_txt); - - client_reschedule_session_timeout (s); return len; } @@ -1764,7 +1761,13 @@ http_client_plugin_update_session_timeout (void *cls, const struct GNUNET_PeerIdentity *peer, struct Session *session) { + struct HTTP_Client_Plugin *plugin = cls; + + /* lookup if session is really existing */ + if (GNUNET_YES != client_exist_session (plugin, session)) + return; + client_reschedule_session_timeout (session); } /** diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index 5d529b4ed..f08c7072a 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c @@ -605,7 +605,6 @@ http_server_plugin_send (void *cls, server_reschedule (session->plugin, session->server_send->mhd_daemon, GNUNET_YES); - server_reschedule_session_timeout (session); } return bytes_sent; } @@ -905,7 +904,12 @@ http_server_plugin_update_session_timeout (void *cls, const struct GNUNET_PeerIdentity *peer, struct Session *session) { + struct HTTP_Server_Plugin *plugin = cls; + + if (GNUNET_NO == server_exist_session (plugin, session)) + return; + server_reschedule_session_timeout (session); } -- 2.25.1