Index: third_party/twisted_8_1/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c |
diff --git a/third_party/twisted_8_1/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c b/third_party/twisted_8_1/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c |
deleted file mode 100644 |
index f67e35c88717334cef3b3f352faf5c73c11319c5..0000000000000000000000000000000000000000 |
--- a/third_party/twisted_8_1/twisted/internet/iocpreactor/iocpsupport/iocpsupport.c |
+++ /dev/null |
@@ -1,2003 +0,0 @@ |
-/* Generated by Pyrex 0.9.6.4 on Tue Mar 18 10:18:51 2008 */ |
- |
-#define PY_SSIZE_T_CLEAN |
-#include "Python.h" |
-#include "structmember.h" |
-#ifndef PY_LONG_LONG |
- #define PY_LONG_LONG LONG_LONG |
-#endif |
-#if PY_VERSION_HEX < 0x02050000 |
- typedef int Py_ssize_t; |
- #define PY_SSIZE_T_MAX INT_MAX |
- #define PY_SSIZE_T_MIN INT_MIN |
- #define PyInt_FromSsize_t(z) PyInt_FromLong(z) |
- #define PyInt_AsSsize_t(o) PyInt_AsLong(o) |
-#endif |
-#ifndef WIN32 |
- #ifndef __stdcall |
- #define __stdcall |
- #endif |
- #ifndef __cdecl |
- #define __cdecl |
- #endif |
-#endif |
-#ifdef __cplusplus |
-#define __PYX_EXTERN_C extern "C" |
-#else |
-#define __PYX_EXTERN_C extern |
-#endif |
-#include <math.h> |
-#include "io.h" |
-#include "errno.h" |
-#include "winsock2.h" |
-#include "windows.h" |
-#include "python.h" |
-#include "string.h" |
-#include "winsock_pointers.h" |
- |
- |
-typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/ |
-typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ |
- |
-static PyObject *__pyx_m; |
-static PyObject *__pyx_b; |
-static int __pyx_lineno; |
-static char *__pyx_filename; |
-static char **__pyx_f; |
- |
-static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/ |
- |
-static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], Py_ssize_t nargs, PyObject **args2, PyObject **kwds2, char rqd_kwds[]); /*proto*/ |
- |
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ |
- |
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ |
- |
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ |
- |
-static PyObject *__Pyx_UnpackItem(PyObject *); /*proto*/ |
-static int __Pyx_EndUnpack(PyObject *); /*proto*/ |
- |
-static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/ |
- |
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ |
- |
-static void __Pyx_AddTraceback(char *funcname); /*proto*/ |
- |
-/* Declarations from iocpsupport */ |
- |
-typedef int __pyx_t_11iocpsupport_size_t; |
- |
-typedef unsigned long __pyx_t_11iocpsupport_HANDLE; |
- |
-typedef unsigned long __pyx_t_11iocpsupport_SOCKET; |
- |
-typedef unsigned long __pyx_t_11iocpsupport_DWORD; |
- |
-typedef unsigned long __pyx_t_11iocpsupport_ULONG_PTR; |
- |
-typedef int __pyx_t_11iocpsupport_BOOL; |
- |
-struct __pyx_t_11iocpsupport_myOVERLAPPED { |
- OVERLAPPED ov; |
- struct PyObject *obj; |
-}; |
- |
-struct __pyx_obj_11iocpsupport_CompletionPort { |
- PyObject_HEAD |
- __pyx_t_11iocpsupport_HANDLE port; |
-}; |
- |
- |
-static PyTypeObject *__pyx_ptype_11iocpsupport_CompletionPort = 0; |
-static long __pyx_k2; |
-static unsigned long __pyx_k5; |
-static unsigned long __pyx_k6; |
-static unsigned long __pyx_k7; |
-static struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_f_11iocpsupport_makeOV(void); /*proto*/ |
-static void __pyx_f_11iocpsupport_raise_error(int,PyObject *); /*proto*/ |
-static PyObject *__pyx_f_11iocpsupport__makesockaddr(struct sockaddr *,int); /*proto*/ |
-static PyObject *__pyx_f_11iocpsupport_fillinetaddr(struct sockaddr_in *,PyObject *); /*proto*/ |
-static int __pyx_f_11iocpsupport_getAddrFamily(__pyx_t_11iocpsupport_SOCKET); /*proto*/ |
- |
- |
-/* Implementation of iocpsupport */ |
- |
-static char __pyx_k4[] = "Failed to initialize Winsock function vectors"; |
- |
-static PyObject *__pyx_n_Event; |
-static PyObject *__pyx_n___init__; |
-static PyObject *__pyx_n_socket; |
-static PyObject *__pyx_n_ValueError; |
-static PyObject *__pyx_n_have_connectex; |
- |
-static PyObject *__pyx_k4p; |
- |
-static PyObject *__pyx_n_MemoryError; |
- |
-static struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_f_11iocpsupport_makeOV(void) { |
- struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_v_res; |
- struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_r; |
- void *__pyx_1; |
- int __pyx_2; |
- PyObject *__pyx_3 = 0; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":110 */ |
- __pyx_1 = PyMem_Malloc((sizeof(struct __pyx_t_11iocpsupport_myOVERLAPPED))); if (__pyx_1 == NULL) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L1;} |
- __pyx_v_res = ((struct __pyx_t_11iocpsupport_myOVERLAPPED *)__pyx_1); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":111 */ |
- __pyx_2 = (!(__pyx_v_res != 0)); |
- if (__pyx_2) { |
- __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_MemoryError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;} |
- __Pyx_Raise(__pyx_3, 0, 0); |
- Py_DECREF(__pyx_3); __pyx_3 = 0; |
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;} |
- goto __pyx_L2; |
- } |
- __pyx_L2:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":113 */ |
- memset(__pyx_v_res,0,(sizeof(struct __pyx_t_11iocpsupport_myOVERLAPPED))); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":114 */ |
- __pyx_r = __pyx_v_res; |
- goto __pyx_L0; |
- |
- __pyx_r = 0; |
- goto __pyx_L0; |
- __pyx_L1:; |
- Py_XDECREF(__pyx_3); |
- __Pyx_AddTraceback("iocpsupport.makeOV"); |
- __pyx_r = NULL; |
- __pyx_L0:; |
- return __pyx_r; |
-} |
- |
-static PyObject *__pyx_n_WindowsError; |
- |
-static void __pyx_f_11iocpsupport_raise_error(int __pyx_v_err,PyObject *__pyx_v_message) { |
- int __pyx_1; |
- PyObject *__pyx_2 = 0; |
- PyObject *__pyx_3 = 0; |
- PyObject *__pyx_4 = 0; |
- Py_INCREF(__pyx_v_message); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":117 */ |
- __pyx_1 = (!__pyx_v_err); |
- if (__pyx_1) { |
- __pyx_v_err = GetLastError(); |
- goto __pyx_L2; |
- } |
- __pyx_L2:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":119 */ |
- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_WindowsError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} |
- __pyx_3 = PyInt_FromLong(__pyx_v_err); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} |
- __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} |
- Py_INCREF(__pyx_v_message); |
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_message); |
- PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); |
- __pyx_3 = 0; |
- __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} |
- Py_DECREF(__pyx_2); __pyx_2 = 0; |
- Py_DECREF(__pyx_4); __pyx_4 = 0; |
- __Pyx_Raise(__pyx_3, 0, 0); |
- Py_DECREF(__pyx_3); __pyx_3 = 0; |
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;} |
- |
- goto __pyx_L0; |
- __pyx_L1:; |
- Py_XDECREF(__pyx_2); |
- Py_XDECREF(__pyx_3); |
- Py_XDECREF(__pyx_4); |
- __Pyx_AddTraceback("iocpsupport.raise_error"); |
- __pyx_L0:; |
- Py_DECREF(__pyx_v_message); |
-} |
- |
-static PyObject *__pyx_n_callback; |
-static PyObject *__pyx_n_owner; |
-static PyObject *__pyx_n_False; |
-static PyObject *__pyx_n_ignore; |
-static PyObject *__pyx_n_items; |
- |
-static PyObject *__pyx_f_11iocpsupport_5Event___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ |
-static PyMethodDef __pyx_mdef_11iocpsupport_5Event___init__ = {"__init__", (PyCFunction)__pyx_f_11iocpsupport_5Event___init__, METH_VARARGS|METH_KEYWORDS, 0}; |
-static PyObject *__pyx_f_11iocpsupport_5Event___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
- PyObject *__pyx_v_self = 0; |
- PyObject *__pyx_v_callback = 0; |
- PyObject *__pyx_v_owner = 0; |
- PyObject *__pyx_v_kw = 0; |
- PyObject *__pyx_v_k; |
- PyObject *__pyx_v_v; |
- PyObject *__pyx_r; |
- PyObject *__pyx_1 = 0; |
- PyObject *__pyx_2 = 0; |
- PyObject *__pyx_3 = 0; |
- int __pyx_4; |
- static char *__pyx_argnames[] = {"self","callback","owner",0}; |
- if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 3, 0, &__pyx_v_kw, 0) < 0) return 0; |
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_self, &__pyx_v_callback, &__pyx_v_owner)) { |
- Py_XDECREF(__pyx_args); |
- Py_XDECREF(__pyx_kwds); |
- Py_XDECREF(__pyx_v_kw); |
- return 0; |
- } |
- Py_INCREF(__pyx_v_self); |
- Py_INCREF(__pyx_v_callback); |
- Py_INCREF(__pyx_v_owner); |
- __pyx_v_k = Py_None; Py_INCREF(Py_None); |
- __pyx_v_v = Py_None; Py_INCREF(Py_None); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":123 */ |
- if (PyObject_SetAttr(__pyx_v_self, __pyx_n_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;} |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":124 */ |
- if (PyObject_SetAttr(__pyx_v_self, __pyx_n_owner, __pyx_v_owner) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; goto __pyx_L1;} |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":125 */ |
- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;} |
- if (PyObject_SetAttr(__pyx_v_self, __pyx_n_ignore, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;} |
- Py_DECREF(__pyx_1); __pyx_1 = 0; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":126 */ |
- __pyx_1 = PyObject_GetAttr(__pyx_v_kw, __pyx_n_items); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;} |
- __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;} |
- Py_DECREF(__pyx_1); __pyx_1 = 0; |
- __pyx_1 = PyObject_GetIter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;} |
- Py_DECREF(__pyx_2); __pyx_2 = 0; |
- for (;;) { |
- __pyx_2 = PyIter_Next(__pyx_1); |
- if (!__pyx_2) { |
- if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;} |
- break; |
- } |
- __pyx_3 = PyObject_GetIter(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;} |
- Py_DECREF(__pyx_2); __pyx_2 = 0; |
- __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;} |
- Py_DECREF(__pyx_v_k); |
- __pyx_v_k = __pyx_2; |
- __pyx_2 = 0; |
- __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;} |
- Py_DECREF(__pyx_v_v); |
- __pyx_v_v = __pyx_2; |
- __pyx_2 = 0; |
- if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;} |
- Py_DECREF(__pyx_3); __pyx_3 = 0; |
- __pyx_4 = PyObject_SetAttr(__pyx_v_self,__pyx_v_k,__pyx_v_v); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;} |
- } |
- Py_DECREF(__pyx_1); __pyx_1 = 0; |
- |
- __pyx_r = Py_None; Py_INCREF(Py_None); |
- goto __pyx_L0; |
- __pyx_L1:; |
- Py_XDECREF(__pyx_1); |
- Py_XDECREF(__pyx_2); |
- Py_XDECREF(__pyx_3); |
- __Pyx_AddTraceback("iocpsupport.Event.__init__"); |
- __pyx_r = 0; |
- __pyx_L0:; |
- Py_XDECREF(__pyx_v_kw); |
- Py_DECREF(__pyx_v_k); |
- Py_DECREF(__pyx_v_v); |
- Py_DECREF(__pyx_v_self); |
- Py_DECREF(__pyx_v_callback); |
- Py_DECREF(__pyx_v_owner); |
- Py_XDECREF(__pyx_args); |
- Py_XDECREF(__pyx_kwds); |
- return __pyx_r; |
-} |
- |
-static PyObject *__pyx_n_CreateIoCompletionPort; |
- |
- |
-static int __pyx_f_11iocpsupport_14CompletionPort___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ |
-static int __pyx_f_11iocpsupport_14CompletionPort___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
- __pyx_t_11iocpsupport_HANDLE __pyx_v_res; |
- int __pyx_r; |
- int __pyx_1; |
- static char *__pyx_argnames[] = {0}; |
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; |
- Py_INCREF(__pyx_v_self); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":133 */ |
- __pyx_v_res = CreateIoCompletionPort(INVALID_HANDLE_VALUE,0,0,0); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":134 */ |
- __pyx_1 = (!__pyx_v_res); |
- if (__pyx_1) { |
- __pyx_f_11iocpsupport_raise_error(0,__pyx_n_CreateIoCompletionPort); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;} |
- goto __pyx_L2; |
- } |
- __pyx_L2:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":136 */ |
- ((struct __pyx_obj_11iocpsupport_CompletionPort *)__pyx_v_self)->port = __pyx_v_res; |
- |
- __pyx_r = 0; |
- goto __pyx_L0; |
- __pyx_L1:; |
- __Pyx_AddTraceback("iocpsupport.CompletionPort.__init__"); |
- __pyx_r = -1; |
- __pyx_L0:; |
- Py_DECREF(__pyx_v_self); |
- return __pyx_r; |
-} |
- |
- |
-static PyObject *__pyx_f_11iocpsupport_14CompletionPort_addHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ |
-static PyObject *__pyx_f_11iocpsupport_14CompletionPort_addHandle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
- long __pyx_v_handle; |
- long __pyx_v_key; |
- __pyx_t_11iocpsupport_HANDLE __pyx_v_res; |
- PyObject *__pyx_r; |
- int __pyx_1; |
- static char *__pyx_argnames[] = {"handle","key",0}; |
- __pyx_v_key = __pyx_k2; |
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "l|l", __pyx_argnames, &__pyx_v_handle, &__pyx_v_key)) return 0; |
- Py_INCREF(__pyx_v_self); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":140 */ |
- __pyx_v_res = CreateIoCompletionPort(__pyx_v_handle,((struct __pyx_obj_11iocpsupport_CompletionPort *)__pyx_v_self)->port,__pyx_v_key,0); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":141 */ |
- __pyx_1 = (!__pyx_v_res); |
- if (__pyx_1) { |
- __pyx_f_11iocpsupport_raise_error(0,__pyx_n_CreateIoCompletionPort); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; goto __pyx_L1;} |
- goto __pyx_L2; |
- } |
- __pyx_L2:; |
- |
- __pyx_r = Py_None; Py_INCREF(Py_None); |
- goto __pyx_L0; |
- __pyx_L1:; |
- __Pyx_AddTraceback("iocpsupport.CompletionPort.addHandle"); |
- __pyx_r = 0; |
- __pyx_L0:; |
- Py_DECREF(__pyx_v_self); |
- return __pyx_r; |
-} |
- |
-static PyObject *__pyx_f_11iocpsupport_14CompletionPort_getEvent(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ |
-static PyObject *__pyx_f_11iocpsupport_14CompletionPort_getEvent(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
- long __pyx_v_timeout; |
- struct PyThreadState *__pyx_v__save; |
- unsigned long __pyx_v_bytes; |
- unsigned long __pyx_v_key; |
- unsigned long __pyx_v_rc; |
- struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_v_ov; |
- PyObject *__pyx_v_obj; |
- PyObject *__pyx_r; |
- int __pyx_1; |
- PyObject *__pyx_2 = 0; |
- PyObject *__pyx_3 = 0; |
- PyObject *__pyx_4 = 0; |
- PyObject *__pyx_5 = 0; |
- static char *__pyx_argnames[] = {"timeout",0}; |
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "l", __pyx_argnames, &__pyx_v_timeout)) return 0; |
- Py_INCREF(__pyx_v_self); |
- __pyx_v_obj = Py_None; Py_INCREF(Py_None); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":149 */ |
- __pyx_v__save = PyEval_SaveThread(); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":150 */ |
- __pyx_v_rc = GetQueuedCompletionStatus(((struct __pyx_obj_11iocpsupport_CompletionPort *)__pyx_v_self)->port,(&__pyx_v_bytes),(&__pyx_v_key),((OVERLAPPED **)(&__pyx_v_ov)),__pyx_v_timeout); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":151 */ |
- PyEval_RestoreThread(__pyx_v__save); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":153 */ |
- __pyx_1 = (!__pyx_v_rc); |
- if (__pyx_1) { |
- __pyx_v_rc = GetLastError(); |
- goto __pyx_L2; |
- } |
- /*else*/ { |
- __pyx_v_rc = 0; |
- } |
- __pyx_L2:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":158 */ |
- Py_INCREF(Py_None); |
- Py_DECREF(__pyx_v_obj); |
- __pyx_v_obj = Py_None; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":159 */ |
- __pyx_1 = (__pyx_v_ov != 0); |
- if (__pyx_1) { |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":160 */ |
- __pyx_1 = (__pyx_v_ov->obj != 0); |
- if (__pyx_1) { |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":161 */ |
- __pyx_2 = (PyObject *)__pyx_v_ov->obj; |
- Py_INCREF(__pyx_2); |
- Py_DECREF(__pyx_v_obj); |
- __pyx_v_obj = __pyx_2; |
- __pyx_2 = 0; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":162 */ |
- Py_DECREF(__pyx_v_obj); |
- goto __pyx_L4; |
- } |
- __pyx_L4:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":163 */ |
- PyMem_Free(__pyx_v_ov); |
- goto __pyx_L3; |
- } |
- __pyx_L3:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":165 */ |
- __pyx_2 = PyLong_FromUnsignedLong(__pyx_v_rc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} |
- __pyx_3 = PyLong_FromUnsignedLong(__pyx_v_bytes); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} |
- __pyx_4 = PyLong_FromUnsignedLong(__pyx_v_key); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} |
- __pyx_5 = PyTuple_New(4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} |
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2); |
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); |
- PyTuple_SET_ITEM(__pyx_5, 2, __pyx_4); |
- Py_INCREF(__pyx_v_obj); |
- PyTuple_SET_ITEM(__pyx_5, 3, __pyx_v_obj); |
- __pyx_2 = 0; |
- __pyx_3 = 0; |
- __pyx_4 = 0; |
- __pyx_r = __pyx_5; |
- __pyx_5 = 0; |
- goto __pyx_L0; |
- |
- __pyx_r = Py_None; Py_INCREF(Py_None); |
- goto __pyx_L0; |
- __pyx_L1:; |
- Py_XDECREF(__pyx_2); |
- Py_XDECREF(__pyx_3); |
- Py_XDECREF(__pyx_4); |
- Py_XDECREF(__pyx_5); |
- __Pyx_AddTraceback("iocpsupport.CompletionPort.getEvent"); |
- __pyx_r = 0; |
- __pyx_L0:; |
- Py_DECREF(__pyx_v_obj); |
- Py_DECREF(__pyx_v_self); |
- return __pyx_r; |
-} |
- |
-static PyObject *__pyx_n_PostQueuedCompletionStatus; |
- |
- |
-static PyObject *__pyx_f_11iocpsupport_14CompletionPort_postEvent(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ |
-static PyObject *__pyx_f_11iocpsupport_14CompletionPort_postEvent(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
- unsigned long __pyx_v_bytes; |
- unsigned long __pyx_v_key; |
- PyObject *__pyx_v_obj = 0; |
- struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_v_ov; |
- unsigned long __pyx_v_rc; |
- PyObject *__pyx_r; |
- int __pyx_1; |
- struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_2; |
- static char *__pyx_argnames[] = {"bytes","key","obj",0}; |
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "kkO", __pyx_argnames, &__pyx_v_bytes, &__pyx_v_key, &__pyx_v_obj)) return 0; |
- Py_INCREF(__pyx_v_self); |
- Py_INCREF(__pyx_v_obj); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":171 */ |
- __pyx_1 = __pyx_v_obj != Py_None; |
- if (__pyx_1) { |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":172 */ |
- __pyx_2 = __pyx_f_11iocpsupport_makeOV(); if (__pyx_2 == NULL) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; goto __pyx_L1;} |
- __pyx_v_ov = __pyx_2; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":173 */ |
- Py_INCREF(__pyx_v_obj); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":174 */ |
- __pyx_v_ov->obj = ((struct PyObject *)__pyx_v_obj); |
- goto __pyx_L2; |
- } |
- /*else*/ { |
- __pyx_v_ov = NULL; |
- } |
- __pyx_L2:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":178 */ |
- __pyx_v_rc = PostQueuedCompletionStatus(((struct __pyx_obj_11iocpsupport_CompletionPort *)__pyx_v_self)->port,__pyx_v_bytes,__pyx_v_key,((OVERLAPPED *)__pyx_v_ov)); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":179 */ |
- __pyx_1 = (!__pyx_v_rc); |
- if (__pyx_1) { |
- __pyx_f_11iocpsupport_raise_error(0,__pyx_n_PostQueuedCompletionStatus); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;} |
- goto __pyx_L3; |
- } |
- __pyx_L3:; |
- |
- __pyx_r = Py_None; Py_INCREF(Py_None); |
- goto __pyx_L0; |
- __pyx_L1:; |
- __Pyx_AddTraceback("iocpsupport.CompletionPort.postEvent"); |
- __pyx_r = 0; |
- __pyx_L0:; |
- Py_DECREF(__pyx_v_self); |
- Py_DECREF(__pyx_v_obj); |
- return __pyx_r; |
-} |
- |
-static PyObject *__pyx_f_11iocpsupport_14CompletionPort___del__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ |
-static PyObject *__pyx_f_11iocpsupport_14CompletionPort___del__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
- PyObject *__pyx_r; |
- static char *__pyx_argnames[] = {0}; |
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; |
- Py_INCREF(__pyx_v_self); |
- CloseHandle(((struct __pyx_obj_11iocpsupport_CompletionPort *)__pyx_v_self)->port); |
- |
- __pyx_r = Py_None; Py_INCREF(Py_None); |
- Py_DECREF(__pyx_v_self); |
- return __pyx_r; |
-} |
- |
-static PyObject *__pyx_f_11iocpsupport_makesockaddr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ |
-static PyObject *__pyx_f_11iocpsupport_makesockaddr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
- PyObject *__pyx_v_buff = 0; |
- void *__pyx_v_mem_buffer; |
- int __pyx_v_size; |
- PyObject *__pyx_r; |
- int __pyx_1; |
- PyObject *__pyx_2 = 0; |
- static char *__pyx_argnames[] = {"buff",0}; |
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_buff)) return 0; |
- Py_INCREF(__pyx_v_buff); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":189 */ |
- __pyx_1 = PyObject_AsReadBuffer(__pyx_v_buff,(&__pyx_v_mem_buffer),(&__pyx_v_size)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; goto __pyx_L1;} |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":191 */ |
- __pyx_2 = __pyx_f_11iocpsupport__makesockaddr(((struct sockaddr *)__pyx_v_mem_buffer),__pyx_v_size); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;} |
- __pyx_r = __pyx_2; |
- __pyx_2 = 0; |
- goto __pyx_L0; |
- |
- __pyx_r = Py_None; Py_INCREF(Py_None); |
- goto __pyx_L0; |
- __pyx_L1:; |
- Py_XDECREF(__pyx_2); |
- __Pyx_AddTraceback("iocpsupport.makesockaddr"); |
- __pyx_r = 0; |
- __pyx_L0:; |
- Py_DECREF(__pyx_v_buff); |
- return __pyx_r; |
-} |
- |
-static PyObject *__pyx_f_11iocpsupport__makesockaddr(struct sockaddr *__pyx_v_addr,int __pyx_v_len) { |
- struct sockaddr_in *__pyx_v_sin; |
- PyObject *__pyx_r; |
- int __pyx_1; |
- PyObject *__pyx_2 = 0; |
- PyObject *__pyx_3 = 0; |
- PyObject *__pyx_4 = 0; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":195 */ |
- __pyx_1 = (!__pyx_v_len); |
- if (__pyx_1) { |
- Py_INCREF(Py_None); |
- __pyx_r = Py_None; |
- goto __pyx_L0; |
- goto __pyx_L2; |
- } |
- __pyx_L2:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":197 */ |
- __pyx_1 = (__pyx_v_addr->sa_family == AF_INET); |
- if (__pyx_1) { |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":198 */ |
- __pyx_v_sin = ((struct sockaddr_in *)__pyx_v_addr); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":199 */ |
- __pyx_2 = PyString_FromString(inet_ntoa(__pyx_v_sin->sin_addr)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;} |
- __pyx_3 = PyInt_FromLong(ntohs(__pyx_v_sin->sin_port)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;} |
- __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;} |
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); |
- PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); |
- __pyx_2 = 0; |
- __pyx_3 = 0; |
- __pyx_r = __pyx_4; |
- __pyx_4 = 0; |
- goto __pyx_L0; |
- goto __pyx_L3; |
- } |
- /*else*/ { |
- __pyx_2 = PyString_FromStringAndSize(__pyx_v_addr->sa_data,(sizeof(__pyx_v_addr->sa_data))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; goto __pyx_L1;} |
- __pyx_r = __pyx_2; |
- __pyx_2 = 0; |
- goto __pyx_L0; |
- } |
- __pyx_L3:; |
- |
- __pyx_r = Py_None; Py_INCREF(Py_None); |
- goto __pyx_L0; |
- __pyx_L1:; |
- Py_XDECREF(__pyx_2); |
- Py_XDECREF(__pyx_3); |
- Py_XDECREF(__pyx_4); |
- __Pyx_AddTraceback("iocpsupport._makesockaddr"); |
- __pyx_r = 0; |
- __pyx_L0:; |
- return __pyx_r; |
-} |
- |
-static PyObject *__pyx_k11p; |
- |
-static char __pyx_k11[] = "invalid IP address"; |
- |
-static PyObject *__pyx_f_11iocpsupport_fillinetaddr(struct sockaddr_in *__pyx_v_dest,PyObject *__pyx_v_addr) { |
- short __pyx_v_port; |
- unsigned long __pyx_v_res; |
- char *__pyx_v_hoststr; |
- PyObject *__pyx_v_host; |
- PyObject *__pyx_r; |
- PyObject *__pyx_1 = 0; |
- PyObject *__pyx_2 = 0; |
- short __pyx_3; |
- char *__pyx_4; |
- int __pyx_5; |
- Py_INCREF(__pyx_v_addr); |
- __pyx_v_host = Py_None; Py_INCREF(Py_None); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":207 */ |
- __pyx_1 = PyObject_GetIter(__pyx_v_addr); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;} |
- __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;} |
- Py_DECREF(__pyx_v_host); |
- __pyx_v_host = __pyx_2; |
- __pyx_2 = 0; |
- __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;} |
- __pyx_3 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;} |
- Py_DECREF(__pyx_2); __pyx_2 = 0; |
- __pyx_v_port = __pyx_3; |
- if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;} |
- Py_DECREF(__pyx_1); __pyx_1 = 0; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":209 */ |
- __pyx_4 = PyString_AsString(__pyx_v_host); if (__pyx_4 == NULL) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; goto __pyx_L1;} |
- __pyx_v_hoststr = __pyx_4; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":210 */ |
- __pyx_v_res = inet_addr(__pyx_v_hoststr); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":211 */ |
- __pyx_5 = (__pyx_v_res == INADDR_ANY); |
- if (__pyx_5) { |
- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} |
- __Pyx_Raise(__pyx_2, __pyx_k11p, 0); |
- Py_DECREF(__pyx_2); __pyx_2 = 0; |
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} |
- goto __pyx_L2; |
- } |
- __pyx_L2:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":213 */ |
- __pyx_v_dest->sin_addr.s_addr = __pyx_v_res; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":215 */ |
- __pyx_v_dest->sin_port = htons(__pyx_v_port); |
- |
- __pyx_r = Py_None; Py_INCREF(Py_None); |
- goto __pyx_L0; |
- __pyx_L1:; |
- Py_XDECREF(__pyx_1); |
- Py_XDECREF(__pyx_2); |
- __Pyx_AddTraceback("iocpsupport.fillinetaddr"); |
- __pyx_r = 0; |
- __pyx_L0:; |
- Py_DECREF(__pyx_v_host); |
- Py_DECREF(__pyx_v_addr); |
- return __pyx_r; |
-} |
- |
-static PyObject *__pyx_f_11iocpsupport_AllocateReadBuffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ |
-static PyObject *__pyx_f_11iocpsupport_AllocateReadBuffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
- int __pyx_v_size; |
- PyObject *__pyx_r; |
- PyObject *__pyx_1 = 0; |
- static char *__pyx_argnames[] = {"size",0}; |
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "i", __pyx_argnames, &__pyx_v_size)) return 0; |
- __pyx_1 = PyBuffer_New(__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;} |
- __pyx_r = __pyx_1; |
- __pyx_1 = 0; |
- goto __pyx_L0; |
- |
- __pyx_r = Py_None; Py_INCREF(Py_None); |
- goto __pyx_L0; |
- __pyx_L1:; |
- Py_XDECREF(__pyx_1); |
- __Pyx_AddTraceback("iocpsupport.AllocateReadBuffer"); |
- __pyx_r = 0; |
- __pyx_L0:; |
- return __pyx_r; |
-} |
- |
-static PyObject *__pyx_n_getsockopt; |
- |
- |
-static PyObject *__pyx_f_11iocpsupport_maxAddrLen(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ |
-static PyObject *__pyx_f_11iocpsupport_maxAddrLen(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
- long __pyx_v_s; |
- WSAPROTOCOL_INFO __pyx_v_wsa_pi; |
- int __pyx_v_size; |
- int __pyx_v_rc; |
- PyObject *__pyx_r; |
- int __pyx_1; |
- PyObject *__pyx_2 = 0; |
- static char *__pyx_argnames[] = {"s",0}; |
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "l", __pyx_argnames, &__pyx_v_s)) return 0; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":224 */ |
- __pyx_v_size = (sizeof(__pyx_v_wsa_pi)); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":225 */ |
- __pyx_v_rc = getsockopt(__pyx_v_s,SOL_SOCKET,SO_PROTOCOL_INFO,((char *)(&__pyx_v_wsa_pi)),(&__pyx_v_size)); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":226 */ |
- __pyx_1 = (__pyx_v_rc == SOCKET_ERROR); |
- if (__pyx_1) { |
- __pyx_f_11iocpsupport_raise_error(WSAGetLastError(),__pyx_n_getsockopt); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;} |
- goto __pyx_L2; |
- } |
- __pyx_L2:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":228 */ |
- __pyx_2 = PyInt_FromLong(__pyx_v_wsa_pi.iMaxSockAddr); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;} |
- __pyx_r = __pyx_2; |
- __pyx_2 = 0; |
- goto __pyx_L0; |
- |
- __pyx_r = Py_None; Py_INCREF(Py_None); |
- goto __pyx_L0; |
- __pyx_L1:; |
- Py_XDECREF(__pyx_2); |
- __Pyx_AddTraceback("iocpsupport.maxAddrLen"); |
- __pyx_r = 0; |
- __pyx_L0:; |
- return __pyx_r; |
-} |
- |
- |
-static int __pyx_f_11iocpsupport_getAddrFamily(__pyx_t_11iocpsupport_SOCKET __pyx_v_s) { |
- WSAPROTOCOL_INFO __pyx_v_wsa_pi; |
- int __pyx_v_size; |
- int __pyx_v_rc; |
- int __pyx_r; |
- int __pyx_1; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":234 */ |
- __pyx_v_size = (sizeof(__pyx_v_wsa_pi)); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":235 */ |
- __pyx_v_rc = getsockopt(__pyx_v_s,SOL_SOCKET,SO_PROTOCOL_INFO,((char *)(&__pyx_v_wsa_pi)),(&__pyx_v_size)); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":236 */ |
- __pyx_1 = (__pyx_v_rc == SOCKET_ERROR); |
- if (__pyx_1) { |
- __pyx_f_11iocpsupport_raise_error(WSAGetLastError(),__pyx_n_getsockopt); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; goto __pyx_L1;} |
- goto __pyx_L2; |
- } |
- __pyx_L2:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":238 */ |
- __pyx_r = __pyx_v_wsa_pi.iAddressFamily; |
- goto __pyx_L0; |
- |
- __pyx_r = 0; |
- goto __pyx_L0; |
- __pyx_L1:; |
- __Pyx_AddTraceback("iocpsupport.getAddrFamily"); |
- __pyx_L0:; |
- return __pyx_r; |
-} |
- |
-static PyObject *__pyx_f_11iocpsupport_accept(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ |
-static PyObject *__pyx_f_11iocpsupport_accept(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
- long __pyx_v_listening; |
- long __pyx_v_accepting; |
- PyObject *__pyx_v_buff = 0; |
- PyObject *__pyx_v_obj = 0; |
- unsigned long __pyx_v_bytes; |
- int __pyx_v_size; |
- int __pyx_v_rc; |
- void *__pyx_v_mem_buffer; |
- struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_v_ov; |
- PyObject *__pyx_r; |
- int __pyx_1; |
- struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_2; |
- PyObject *__pyx_3 = 0; |
- static char *__pyx_argnames[] = {"listening","accepting","buff","obj",0}; |
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "llOO", __pyx_argnames, &__pyx_v_listening, &__pyx_v_accepting, &__pyx_v_buff, &__pyx_v_obj)) return 0; |
- Py_INCREF(__pyx_v_buff); |
- Py_INCREF(__pyx_v_obj); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\acceptex.pxi":11 */ |
- __pyx_1 = PyObject_AsWriteBuffer(__pyx_v_buff,(&__pyx_v_mem_buffer),(&__pyx_v_size)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 11; goto __pyx_L1;} |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\acceptex.pxi":13 */ |
- __pyx_2 = __pyx_f_11iocpsupport_makeOV(); if (__pyx_2 == NULL) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 13; goto __pyx_L1;} |
- __pyx_v_ov = __pyx_2; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\acceptex.pxi":14 */ |
- __pyx_1 = __pyx_v_obj != Py_None; |
- if (__pyx_1) { |
- __pyx_v_ov->obj = ((struct PyObject *)__pyx_v_obj); |
- goto __pyx_L2; |
- } |
- __pyx_L2:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\acceptex.pxi":17 */ |
- __pyx_v_rc = lpAcceptEx(__pyx_v_listening,__pyx_v_accepting,__pyx_v_mem_buffer,0,(__pyx_v_size / 2),(__pyx_v_size / 2),(&__pyx_v_bytes),((OVERLAPPED *)__pyx_v_ov)); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\acceptex.pxi":19 */ |
- __pyx_1 = (!__pyx_v_rc); |
- if (__pyx_1) { |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\acceptex.pxi":20 */ |
- __pyx_v_rc = WSAGetLastError(); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\acceptex.pxi":21 */ |
- __pyx_1 = (__pyx_v_rc != ERROR_IO_PENDING); |
- if (__pyx_1) { |
- __pyx_3 = PyInt_FromLong(__pyx_v_rc); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; goto __pyx_L1;} |
- __pyx_r = __pyx_3; |
- __pyx_3 = 0; |
- goto __pyx_L0; |
- goto __pyx_L4; |
- } |
- __pyx_L4:; |
- goto __pyx_L3; |
- } |
- __pyx_L3:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\acceptex.pxi":25 */ |
- Py_XINCREF(__pyx_v_obj); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\acceptex.pxi":26 */ |
- __pyx_3 = PyInt_FromLong(__pyx_v_rc); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; goto __pyx_L1;} |
- __pyx_r = __pyx_3; |
- __pyx_3 = 0; |
- goto __pyx_L0; |
- |
- __pyx_r = Py_None; Py_INCREF(Py_None); |
- goto __pyx_L0; |
- __pyx_L1:; |
- Py_XDECREF(__pyx_3); |
- __Pyx_AddTraceback("iocpsupport.accept"); |
- __pyx_r = 0; |
- __pyx_L0:; |
- Py_DECREF(__pyx_v_buff); |
- Py_DECREF(__pyx_v_obj); |
- return __pyx_r; |
-} |
- |
-static PyObject *__pyx_f_11iocpsupport_get_accept_addrs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ |
-static PyObject *__pyx_f_11iocpsupport_get_accept_addrs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
- long __pyx_v_s; |
- PyObject *__pyx_v_buff = 0; |
- int __pyx_v_size; |
- int __pyx_v_locallen; |
- int __pyx_v_remotelen; |
- void *__pyx_v_mem_buffer; |
- struct sockaddr *__pyx_v_localaddr; |
- struct sockaddr *__pyx_v_remoteaddr; |
- PyObject *__pyx_r; |
- int __pyx_1; |
- PyObject *__pyx_2 = 0; |
- PyObject *__pyx_3 = 0; |
- PyObject *__pyx_4 = 0; |
- PyObject *__pyx_5 = 0; |
- static char *__pyx_argnames[] = {"s","buff",0}; |
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "lO", __pyx_argnames, &__pyx_v_s, &__pyx_v_buff)) return 0; |
- Py_INCREF(__pyx_v_buff); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\acceptex.pxi":34 */ |
- __pyx_1 = PyObject_AsReadBuffer(__pyx_v_buff,(&__pyx_v_mem_buffer),(&__pyx_v_size)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; goto __pyx_L1;} |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\acceptex.pxi":36 */ |
- lpGetAcceptExSockaddrs(__pyx_v_mem_buffer,0,(__pyx_v_size / 2),(__pyx_v_size / 2),(&__pyx_v_localaddr),(&__pyx_v_locallen),(&__pyx_v_remoteaddr),(&__pyx_v_remotelen)); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\acceptex.pxi":37 */ |
- __pyx_2 = PyInt_FromLong(__pyx_v_remoteaddr->sa_family); if (!__pyx_2) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 37; goto __pyx_L1;} |
- __pyx_3 = __pyx_f_11iocpsupport__makesockaddr(__pyx_v_localaddr,__pyx_v_locallen); if (!__pyx_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 37; goto __pyx_L1;} |
- __pyx_4 = __pyx_f_11iocpsupport__makesockaddr(__pyx_v_remoteaddr,__pyx_v_remotelen); if (!__pyx_4) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 37; goto __pyx_L1;} |
- __pyx_5 = PyTuple_New(3); if (!__pyx_5) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 37; goto __pyx_L1;} |
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2); |
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); |
- PyTuple_SET_ITEM(__pyx_5, 2, __pyx_4); |
- __pyx_2 = 0; |
- __pyx_3 = 0; |
- __pyx_4 = 0; |
- __pyx_r = __pyx_5; |
- __pyx_5 = 0; |
- goto __pyx_L0; |
- |
- __pyx_r = Py_None; Py_INCREF(Py_None); |
- goto __pyx_L0; |
- __pyx_L1:; |
- Py_XDECREF(__pyx_2); |
- Py_XDECREF(__pyx_3); |
- Py_XDECREF(__pyx_4); |
- Py_XDECREF(__pyx_5); |
- __Pyx_AddTraceback("iocpsupport.get_accept_addrs"); |
- __pyx_r = 0; |
- __pyx_L0:; |
- Py_DECREF(__pyx_v_buff); |
- return __pyx_r; |
-} |
- |
-static PyObject *__pyx_k14p; |
-static PyObject *__pyx_k15p; |
- |
-static char __pyx_k14[] = "ConnectEx is not available on this system"; |
-static char __pyx_k15[] = "unsupported address family"; |
- |
-static PyObject *__pyx_f_11iocpsupport_connect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ |
-static PyObject *__pyx_f_11iocpsupport_connect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
- long __pyx_v_s; |
- PyObject *__pyx_v_addr = 0; |
- PyObject *__pyx_v_obj = 0; |
- int __pyx_v_family; |
- int __pyx_v_rc; |
- struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_v_ov; |
- struct sockaddr __pyx_v_name; |
- PyObject *__pyx_r; |
- PyObject *__pyx_1 = 0; |
- int __pyx_2; |
- int __pyx_3; |
- struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_4; |
- static char *__pyx_argnames[] = {"s","addr","obj",0}; |
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "lOO", __pyx_argnames, &__pyx_v_s, &__pyx_v_addr, &__pyx_v_obj)) return 0; |
- Py_INCREF(__pyx_v_addr); |
- Py_INCREF(__pyx_v_obj); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\connectex.pxi":10 */ |
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_have_connectex); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; goto __pyx_L1;} |
- __pyx_2 = PyObject_IsTrue(__pyx_1); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 10; goto __pyx_L1;} |
- Py_DECREF(__pyx_1); __pyx_1 = 0; |
- __pyx_3 = (!__pyx_2); |
- if (__pyx_3) { |
- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; goto __pyx_L1;} |
- __Pyx_Raise(__pyx_1, __pyx_k14p, 0); |
- Py_DECREF(__pyx_1); __pyx_1 = 0; |
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 11; goto __pyx_L1;} |
- goto __pyx_L2; |
- } |
- __pyx_L2:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\connectex.pxi":13 */ |
- __pyx_2 = __pyx_f_11iocpsupport_getAddrFamily(__pyx_v_s); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 13; goto __pyx_L1;} |
- __pyx_v_family = __pyx_2; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\connectex.pxi":14 */ |
- __pyx_3 = (__pyx_v_family == AF_INET); |
- if (__pyx_3) { |
- __pyx_1 = __pyx_f_11iocpsupport_fillinetaddr(((struct sockaddr_in *)(&__pyx_v_name)),__pyx_v_addr); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; goto __pyx_L1;} |
- Py_DECREF(__pyx_1); __pyx_1 = 0; |
- goto __pyx_L3; |
- } |
- /*else*/ { |
- __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; goto __pyx_L1;} |
- __Pyx_Raise(__pyx_1, __pyx_k15p, 0); |
- Py_DECREF(__pyx_1); __pyx_1 = 0; |
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 17; goto __pyx_L1;} |
- } |
- __pyx_L3:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\connectex.pxi":18 */ |
- __pyx_v_name.sa_family = __pyx_v_family; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\connectex.pxi":20 */ |
- __pyx_4 = __pyx_f_11iocpsupport_makeOV(); if (__pyx_4 == NULL) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; goto __pyx_L1;} |
- __pyx_v_ov = __pyx_4; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\connectex.pxi":21 */ |
- __pyx_2 = __pyx_v_obj != Py_None; |
- if (__pyx_2) { |
- __pyx_v_ov->obj = ((struct PyObject *)__pyx_v_obj); |
- goto __pyx_L4; |
- } |
- __pyx_L4:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\connectex.pxi":24 */ |
- __pyx_v_rc = lpConnectEx(__pyx_v_s,(&__pyx_v_name),(sizeof(__pyx_v_name)),NULL,0,NULL,((OVERLAPPED *)__pyx_v_ov)); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\connectex.pxi":26 */ |
- __pyx_3 = (!__pyx_v_rc); |
- if (__pyx_3) { |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\connectex.pxi":27 */ |
- __pyx_v_rc = WSAGetLastError(); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\connectex.pxi":28 */ |
- __pyx_2 = (__pyx_v_rc != ERROR_IO_PENDING); |
- if (__pyx_2) { |
- __pyx_1 = PyInt_FromLong(__pyx_v_rc); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; goto __pyx_L1;} |
- __pyx_r = __pyx_1; |
- __pyx_1 = 0; |
- goto __pyx_L0; |
- goto __pyx_L6; |
- } |
- __pyx_L6:; |
- goto __pyx_L5; |
- } |
- __pyx_L5:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\connectex.pxi":32 */ |
- Py_XINCREF(__pyx_v_obj); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\connectex.pxi":33 */ |
- __pyx_1 = PyInt_FromLong(__pyx_v_rc); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; goto __pyx_L1;} |
- __pyx_r = __pyx_1; |
- __pyx_1 = 0; |
- goto __pyx_L0; |
- |
- __pyx_r = Py_None; Py_INCREF(Py_None); |
- goto __pyx_L0; |
- __pyx_L1:; |
- Py_XDECREF(__pyx_1); |
- __Pyx_AddTraceback("iocpsupport.connect"); |
- __pyx_r = 0; |
- __pyx_L0:; |
- Py_DECREF(__pyx_v_addr); |
- Py_DECREF(__pyx_v_obj); |
- return __pyx_r; |
-} |
- |
-static char __pyx_k16[] = "second argument needs to be a list"; |
- |
-static PyObject *__pyx_f_11iocpsupport_recv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ |
-static PyObject *__pyx_f_11iocpsupport_recv(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
- long __pyx_v_s; |
- PyObject *__pyx_v_bufflist = 0; |
- PyObject *__pyx_v_obj = 0; |
- unsigned long __pyx_v_flags; |
- int __pyx_v_rc; |
- int __pyx_v_buffcount; |
- int __pyx_v_i; |
- struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_v_ov; |
- WSABUF *__pyx_v_ws_buf; |
- unsigned long __pyx_v_bytes; |
- struct PyObject **__pyx_v_buffers; |
- PyObject *__pyx_r; |
- PyObject *__pyx_1 = 0; |
- void *__pyx_2; |
- int __pyx_3; |
- struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_4; |
- PyObject *__pyx_5 = 0; |
- PyObject *__pyx_6 = 0; |
- static char *__pyx_argnames[] = {"s","bufflist","obj","flags",0}; |
- __pyx_v_flags = __pyx_k5; |
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "lOO|k", __pyx_argnames, &__pyx_v_s, &__pyx_v_bufflist, &__pyx_v_obj, &__pyx_v_flags)) return 0; |
- Py_INCREF(__pyx_v_bufflist); |
- Py_INCREF(__pyx_v_obj); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":12 */ |
- __pyx_1 = PySequence_Fast(__pyx_v_bufflist,__pyx_k16); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; goto __pyx_L1;} |
- Py_DECREF(__pyx_v_bufflist); |
- __pyx_v_bufflist = __pyx_1; |
- __pyx_1 = 0; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":13 */ |
- __pyx_v_buffcount = PySequence_Fast_GET_SIZE(__pyx_v_bufflist); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":14 */ |
- __pyx_v_buffers = PySequence_Fast_ITEMS(__pyx_v_bufflist); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":16 */ |
- __pyx_2 = PyMem_Malloc((__pyx_v_buffcount * (sizeof(WSABUF)))); if (__pyx_2 == NULL) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; goto __pyx_L1;} |
- __pyx_v_ws_buf = ((WSABUF *)__pyx_2); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":18 */ |
- /*try:*/ { |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":19 */ |
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_buffcount; ++__pyx_v_i) { |
- __pyx_1 = (PyObject *)(__pyx_v_buffers[__pyx_v_i]); |
- Py_INCREF(__pyx_1); |
- __pyx_3 = PyObject_AsWriteBuffer(__pyx_1,((void **)(&(__pyx_v_ws_buf[__pyx_v_i]).buf)),((int *)(&(__pyx_v_ws_buf[__pyx_v_i]).len))); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 20; goto __pyx_L3;} |
- Py_DECREF(__pyx_1); __pyx_1 = 0; |
- } |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":22 */ |
- __pyx_4 = __pyx_f_11iocpsupport_makeOV(); if (__pyx_4 == NULL) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; goto __pyx_L3;} |
- __pyx_v_ov = __pyx_4; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":23 */ |
- __pyx_3 = __pyx_v_obj != Py_None; |
- if (__pyx_3) { |
- __pyx_v_ov->obj = ((struct PyObject *)__pyx_v_obj); |
- goto __pyx_L7; |
- } |
- __pyx_L7:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":26 */ |
- __pyx_v_rc = WSARecv(__pyx_v_s,__pyx_v_ws_buf,__pyx_v_buffcount,(&__pyx_v_bytes),(&__pyx_v_flags),((OVERLAPPED *)__pyx_v_ov),NULL); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":28 */ |
- __pyx_3 = (__pyx_v_rc == SOCKET_ERROR); |
- if (__pyx_3) { |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":29 */ |
- __pyx_v_rc = WSAGetLastError(); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":30 */ |
- __pyx_3 = (__pyx_v_rc != ERROR_IO_PENDING); |
- if (__pyx_3) { |
- __pyx_1 = PyInt_FromLong(__pyx_v_rc); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; goto __pyx_L3;} |
- __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; goto __pyx_L3;} |
- __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; goto __pyx_L3;} |
- PyTuple_SET_ITEM(__pyx_6, 0, __pyx_1); |
- PyTuple_SET_ITEM(__pyx_6, 1, __pyx_5); |
- __pyx_1 = 0; |
- __pyx_5 = 0; |
- __pyx_r = __pyx_6; |
- __pyx_6 = 0; |
- goto __pyx_L2; |
- goto __pyx_L9; |
- } |
- __pyx_L9:; |
- goto __pyx_L8; |
- } |
- __pyx_L8:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":33 */ |
- Py_XINCREF(__pyx_v_obj); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":34 */ |
- __pyx_1 = PyInt_FromLong(__pyx_v_rc); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; goto __pyx_L3;} |
- __pyx_5 = PyLong_FromUnsignedLong(__pyx_v_bytes); if (!__pyx_5) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; goto __pyx_L3;} |
- __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; goto __pyx_L3;} |
- PyTuple_SET_ITEM(__pyx_6, 0, __pyx_1); |
- PyTuple_SET_ITEM(__pyx_6, 1, __pyx_5); |
- __pyx_1 = 0; |
- __pyx_5 = 0; |
- __pyx_r = __pyx_6; |
- __pyx_6 = 0; |
- goto __pyx_L2; |
- } |
- /*finally:*/ { |
- int __pyx_why; |
- PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; |
- int __pyx_exc_lineno; |
- __pyx_why = 0; goto __pyx_L4; |
- __pyx_L2: __pyx_why = 3; goto __pyx_L4; |
- __pyx_L3: { |
- __pyx_why = 4; |
- Py_XDECREF(__pyx_1); __pyx_1 = 0; |
- Py_XDECREF(__pyx_5); __pyx_5 = 0; |
- Py_XDECREF(__pyx_6); __pyx_6 = 0; |
- PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); |
- __pyx_exc_lineno = __pyx_lineno; |
- goto __pyx_L4; |
- } |
- __pyx_L4:; |
- PyMem_Free(__pyx_v_ws_buf); |
- switch (__pyx_why) { |
- case 3: goto __pyx_L0; |
- case 4: { |
- PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); |
- __pyx_lineno = __pyx_exc_lineno; |
- __pyx_exc_type = 0; |
- __pyx_exc_value = 0; |
- __pyx_exc_tb = 0; |
- goto __pyx_L1; |
- } |
- } |
- } |
- |
- __pyx_r = Py_None; Py_INCREF(Py_None); |
- goto __pyx_L0; |
- __pyx_L1:; |
- Py_XDECREF(__pyx_1); |
- Py_XDECREF(__pyx_5); |
- Py_XDECREF(__pyx_6); |
- __Pyx_AddTraceback("iocpsupport.recv"); |
- __pyx_r = 0; |
- __pyx_L0:; |
- Py_DECREF(__pyx_v_bufflist); |
- Py_DECREF(__pyx_v_obj); |
- return __pyx_r; |
-} |
- |
-static PyObject *__pyx_f_11iocpsupport_recvfrom(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ |
-static PyObject *__pyx_f_11iocpsupport_recvfrom(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
- long __pyx_v_s; |
- PyObject *__pyx_v_buff = 0; |
- PyObject *__pyx_v_addr_buff = 0; |
- PyObject *__pyx_v_obj = 0; |
- unsigned long __pyx_v_flags; |
- int __pyx_v_rc; |
- int __pyx_v_fromlen; |
- struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_v_ov; |
- WSABUF __pyx_v_ws_buf; |
- unsigned long __pyx_v_bytes; |
- struct sockaddr *__pyx_v_fromaddr; |
- PyObject *__pyx_r; |
- int __pyx_1; |
- struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_2; |
- PyObject *__pyx_3 = 0; |
- PyObject *__pyx_4 = 0; |
- PyObject *__pyx_5 = 0; |
- static char *__pyx_argnames[] = {"s","buff","addr_buff","obj","flags",0}; |
- __pyx_v_flags = __pyx_k6; |
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "lOOO|k", __pyx_argnames, &__pyx_v_s, &__pyx_v_buff, &__pyx_v_addr_buff, &__pyx_v_obj, &__pyx_v_flags)) return 0; |
- Py_INCREF(__pyx_v_buff); |
- Py_INCREF(__pyx_v_addr_buff); |
- Py_INCREF(__pyx_v_obj); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":45 */ |
- __pyx_1 = PyObject_AsWriteBuffer(__pyx_v_buff,((void **)(&__pyx_v_ws_buf.buf)),((int *)(&__pyx_v_ws_buf.len))); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 45; goto __pyx_L1;} |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":46 */ |
- __pyx_1 = PyObject_AsWriteBuffer(__pyx_v_addr_buff,((void **)(&__pyx_v_fromaddr)),(&__pyx_v_fromlen)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 46; goto __pyx_L1;} |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":48 */ |
- __pyx_2 = __pyx_f_11iocpsupport_makeOV(); if (__pyx_2 == NULL) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; goto __pyx_L1;} |
- __pyx_v_ov = __pyx_2; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":49 */ |
- __pyx_1 = __pyx_v_obj != Py_None; |
- if (__pyx_1) { |
- __pyx_v_ov->obj = ((struct PyObject *)__pyx_v_obj); |
- goto __pyx_L2; |
- } |
- __pyx_L2:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":52 */ |
- __pyx_v_rc = WSARecvFrom(__pyx_v_s,(&__pyx_v_ws_buf),1,(&__pyx_v_bytes),(&__pyx_v_flags),__pyx_v_fromaddr,(&__pyx_v_fromlen),((OVERLAPPED *)__pyx_v_ov),NULL); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":54 */ |
- __pyx_1 = (__pyx_v_rc == SOCKET_ERROR); |
- if (__pyx_1) { |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":55 */ |
- __pyx_v_rc = WSAGetLastError(); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":56 */ |
- __pyx_1 = (__pyx_v_rc != ERROR_IO_PENDING); |
- if (__pyx_1) { |
- __pyx_3 = PyInt_FromLong(__pyx_v_rc); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; goto __pyx_L1;} |
- __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; goto __pyx_L1;} |
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 57; goto __pyx_L1;} |
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_3); |
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); |
- __pyx_3 = 0; |
- __pyx_4 = 0; |
- __pyx_r = __pyx_5; |
- __pyx_5 = 0; |
- goto __pyx_L0; |
- goto __pyx_L4; |
- } |
- __pyx_L4:; |
- goto __pyx_L3; |
- } |
- __pyx_L3:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":59 */ |
- Py_XINCREF(__pyx_v_obj); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":60 */ |
- __pyx_3 = PyInt_FromLong(__pyx_v_rc); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; goto __pyx_L1;} |
- __pyx_4 = PyLong_FromUnsignedLong(__pyx_v_bytes); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; goto __pyx_L1;} |
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; goto __pyx_L1;} |
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_3); |
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); |
- __pyx_3 = 0; |
- __pyx_4 = 0; |
- __pyx_r = __pyx_5; |
- __pyx_5 = 0; |
- goto __pyx_L0; |
- |
- __pyx_r = Py_None; Py_INCREF(Py_None); |
- goto __pyx_L0; |
- __pyx_L1:; |
- Py_XDECREF(__pyx_3); |
- Py_XDECREF(__pyx_4); |
- Py_XDECREF(__pyx_5); |
- __Pyx_AddTraceback("iocpsupport.recvfrom"); |
- __pyx_r = 0; |
- __pyx_L0:; |
- Py_DECREF(__pyx_v_buff); |
- Py_DECREF(__pyx_v_addr_buff); |
- Py_DECREF(__pyx_v_obj); |
- return __pyx_r; |
-} |
- |
-static PyObject *__pyx_f_11iocpsupport_send(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ |
-static PyObject *__pyx_f_11iocpsupport_send(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
- long __pyx_v_s; |
- PyObject *__pyx_v_buff = 0; |
- PyObject *__pyx_v_obj = 0; |
- unsigned long __pyx_v_flags; |
- int __pyx_v_rc; |
- struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_v_ov; |
- WSABUF __pyx_v_ws_buf; |
- unsigned long __pyx_v_bytes; |
- PyObject *__pyx_r; |
- int __pyx_1; |
- struct __pyx_t_11iocpsupport_myOVERLAPPED *__pyx_2; |
- PyObject *__pyx_3 = 0; |
- PyObject *__pyx_4 = 0; |
- PyObject *__pyx_5 = 0; |
- static char *__pyx_argnames[] = {"s","buff","obj","flags",0}; |
- __pyx_v_flags = __pyx_k7; |
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "lOO|k", __pyx_argnames, &__pyx_v_s, &__pyx_v_buff, &__pyx_v_obj, &__pyx_v_flags)) return 0; |
- Py_INCREF(__pyx_v_buff); |
- Py_INCREF(__pyx_v_obj); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsasend.pxi":11 */ |
- __pyx_1 = PyObject_AsReadBuffer(__pyx_v_buff,((void **)(&__pyx_v_ws_buf.buf)),((int *)(&__pyx_v_ws_buf.len))); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 11; goto __pyx_L1;} |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsasend.pxi":13 */ |
- __pyx_2 = __pyx_f_11iocpsupport_makeOV(); if (__pyx_2 == NULL) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 13; goto __pyx_L1;} |
- __pyx_v_ov = __pyx_2; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsasend.pxi":14 */ |
- __pyx_1 = __pyx_v_obj != Py_None; |
- if (__pyx_1) { |
- __pyx_v_ov->obj = ((struct PyObject *)__pyx_v_obj); |
- goto __pyx_L2; |
- } |
- __pyx_L2:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsasend.pxi":17 */ |
- __pyx_v_rc = WSASend(__pyx_v_s,(&__pyx_v_ws_buf),1,(&__pyx_v_bytes),__pyx_v_flags,((OVERLAPPED *)__pyx_v_ov),NULL); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsasend.pxi":19 */ |
- __pyx_1 = (__pyx_v_rc == SOCKET_ERROR); |
- if (__pyx_1) { |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsasend.pxi":20 */ |
- __pyx_v_rc = WSAGetLastError(); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsasend.pxi":21 */ |
- __pyx_1 = (__pyx_v_rc != ERROR_IO_PENDING); |
- if (__pyx_1) { |
- __pyx_3 = PyInt_FromLong(__pyx_v_rc); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 22; goto __pyx_L1;} |
- __pyx_4 = PyLong_FromUnsignedLong(__pyx_v_bytes); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 22; goto __pyx_L1;} |
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 22; goto __pyx_L1;} |
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_3); |
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); |
- __pyx_3 = 0; |
- __pyx_4 = 0; |
- __pyx_r = __pyx_5; |
- __pyx_5 = 0; |
- goto __pyx_L0; |
- goto __pyx_L4; |
- } |
- __pyx_L4:; |
- goto __pyx_L3; |
- } |
- __pyx_L3:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsasend.pxi":24 */ |
- Py_XINCREF(__pyx_v_obj); |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsasend.pxi":25 */ |
- __pyx_3 = PyInt_FromLong(__pyx_v_rc); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 25; goto __pyx_L1;} |
- __pyx_4 = PyLong_FromUnsignedLong(__pyx_v_bytes); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 25; goto __pyx_L1;} |
- __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 25; goto __pyx_L1;} |
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_3); |
- PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); |
- __pyx_3 = 0; |
- __pyx_4 = 0; |
- __pyx_r = __pyx_5; |
- __pyx_5 = 0; |
- goto __pyx_L0; |
- |
- __pyx_r = Py_None; Py_INCREF(Py_None); |
- goto __pyx_L0; |
- __pyx_L1:; |
- Py_XDECREF(__pyx_3); |
- Py_XDECREF(__pyx_4); |
- Py_XDECREF(__pyx_5); |
- __Pyx_AddTraceback("iocpsupport.send"); |
- __pyx_r = 0; |
- __pyx_L0:; |
- Py_DECREF(__pyx_v_buff); |
- Py_DECREF(__pyx_v_obj); |
- return __pyx_r; |
-} |
- |
-static __Pyx_InternTabEntry __pyx_intern_tab[] = { |
- {&__pyx_n_CreateIoCompletionPort, "CreateIoCompletionPort"}, |
- {&__pyx_n_Event, "Event"}, |
- {&__pyx_n_False, "False"}, |
- {&__pyx_n_MemoryError, "MemoryError"}, |
- {&__pyx_n_PostQueuedCompletionStatus, "PostQueuedCompletionStatus"}, |
- {&__pyx_n_ValueError, "ValueError"}, |
- {&__pyx_n_WindowsError, "WindowsError"}, |
- {&__pyx_n___init__, "__init__"}, |
- {&__pyx_n_callback, "callback"}, |
- {&__pyx_n_getsockopt, "getsockopt"}, |
- {&__pyx_n_have_connectex, "have_connectex"}, |
- {&__pyx_n_ignore, "ignore"}, |
- {&__pyx_n_items, "items"}, |
- {&__pyx_n_owner, "owner"}, |
- {&__pyx_n_socket, "socket"}, |
- {0, 0} |
-}; |
- |
-static __Pyx_StringTabEntry __pyx_string_tab[] = { |
- {&__pyx_k4p, __pyx_k4, sizeof(__pyx_k4)}, |
- {&__pyx_k11p, __pyx_k11, sizeof(__pyx_k11)}, |
- {&__pyx_k14p, __pyx_k14, sizeof(__pyx_k14)}, |
- {&__pyx_k15p, __pyx_k15, sizeof(__pyx_k15)}, |
- {0, 0, 0} |
-}; |
- |
-static PyObject *__pyx_tp_new_11iocpsupport_CompletionPort(PyTypeObject *t, PyObject *a, PyObject *k) { |
- PyObject *o = (*t->tp_alloc)(t, 0); |
- if (!o) return 0; |
- return o; |
-} |
- |
-static void __pyx_tp_dealloc_11iocpsupport_CompletionPort(PyObject *o) { |
- (*o->ob_type->tp_free)(o); |
-} |
- |
-static int __pyx_tp_traverse_11iocpsupport_CompletionPort(PyObject *o, visitproc v, void *a) { |
- return 0; |
-} |
- |
-static int __pyx_tp_clear_11iocpsupport_CompletionPort(PyObject *o) { |
- return 0; |
-} |
- |
-static struct PyMethodDef __pyx_methods_11iocpsupport_CompletionPort[] = { |
- {"addHandle", (PyCFunction)__pyx_f_11iocpsupport_14CompletionPort_addHandle, METH_VARARGS|METH_KEYWORDS, 0}, |
- {"getEvent", (PyCFunction)__pyx_f_11iocpsupport_14CompletionPort_getEvent, METH_VARARGS|METH_KEYWORDS, 0}, |
- {"postEvent", (PyCFunction)__pyx_f_11iocpsupport_14CompletionPort_postEvent, METH_VARARGS|METH_KEYWORDS, 0}, |
- {"__del__", (PyCFunction)__pyx_f_11iocpsupport_14CompletionPort___del__, METH_VARARGS|METH_KEYWORDS, 0}, |
- {0, 0, 0, 0} |
-}; |
- |
-static PyNumberMethods __pyx_tp_as_number_CompletionPort = { |
- 0, /*nb_add*/ |
- 0, /*nb_subtract*/ |
- 0, /*nb_multiply*/ |
- 0, /*nb_divide*/ |
- 0, /*nb_remainder*/ |
- 0, /*nb_divmod*/ |
- 0, /*nb_power*/ |
- 0, /*nb_negative*/ |
- 0, /*nb_positive*/ |
- 0, /*nb_absolute*/ |
- 0, /*nb_nonzero*/ |
- 0, /*nb_invert*/ |
- 0, /*nb_lshift*/ |
- 0, /*nb_rshift*/ |
- 0, /*nb_and*/ |
- 0, /*nb_xor*/ |
- 0, /*nb_or*/ |
- 0, /*nb_coerce*/ |
- 0, /*nb_int*/ |
- 0, /*nb_long*/ |
- 0, /*nb_float*/ |
- 0, /*nb_oct*/ |
- 0, /*nb_hex*/ |
- 0, /*nb_inplace_add*/ |
- 0, /*nb_inplace_subtract*/ |
- 0, /*nb_inplace_multiply*/ |
- 0, /*nb_inplace_divide*/ |
- 0, /*nb_inplace_remainder*/ |
- 0, /*nb_inplace_power*/ |
- 0, /*nb_inplace_lshift*/ |
- 0, /*nb_inplace_rshift*/ |
- 0, /*nb_inplace_and*/ |
- 0, /*nb_inplace_xor*/ |
- 0, /*nb_inplace_or*/ |
- 0, /*nb_floor_divide*/ |
- 0, /*nb_true_divide*/ |
- 0, /*nb_inplace_floor_divide*/ |
- 0, /*nb_inplace_true_divide*/ |
- #if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX |
- 0, /*nb_index*/ |
- #endif |
-}; |
- |
-static PySequenceMethods __pyx_tp_as_sequence_CompletionPort = { |
- 0, /*sq_length*/ |
- 0, /*sq_concat*/ |
- 0, /*sq_repeat*/ |
- 0, /*sq_item*/ |
- 0, /*sq_slice*/ |
- 0, /*sq_ass_item*/ |
- 0, /*sq_ass_slice*/ |
- 0, /*sq_contains*/ |
- 0, /*sq_inplace_concat*/ |
- 0, /*sq_inplace_repeat*/ |
-}; |
- |
-static PyMappingMethods __pyx_tp_as_mapping_CompletionPort = { |
- 0, /*mp_length*/ |
- 0, /*mp_subscript*/ |
- 0, /*mp_ass_subscript*/ |
-}; |
- |
-static PyBufferProcs __pyx_tp_as_buffer_CompletionPort = { |
- 0, /*bf_getreadbuffer*/ |
- 0, /*bf_getwritebuffer*/ |
- 0, /*bf_getsegcount*/ |
- 0, /*bf_getcharbuffer*/ |
-}; |
- |
-PyTypeObject __pyx_type_11iocpsupport_CompletionPort = { |
- PyObject_HEAD_INIT(0) |
- 0, /*ob_size*/ |
- "iocpsupport.CompletionPort", /*tp_name*/ |
- sizeof(struct __pyx_obj_11iocpsupport_CompletionPort), /*tp_basicsize*/ |
- 0, /*tp_itemsize*/ |
- __pyx_tp_dealloc_11iocpsupport_CompletionPort, /*tp_dealloc*/ |
- 0, /*tp_print*/ |
- 0, /*tp_getattr*/ |
- 0, /*tp_setattr*/ |
- 0, /*tp_compare*/ |
- 0, /*tp_repr*/ |
- &__pyx_tp_as_number_CompletionPort, /*tp_as_number*/ |
- &__pyx_tp_as_sequence_CompletionPort, /*tp_as_sequence*/ |
- &__pyx_tp_as_mapping_CompletionPort, /*tp_as_mapping*/ |
- 0, /*tp_hash*/ |
- 0, /*tp_call*/ |
- 0, /*tp_str*/ |
- 0, /*tp_getattro*/ |
- 0, /*tp_setattro*/ |
- &__pyx_tp_as_buffer_CompletionPort, /*tp_as_buffer*/ |
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ |
- 0, /*tp_doc*/ |
- __pyx_tp_traverse_11iocpsupport_CompletionPort, /*tp_traverse*/ |
- __pyx_tp_clear_11iocpsupport_CompletionPort, /*tp_clear*/ |
- 0, /*tp_richcompare*/ |
- 0, /*tp_weaklistoffset*/ |
- 0, /*tp_iter*/ |
- 0, /*tp_iternext*/ |
- __pyx_methods_11iocpsupport_CompletionPort, /*tp_methods*/ |
- 0, /*tp_members*/ |
- 0, /*tp_getset*/ |
- 0, /*tp_base*/ |
- 0, /*tp_dict*/ |
- 0, /*tp_descr_get*/ |
- 0, /*tp_descr_set*/ |
- 0, /*tp_dictoffset*/ |
- __pyx_f_11iocpsupport_14CompletionPort___init__, /*tp_init*/ |
- 0, /*tp_alloc*/ |
- __pyx_tp_new_11iocpsupport_CompletionPort, /*tp_new*/ |
- 0, /*tp_free*/ |
- 0, /*tp_is_gc*/ |
- 0, /*tp_bases*/ |
- 0, /*tp_mro*/ |
- 0, /*tp_cache*/ |
- 0, /*tp_subclasses*/ |
- 0, /*tp_weaklist*/ |
-}; |
- |
-static struct PyMethodDef __pyx_methods[] = { |
- {"makesockaddr", (PyCFunction)__pyx_f_11iocpsupport_makesockaddr, METH_VARARGS|METH_KEYWORDS, 0}, |
- {"AllocateReadBuffer", (PyCFunction)__pyx_f_11iocpsupport_AllocateReadBuffer, METH_VARARGS|METH_KEYWORDS, 0}, |
- {"maxAddrLen", (PyCFunction)__pyx_f_11iocpsupport_maxAddrLen, METH_VARARGS|METH_KEYWORDS, 0}, |
- {"accept", (PyCFunction)__pyx_f_11iocpsupport_accept, METH_VARARGS|METH_KEYWORDS, 0}, |
- {"get_accept_addrs", (PyCFunction)__pyx_f_11iocpsupport_get_accept_addrs, METH_VARARGS|METH_KEYWORDS, 0}, |
- {"connect", (PyCFunction)__pyx_f_11iocpsupport_connect, METH_VARARGS|METH_KEYWORDS, 0}, |
- {"recv", (PyCFunction)__pyx_f_11iocpsupport_recv, METH_VARARGS|METH_KEYWORDS, 0}, |
- {"recvfrom", (PyCFunction)__pyx_f_11iocpsupport_recvfrom, METH_VARARGS|METH_KEYWORDS, 0}, |
- {"send", (PyCFunction)__pyx_f_11iocpsupport_send, METH_VARARGS|METH_KEYWORDS, 0}, |
- {0, 0, 0, 0} |
-}; |
- |
-static void __pyx_init_filenames(void); /*proto*/ |
- |
-PyMODINIT_FUNC initiocpsupport(void); /*proto*/ |
-PyMODINIT_FUNC initiocpsupport(void) { |
- PyObject *__pyx_1 = 0; |
- PyObject *__pyx_2 = 0; |
- PyObject *__pyx_3 = 0; |
- PyObject *__pyx_4 = 0; |
- int __pyx_5; |
- __pyx_init_filenames(); |
- __pyx_m = Py_InitModule4("iocpsupport", __pyx_methods, 0, 0, PYTHON_API_VERSION); |
- if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}; |
- Py_INCREF(__pyx_m); |
- __pyx_b = PyImport_AddModule("__builtin__"); |
- if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}; |
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}; |
- if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}; |
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}; |
- if (PyType_Ready(&__pyx_type_11iocpsupport_CompletionPort) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;} |
- if (PyObject_SetAttrString(__pyx_m, "CompletionPort", (PyObject *)&__pyx_type_11iocpsupport_CompletionPort) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;} |
- __pyx_ptype_11iocpsupport_CompletionPort = &__pyx_type_11iocpsupport_CompletionPort; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":121 */ |
- __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;} |
- __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;} |
- __pyx_3 = __Pyx_CreateClass(__pyx_2, __pyx_1, __pyx_n_Event, "iocpsupport"); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;} |
- Py_DECREF(__pyx_2); __pyx_2 = 0; |
- __pyx_2 = PyCFunction_New(&__pyx_mdef_11iocpsupport_5Event___init__, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;} |
- __pyx_4 = PyMethod_New(__pyx_2, 0, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;} |
- Py_DECREF(__pyx_2); __pyx_2 = 0; |
- if (PyObject_SetAttr(__pyx_3, __pyx_n___init__, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;} |
- Py_DECREF(__pyx_4); __pyx_4 = 0; |
- if (PyObject_SetAttr(__pyx_m, __pyx_n_Event, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;} |
- Py_DECREF(__pyx_3); __pyx_3 = 0; |
- Py_DECREF(__pyx_1); __pyx_1 = 0; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":138 */ |
- __pyx_k2 = 0; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":240 */ |
- __pyx_2 = __Pyx_Import(__pyx_n_socket, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;} |
- if (PyObject_SetAttr(__pyx_m, __pyx_n_socket, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; goto __pyx_L1;} |
- Py_DECREF(__pyx_2); __pyx_2 = 0; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":241 */ |
- __pyx_5 = (!initWinsockPointers()); |
- if (__pyx_5) { |
- __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; goto __pyx_L1;} |
- __Pyx_Raise(__pyx_4, __pyx_k4p, 0); |
- Py_DECREF(__pyx_4); __pyx_4 = 0; |
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; goto __pyx_L1;} |
- goto __pyx_L5; |
- } |
- __pyx_L5:; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport/iocpsupport.pyx":244 */ |
- __pyx_3 = PyInt_FromLong((lpConnectEx != NULL)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;} |
- if (PyObject_SetAttr(__pyx_m, __pyx_n_have_connectex, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;} |
- Py_DECREF(__pyx_3); __pyx_3 = 0; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":5 */ |
- __pyx_k5 = 0; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsarecv.pxi":38 */ |
- __pyx_k6 = 0; |
- |
- /* "X:\projects\Twisted\trunk\twisted\internet\iocpreactor\iocpsupport\wsasend.pxi":5 */ |
- __pyx_k7 = 0; |
- return; |
- __pyx_L1:; |
- Py_XDECREF(__pyx_1); |
- Py_XDECREF(__pyx_2); |
- Py_XDECREF(__pyx_3); |
- Py_XDECREF(__pyx_4); |
- __Pyx_AddTraceback("iocpsupport"); |
-} |
- |
-static char *__pyx_filenames[] = { |
- "iocpsupport.pyx", |
- "acceptex.pxi", |
- "connectex.pxi", |
- "wsarecv.pxi", |
- "wsasend.pxi", |
-}; |
- |
-/* Runtime support code */ |
- |
-static void __pyx_init_filenames(void) { |
- __pyx_f = __pyx_filenames; |
-} |
- |
-static PyObject *__Pyx_CreateClass( |
- PyObject *bases, PyObject *dict, PyObject *name, char *modname) |
-{ |
- PyObject *py_modname; |
- PyObject *result = 0; |
- |
- py_modname = PyString_FromString(modname); |
- if (!py_modname) |
- goto bad; |
- if (PyDict_SetItemString(dict, "__module__", py_modname) < 0) |
- goto bad; |
- result = PyClass_New(bases, dict, name); |
-bad: |
- Py_XDECREF(py_modname); |
- return result; |
-} |
- |
-static int __Pyx_GetStarArgs( |
- PyObject **args, |
- PyObject **kwds, |
- char *kwd_list[], |
- Py_ssize_t nargs, |
- PyObject **args2, |
- PyObject **kwds2, |
- char rqd_kwds[]) |
-{ |
- PyObject *x = 0, *args1 = 0, *kwds1 = 0; |
- int i; |
- char **p; |
- |
- if (args2) |
- *args2 = 0; |
- if (kwds2) |
- *kwds2 = 0; |
- |
- if (args2) { |
- args1 = PyTuple_GetSlice(*args, 0, nargs); |
- if (!args1) |
- goto bad; |
- *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_GET_SIZE(*args)); |
- if (!*args2) |
- goto bad; |
- } |
- else if (PyTuple_GET_SIZE(*args) > nargs) { |
- int m = nargs; |
- int n = PyTuple_GET_SIZE(*args); |
- PyErr_Format(PyExc_TypeError, |
- "function takes at most %d positional arguments (%d given)", |
- m, n); |
- goto bad; |
- } |
- else { |
- args1 = *args; |
- Py_INCREF(args1); |
- } |
- |
- if (rqd_kwds && !*kwds) |
- for (i = 0, p = kwd_list; *p; i++, p++) |
- if (rqd_kwds[i]) |
- goto missing_kwarg; |
- |
- if (kwds2) { |
- if (*kwds) { |
- kwds1 = PyDict_New(); |
- if (!kwds1) |
- goto bad; |
- *kwds2 = PyDict_Copy(*kwds); |
- if (!*kwds2) |
- goto bad; |
- for (i = 0, p = kwd_list; *p; i++, p++) { |
- x = PyDict_GetItemString(*kwds, *p); |
- if (x) { |
- if (PyDict_SetItemString(kwds1, *p, x) < 0) |
- goto bad; |
- if (PyDict_DelItemString(*kwds2, *p) < 0) |
- goto bad; |
- } |
- else if (rqd_kwds && rqd_kwds[i]) |
- goto missing_kwarg; |
- } |
- } |
- else { |
- *kwds2 = PyDict_New(); |
- if (!*kwds2) |
- goto bad; |
- } |
- } |
- else { |
- kwds1 = *kwds; |
- Py_XINCREF(kwds1); |
- if (rqd_kwds && *kwds) |
- for (i = 0, p = kwd_list; *p; i++, p++) |
- if (rqd_kwds[i] && !PyDict_GetItemString(*kwds, *p)) |
- goto missing_kwarg; |
- } |
- |
- *args = args1; |
- *kwds = kwds1; |
- return 0; |
-missing_kwarg: |
- PyErr_Format(PyExc_TypeError, |
- "required keyword argument '%s' is missing", *p); |
-bad: |
- Py_XDECREF(args1); |
- Py_XDECREF(kwds1); |
- if (args2) { |
- Py_XDECREF(*args2); |
- } |
- if (kwds2) { |
- Py_XDECREF(*kwds2); |
- } |
- return -1; |
-} |
- |
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { |
- PyObject *__import__ = 0; |
- PyObject *empty_list = 0; |
- PyObject *module = 0; |
- PyObject *global_dict = 0; |
- PyObject *empty_dict = 0; |
- PyObject *list; |
- __import__ = PyObject_GetAttrString(__pyx_b, "__import__"); |
- if (!__import__) |
- goto bad; |
- if (from_list) |
- list = from_list; |
- else { |
- empty_list = PyList_New(0); |
- if (!empty_list) |
- goto bad; |
- list = empty_list; |
- } |
- global_dict = PyModule_GetDict(__pyx_m); |
- if (!global_dict) |
- goto bad; |
- empty_dict = PyDict_New(); |
- if (!empty_dict) |
- goto bad; |
- module = PyObject_CallFunction(__import__, "OOOO", |
- name, global_dict, empty_dict, list); |
-bad: |
- Py_XDECREF(empty_list); |
- Py_XDECREF(__import__); |
- Py_XDECREF(empty_dict); |
- return module; |
-} |
- |
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { |
- PyObject *result; |
- result = PyObject_GetAttr(dict, name); |
- if (!result) |
- PyErr_SetObject(PyExc_NameError, name); |
- return result; |
-} |
- |
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { |
- Py_XINCREF(type); |
- Py_XINCREF(value); |
- Py_XINCREF(tb); |
- /* First, check the traceback argument, replacing None with NULL. */ |
- if (tb == Py_None) { |
- Py_DECREF(tb); |
- tb = 0; |
- } |
- else if (tb != NULL && !PyTraceBack_Check(tb)) { |
- PyErr_SetString(PyExc_TypeError, |
- "raise: arg 3 must be a traceback or None"); |
- goto raise_error; |
- } |
- /* Next, replace a missing value with None */ |
- if (value == NULL) { |
- value = Py_None; |
- Py_INCREF(value); |
- } |
- #if PY_VERSION_HEX < 0x02050000 |
- if (!PyClass_Check(type)) |
- #else |
- if (!PyType_Check(type)) |
- #endif |
- { |
- /* Raising an instance. The value should be a dummy. */ |
- if (value != Py_None) { |
- PyErr_SetString(PyExc_TypeError, |
- "instance exception may not have a separate value"); |
- goto raise_error; |
- } |
- /* Normalize to raise <class>, <instance> */ |
- Py_DECREF(value); |
- value = type; |
- #if PY_VERSION_HEX < 0x02050000 |
- if (PyInstance_Check(type)) { |
- type = (PyObject*) ((PyInstanceObject*)type)->in_class; |
- Py_INCREF(type); |
- } |
- else { |
- PyErr_SetString(PyExc_TypeError, |
- "raise: exception must be an old-style class or instance"); |
- goto raise_error; |
- } |
- #else |
- type = (PyObject*) type->ob_type; |
- Py_INCREF(type); |
- if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { |
- PyErr_SetString(PyExc_TypeError, |
- "raise: exception class must be a subclass of BaseException"); |
- goto raise_error; |
- } |
- #endif |
- } |
- PyErr_Restore(type, value, tb); |
- return; |
-raise_error: |
- Py_XDECREF(value); |
- Py_XDECREF(type); |
- Py_XDECREF(tb); |
- return; |
-} |
- |
-static void __Pyx_UnpackError(void) { |
- PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size"); |
-} |
- |
-static PyObject *__Pyx_UnpackItem(PyObject *iter) { |
- PyObject *item; |
- if (!(item = PyIter_Next(iter))) { |
- if (!PyErr_Occurred()) |
- __Pyx_UnpackError(); |
- } |
- return item; |
-} |
- |
-static int __Pyx_EndUnpack(PyObject *iter) { |
- PyObject *item; |
- if ((item = PyIter_Next(iter))) { |
- Py_DECREF(item); |
- __Pyx_UnpackError(); |
- return -1; |
- } |
- else if (!PyErr_Occurred()) |
- return 0; |
- else |
- return -1; |
-} |
- |
-static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) { |
- while (t->p) { |
- *t->p = PyString_InternFromString(t->s); |
- if (!*t->p) |
- return -1; |
- ++t; |
- } |
- return 0; |
-} |
- |
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { |
- while (t->p) { |
- *t->p = PyString_FromStringAndSize(t->s, t->n - 1); |
- if (!*t->p) |
- return -1; |
- ++t; |
- } |
- return 0; |
-} |
- |
-#include "compile.h" |
-#include "frameobject.h" |
-#include "traceback.h" |
- |
-static void __Pyx_AddTraceback(char *funcname) { |
- PyObject *py_srcfile = 0; |
- PyObject *py_funcname = 0; |
- PyObject *py_globals = 0; |
- PyObject *empty_tuple = 0; |
- PyObject *empty_string = 0; |
- PyCodeObject *py_code = 0; |
- PyFrameObject *py_frame = 0; |
- |
- py_srcfile = PyString_FromString(__pyx_filename); |
- if (!py_srcfile) goto bad; |
- py_funcname = PyString_FromString(funcname); |
- if (!py_funcname) goto bad; |
- py_globals = PyModule_GetDict(__pyx_m); |
- if (!py_globals) goto bad; |
- empty_tuple = PyTuple_New(0); |
- if (!empty_tuple) goto bad; |
- empty_string = PyString_FromString(""); |
- if (!empty_string) goto bad; |
- py_code = PyCode_New( |
- 0, /*int argcount,*/ |
- 0, /*int nlocals,*/ |
- 0, /*int stacksize,*/ |
- 0, /*int flags,*/ |
- empty_string, /*PyObject *code,*/ |
- empty_tuple, /*PyObject *consts,*/ |
- empty_tuple, /*PyObject *names,*/ |
- empty_tuple, /*PyObject *varnames,*/ |
- empty_tuple, /*PyObject *freevars,*/ |
- empty_tuple, /*PyObject *cellvars,*/ |
- py_srcfile, /*PyObject *filename,*/ |
- py_funcname, /*PyObject *name,*/ |
- __pyx_lineno, /*int firstlineno,*/ |
- empty_string /*PyObject *lnotab*/ |
- ); |
- if (!py_code) goto bad; |
- py_frame = PyFrame_New( |
- PyThreadState_Get(), /*PyThreadState *tstate,*/ |
- py_code, /*PyCodeObject *code,*/ |
- py_globals, /*PyObject *globals,*/ |
- 0 /*PyObject *locals*/ |
- ); |
- if (!py_frame) goto bad; |
- py_frame->f_lineno = __pyx_lineno; |
- PyTraceBack_Here(py_frame); |
-bad: |
- Py_XDECREF(py_srcfile); |
- Py_XDECREF(py_funcname); |
- Py_XDECREF(empty_tuple); |
- Py_XDECREF(empty_string); |
- Py_XDECREF(py_code); |
- Py_XDECREF(py_frame); |
-} |