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

[minion-cvs] Add TOS flags to client connections; debug timeout impl...



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

Modified Files:
	main.c 
Log Message:
Add TOS flags to client connections; debug timeout implementation.

Index: main.c
===================================================================
RCS file: /home/minion/cvsroot/src/minion/src/main.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- main.c	2 Oct 2003 21:46:23 -0000	1.20
+++ main.c	12 Jan 2004 00:49:01 -0000	1.21
@@ -19,6 +19,18 @@
 #include <rsa.h>
 #endif
 
+#ifdef MS_WINDOWS
+#if _MSC_VER >= 1300
+#include <winsock2.h>
+#else
+#include <winsock.h>
+#endif
+#else /* not windows */
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/ip.h>
+#endif
+
 /* Macros to declare function tables for Python. */
 #define ENTRY_ND(fn) { #fn, (PyCFunction)mm_##fn, METH_VARARGS|METH_KEYWORDS,\
                        0}
@@ -150,6 +162,19 @@
         if (PyDict_SetItemString(d, "FEC",
                                  (PyObject*)&mm_FEC_Type) < 0)
                 return;
+
+
+        /* 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 
+         * than that.
+        */
+#ifdef IPTOS_THROUGHPUT
+        if (PyDict_SetItemString(d, "IPTOS_THROUGHPUT",
+                                 PyInt_FromLong(IPTOS_THROUGHPUT)))
+                return;        
+#endif
+        
 }
 
 /*