gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r17160 - gnunet/src/transport
Date: Tue, 4 Oct 2011 11:20:47 +0200

Author: wachs
Date: 2011-10-04 11:20:47 +0200 (Tue, 04 Oct 2011)
New Revision: 17160

Modified:
   gnunet/src/transport/plugin_transport_http_server.c
Log:
bugfixes
timeout handling for other transmission direction


Modified: gnunet/src/transport/plugin_transport_http_server.c
===================================================================
--- gnunet/src/transport/plugin_transport_http_server.c 2011-10-04 09:19:32 UTC 
(rev 17159)
+++ gnunet/src/transport/plugin_transport_http_server.c 2011-10-04 09:20:47 UTC 
(rev 17160)
@@ -185,8 +185,11 @@
       GNUNET_free (cert_file);
 
       GNUNET_free_non_null (plugin->key);
+      plugin->key = NULL;
       GNUNET_free_non_null (plugin->cert);
+      plugin->cert = NULL;
       GNUNET_free_non_null (plugin->crypto_init);
+      plugin->crypto_init = NULL;
 
       return GNUNET_SYSERR;
     }
@@ -207,8 +210,11 @@
     GNUNET_free (cert_file);
 
     GNUNET_free_non_null (plugin->key);
+    plugin->key = NULL;
     GNUNET_free_non_null (plugin->cert);
+    plugin->cert = NULL;
     GNUNET_free_non_null (plugin->crypto_init);
+    plugin->crypto_init = NULL;
 
     return GNUNET_SYSERR;
   }
@@ -222,6 +228,7 @@
 }
 #endif
 
+
 /**
  * Reschedule the execution of both IPv4 and IPv6 server
  * @param plugin the plugin
@@ -515,15 +522,12 @@
 #if MHD_VERSION >= 0x00090E00
   int to = (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.rel_value / 1000);
 #if VERBOSE_SERVER
+  GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
+                   "Server: Setting timeout for %X to %u sec.\n", sc, to);
 #endif
-  GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, plugin->name,
-                   "Server: Setting timeout for %X to %u sec.\n", sc, to);
-
   MHD_set_connection_option (mhd_connection, MHD_CONNECTION_OPTION_TIMEOUT, 
to);
   server_reschedule (plugin, GNUNET_NO);
 #endif
-
-
   return sc;
 }
 
@@ -564,7 +568,6 @@
     }
   }
 
-
   /* existing connection */
   sc = (*httpSessionCache);
   s = sc->session;
@@ -624,10 +627,38 @@
           s->msg_tk = GNUNET_SERVER_mst_create (&server_receive_mst_cb, s);
         }
         res = GNUNET_SERVER_mst_receive (s->msg_tk, s, upload_data, 
*upload_data_size, GNUNET_NO, GNUNET_NO);
+
+#if MHD_VERSION >= 0x00090E00
+#endif
+        int to = (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT.rel_value / 1000);
+        struct ServerConnection *t = NULL;
+
 #if VERBOSE_SERVER
         GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
                          "Server: Received %Zu bytes\n", *upload_data_size);
 #endif
+
+        /* Setting timeouts for other connections */
+        if (s->server_recv != NULL)
+        {
+          t = s->server_recv;
+#if VERBOSE_SERVER
+          GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
+                     "Server: Setting timeout for %X to %u sec.\n", t, to);
+#endif
+          MHD_set_connection_option (t->mhd_conn, 
MHD_CONNECTION_OPTION_TIMEOUT, to);
+        }
+        if (s->server_send != NULL)
+        {
+          t = s->server_send;
+#if VERBOSE_SERVER
+          GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,
+                     "Server: Setting timeout for %X to %u sec.\n", t, to);
+#endif
+          MHD_set_connection_option (t->mhd_conn, 
MHD_CONNECTION_OPTION_TIMEOUT, to);
+        }
+        server_reschedule (plugin, GNUNET_NO);
+
         (*upload_data_size) = 0;
       }
       else
@@ -855,9 +886,11 @@
     {
     if (timeout != last_timeout)
     {
+#if VERBOSE_SERVER
       GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, plugin->name,
                        "SELECT Timeout changed from %llu to %llu\n",
                        last_timeout, timeout);
+#endif
       last_timeout = timeout;
     }
     tv.rel_value = (uint64_t) timeout;
@@ -1052,8 +1085,6 @@
   while (s != NULL)
   {
     t = s->next;
-    if (s->msg_tk != NULL)
-       GNUNET_SERVER_mst_destroy(s->msg_tk);
     delete_session (s);
     s = t;
   }




reply via email to

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