gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r18212 - in libmicrohttpd: . src/daemon


From: gnunet
Subject: [GNUnet-SVN] r18212 - in libmicrohttpd: . src/daemon
Date: Fri, 18 Nov 2011 20:18:24 +0100

Author: grothoff
Date: 2011-11-18 20:18:24 +0100 (Fri, 18 Nov 2011)
New Revision: 18212

Modified:
   libmicrohttpd/ChangeLog
   libmicrohttpd/src/daemon/daemon.c
Log:
fixing 1914

Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog     2011-11-18 16:29:06 UTC (rev 18211)
+++ libmicrohttpd/ChangeLog     2011-11-18 19:18:24 UTC (rev 18212)
@@ -1,3 +1,7 @@
+Fri Nov 18 20:17:22 CET 2011
+       Fixing return value of MHD_get_timeout if timeouts are not in use.
+        (#1914). -rboulton
+
 Sun Nov 13 13:34:29 CET 2011
        Trying to fix accidental addition of a "Connection: close" footer
        under certain (rare) circumstances. -CG

Modified: libmicrohttpd/src/daemon/daemon.c
===================================================================
--- libmicrohttpd/src/daemon/daemon.c   2011-11-18 16:29:06 UTC (rev 18211)
+++ libmicrohttpd/src/daemon/daemon.c   2011-11-18 19:18:24 UTC (rev 18212)
@@ -1204,6 +1204,7 @@
   time_t earliest_deadline;
   time_t now;
   struct MHD_Connection *pos;
+  int have_timeout = MHD_NO;
 
   if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
     {
@@ -1215,19 +1216,22 @@
   pos = daemon->connections_head;
   if (pos == NULL)
     return MHD_NO;              /* no connections */
-  earliest_deadline = pos->last_activity + pos->connection_timeout;
-  pos = pos->next;
   while (pos != NULL)
     {
-      if (earliest_deadline > pos->last_activity + pos->connection_timeout)
-        earliest_deadline = pos->last_activity + pos->connection_timeout;
+      if (0 != pos->connection_timeout) {
+        have_timeout = MHD_YES;
+        if (earliest_deadline > pos->last_activity + pos->connection_timeout)
+          earliest_deadline = pos->last_activity + pos->connection_timeout;
 #if HTTPS_SUPPORT
-      if (  (0 != (daemon->options & MHD_USE_SSL)) &&
-           (0 != gnutls_record_check_pending (pos->tls_session)) )
-       earliest_deadline = 0;
+        if (  (0 != (daemon->options & MHD_USE_SSL)) &&
+             (0 != gnutls_record_check_pending (pos->tls_session)) )
+         earliest_deadline = 0;
 #endif
+      }
       pos = pos->next;
     }
+  if (!have_timeout)
+    return MHD_NO;
   now = time (NULL);
   if (earliest_deadline < now)
     *timeout = 0;




reply via email to

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