[Python-Dev] Pervasive socket failures on Windows (original) (raw)
Scott Dial scott+python-dev at scottdial.com
Fri Feb 10 22:41:41 CET 2006
- Previous message: [Python-Dev] Pervasive socket failures on Windows
- Next message: [Python-Dev] Pervasive socket failures on Windows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Martin v. Löwis wrote:
Tim Peters wrote:
I suggest skipping the new crud conditionalized on a symbol like
PySOCKETFDCANBEGEFDSETSIZE Hmm... How about this patch: Index: Modules/socketmodule.c =================================================================== --- Modules/socketmodule.c (Revision 42308) +++ Modules/socketmodule.c (Arbeitskopie) @@ -396,7 +396,14 @@ static PyTypeObject socktype; /* Can we call select() with this socket without a buffer overrun? */ +#ifdef MSWINDOWS +/* Everything is selectable on Windows */ +#define ISSELECTABLE(s) 1 +#else +/* POSIX says selecting descriptors above FDSETSIZE is undefined + behaviour. */ #define ISSELECTABLE(s) ((s)->sockfd < FDSETSIZE) +#endif static PyObject* selecterror(void) Regards, Martin
That is the exact patch I applied, but you also need to patch _ssl.c
--- C:/python-trunk/Modules/_ssl.c (revision 42305) +++ C:/python-trunk/Modules/_ssl.c (working copy) @@ -376,9 +376,11 @@ if (s->sock_fd < 0) return SOCKET_HAS_BEEN_CLOSED;
+#ifndef MS_WINDOWS /* Guard against socket too large for select*/ if (s->sock_fd >= FD_SETSIZE) return SOCKET_INVALID; +#endif
/* Construct the arguments to select */
tv.tv_sec = (int)s->sock_timeout;But then that leaves whether to go with the Py_SOCKET_FD_CAN_BE_GE_FD_SETSIZE symbol instead of MS_WINDOWS.
-- Scott Dial scott at scottdial.com dialsa at rose-hulman.edu
- Previous message: [Python-Dev] Pervasive socket failures on Windows
- Next message: [Python-Dev] Pervasive socket failures on Windows
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]