[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r8335 - libmicrohttpd/src/daemon
From: |
gnunet |
Subject: |
[GNUnet-SVN] r8335 - libmicrohttpd/src/daemon |
Date: |
Tue, 17 Mar 2009 00:57:36 -0600 |
Author: grothoff
Date: 2009-03-17 00:57:36 -0600 (Tue, 17 Mar 2009)
New Revision: 8335
Modified:
libmicrohttpd/src/daemon/daemon.c
libmicrohttpd/src/daemon/internal.h
Log:
adding thread pool functionality -- code by Richard Alimi
Modified: libmicrohttpd/src/daemon/daemon.c
===================================================================
--- libmicrohttpd/src/daemon/daemon.c 2009-03-17 06:52:37 UTC (rev 8334)
+++ libmicrohttpd/src/daemon/daemon.c 2009-03-17 06:57:36 UTC (rev 8335)
@@ -65,6 +65,18 @@
#endif
/**
+ * Trace up to and return master daemon. If the supplied daemon
+ * is a master, then return the daemon itself.
+ */
+static struct MHD_Daemon*
+MHD_get_master (struct MHD_Daemon *daemon)
+{
+ while (NULL != daemon->master)
+ daemon = daemon->master;
+ return daemon;
+}
+
+/**
* Maintain connection count for single address.
*/
struct MHD_IPCount
@@ -169,6 +181,8 @@
void *node;
int result;
+ daemon = MHD_get_master (daemon);
+
/* Ignore if no connection limit assigned */
if (daemon->per_ip_connection_limit == 0)
return MHD_YES;
@@ -227,6 +241,8 @@
struct MHD_IPCount *found_key;
void *node;
+ daemon = MHD_get_master (daemon);
+
/* Ignore if no connection limit assigned */
if (daemon->per_ip_connection_limit == 0)
return;
Modified: libmicrohttpd/src/daemon/internal.h
===================================================================
--- libmicrohttpd/src/daemon/internal.h 2009-03-17 06:52:37 UTC (rev 8334)
+++ libmicrohttpd/src/daemon/internal.h 2009-03-17 06:57:36 UTC (rev 8335)
@@ -770,6 +770,11 @@
*/
const char *https_mem_cert;
#endif
+
+ /**
+ * Pointer to master daemon (NULL if this is the master)
+ */
+ struct MHD_Daemon *master;
};
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r8335 - libmicrohttpd/src/daemon,
gnunet <=