gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r23684 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r23684 - gnunet/src/transport
Date: Fri, 7 Sep 2012 09:14:16 +0200

Author: wachs
Date: 2012-09-07 09:14:16 +0200 (Fri, 07 Sep 2012)
New Revision: 23684

Modified:
   gnunet/src/transport/plugin_transport_http_server.c
Log:
- change


Modified: gnunet/src/transport/plugin_transport_http_server.c
===================================================================
--- gnunet/src/transport/plugin_transport_http_server.c 2012-09-06 23:32:51 UTC 
(rev 23683)
+++ gnunet/src/transport/plugin_transport_http_server.c 2012-09-07 07:14:16 UTC 
(rev 23684)
@@ -128,6 +128,11 @@
   int session_passed;
 
   /**
+   * Did we immediately end the session in disconnect_cb
+   */
+  int session_ended;
+
+  /**
    * Absolute time when to receive data again
    * Used for receive throttling
    */
@@ -641,7 +646,7 @@
   struct HTTP_Server_Plugin *plugin = s->plugin;
   server_stop_session_timeout(s);
 
-  if (GNUNET_YES == s->session_passed)
+  if ((GNUNET_YES == s->session_passed) && (GNUNET_NO == s->session_ended))
     plugin->env->session_end (plugin->env->cls, &s->target, s);
 
   GNUNET_CONTAINER_DLL_remove (plugin->head, plugin->tail, s);
@@ -763,8 +768,8 @@
 static int
 server_disconnect (struct Session *s)
 {
-  struct ServerConnection * send;
-  struct ServerConnection * recv;
+  struct ServerConnection * send = NULL;
+  struct ServerConnection * recv = NULL;
 
   send = (struct ServerConnection *) s->server_send;
   if (s->server_send != NULL)
@@ -1031,6 +1036,7 @@
     s->server_recv = NULL;
     s->server_send = NULL;
     s->session_passed = GNUNET_NO;
+    s->session_ended = GNUNET_NO;
     server_start_session_timeout(s);
     GNUNET_CONTAINER_DLL_insert (plugin->head, plugin->tail, s);
   }
@@ -1432,6 +1438,7 @@
 
   GNUNET_free (sc);
   plugin->cur_connections--;
+
   if ((s->server_send == NULL) && (s->server_recv == NULL))
   {
     GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
@@ -1441,6 +1448,12 @@
 
     server_delete_session (s);
   }
+  else if ((GNUNET_YES == s->session_passed) && (GNUNET_NO == 
s->session_ended))
+  {
+    /* Notify transport immediately that this session is invalid */
+    s->session_ended = GNUNET_YES;
+    plugin->env->session_end (plugin->env->cls, &s->target, s);
+  }
 }
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]