[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Avoid emulated poll on macs; use real token bucket for ...



Update of /home/minion/cvsroot/src/minion/src
In directory moria.mit.edu:/tmp/cvs-serv14622/src

Modified Files:
	main.c 
Log Message:
Avoid emulated poll on macs; use real token bucket for smoothing

Index: main.c
===================================================================
RCS file: /home/minion/cvsroot/src/minion/src/main.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- main.c	17 Jan 2004 04:21:40 -0000	1.23
+++ main.c	16 Feb 2004 22:28:13 -0000	1.24
@@ -33,6 +33,18 @@
 #include <netinet/ip.h>
 #endif
 
+#if defined(HAVE_POLL_H)
+#include <poll.h>
+#elif defined(HAVE_SYS_POLL_H)
+#include <sys/poll.h>
+#endif
+
+#ifdef _POLL_EMUL_H_
+#define POLL_IS_EMULATED 1
+#else
+#define POLL_IS_EMULATED 0
+#endif
+
 /* Macros to declare function tables for Python. */
 #define ENTRY_ND(fn) { #fn, (PyCFunction)mm_##fn, METH_VARARGS|METH_KEYWORDS,\
                        0}
@@ -168,15 +180,18 @@
 
         /* For some reason, Python's socket module doesn't export
          * IPTOS_*.  IPTOS_THROUGHPUT should always be "0x08" on any
-         * sane sockets implementation, but life is always more complicated 
+         * sane sockets implementation, but life is always more complicated
          * than that.
         */
 #ifdef IPTOS_THROUGHPUT
         if (PyDict_SetItemString(d, "IPTOS_THROUGHPUT",
                                  PyInt_FromLong(IPTOS_THROUGHPUT)))
-                return;        
+                return;
 #endif
-        
+
+        if (PyDict_SetItemString(d, "POLL_IS_EMULATED",
+                                 PyInt_FromLong(POLL_IS_EMULATED)))
+                return;
 }
 
 /*