~ubuntu-branches/ubuntu/vivid/python-gevent/vivid

« back to all changes in this revision

Viewing changes to gevent/core.c

  • Committer: Bazaar Package Importer
  • Author(s): Örjan Persson
  • Date: 2011-05-17 16:43:20 UTC
  • mto: (14.1.1 sid)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20110517164320-jyr5vamkqi3jfeab
Tags: upstream-0.13.6
Import upstream version 0.13.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Generated by Cython 0.12.1 on Sat Jul  3 12:18:09 2010 */
 
1
/* Generated by Cython 0.14.1 on Mon May  2 20:02:59 2011 */
2
2
 
3
3
#define PY_SSIZE_T_CLEAN
4
4
#include "Python.h"
5
 
#include "structmember.h"
6
5
#ifndef Py_PYTHON_H
7
6
    #error Python headers needed to compile C extensions, please install development version of Python.
8
7
#else
9
8
 
 
9
#include <stddef.h> /* For offsetof */
 
10
#ifndef offsetof
 
11
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
 
12
#endif
 
13
 
 
14
#if !defined(WIN32) && !defined(MS_WINDOWS)
 
15
  #ifndef __stdcall
 
16
    #define __stdcall
 
17
  #endif
 
18
  #ifndef __cdecl
 
19
    #define __cdecl
 
20
  #endif
 
21
  #ifndef __fastcall
 
22
    #define __fastcall
 
23
  #endif
 
24
#endif
 
25
 
 
26
#ifndef DL_IMPORT
 
27
  #define DL_IMPORT(t) t
 
28
#endif
 
29
#ifndef DL_EXPORT
 
30
  #define DL_EXPORT(t) t
 
31
#endif
 
32
 
10
33
#ifndef PY_LONG_LONG
11
34
  #define PY_LONG_LONG LONG_LONG
12
35
#endif
13
 
#ifndef DL_EXPORT
14
 
  #define DL_EXPORT(t) t
15
 
#endif
 
36
 
16
37
#if PY_VERSION_HEX < 0x02040000
17
38
  #define METH_COEXIST 0
18
39
  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
82
103
 
83
104
#if PY_MAJOR_VERSION >= 3
84
105
  #define PyBaseString_Type            PyUnicode_Type
 
106
  #define PyStringObject               PyUnicodeObject
85
107
  #define PyString_Type                PyUnicode_Type
 
108
  #define PyString_Check               PyUnicode_Check
86
109
  #define PyString_CheckExact          PyUnicode_CheckExact
87
 
#else
 
110
#endif
 
111
 
 
112
#if PY_VERSION_HEX < 0x02060000
 
113
  #define PyBytesObject                PyStringObject
88
114
  #define PyBytes_Type                 PyString_Type
 
115
  #define PyBytes_Check                PyString_Check
89
116
  #define PyBytes_CheckExact           PyString_CheckExact
90
 
#endif
 
117
  #define PyBytes_FromString           PyString_FromString
 
118
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
 
119
  #define PyBytes_FromFormat           PyString_FromFormat
 
120
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
 
121
  #define PyBytes_AsString             PyString_AsString
 
122
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
 
123
  #define PyBytes_Size                 PyString_Size
 
124
  #define PyBytes_AS_STRING            PyString_AS_STRING
 
125
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
 
126
  #define PyBytes_Repr                 PyString_Repr
 
127
  #define PyBytes_Concat               PyString_Concat
 
128
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
 
129
#endif
 
130
 
 
131
#if PY_VERSION_HEX < 0x02060000
 
132
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
 
133
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
 
134
#endif
 
135
#ifndef PySet_CheckExact
 
136
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
 
137
#endif
 
138
 
 
139
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
91
140
 
92
141
#if PY_MAJOR_VERSION >= 3
 
142
  #define PyIntObject                  PyLongObject
93
143
  #define PyInt_Type                   PyLong_Type
94
144
  #define PyInt_Check(op)              PyLong_Check(op)
95
145
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
103
153
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
104
154
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
105
155
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
 
156
#endif
 
157
 
 
158
#if PY_MAJOR_VERSION >= 3
 
159
  #define PyBoolObject                 PyLongObject
 
160
#endif
 
161
 
 
162
 
 
163
#if PY_MAJOR_VERSION >= 3
106
164
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
107
165
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
108
166
#else
109
167
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
110
168
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
 
169
#endif
111
170
 
 
171
#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
 
172
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
 
173
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
 
174
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
 
175
#else
 
176
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
 
177
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
 
178
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
 
179
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
 
180
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
 
181
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
 
182
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
 
183
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
 
184
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
 
185
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
 
186
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
 
187
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
112
188
#endif
113
189
 
114
190
#if PY_MAJOR_VERSION >= 3
115
 
  #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
116
 
#endif
117
 
 
118
 
#if !defined(WIN32) && !defined(MS_WINDOWS)
119
 
  #ifndef __stdcall
120
 
    #define __stdcall
121
 
  #endif
122
 
  #ifndef __cdecl
123
 
    #define __cdecl
124
 
  #endif
125
 
  #ifndef __fastcall
126
 
    #define __fastcall
127
 
  #endif
128
 
#else
129
 
  #define _USE_MATH_DEFINES
 
191
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
130
192
#endif
131
193
 
132
194
#if PY_VERSION_HEX < 0x02050000
146
208
  #define __Pyx_NAMESTR(n) (n)
147
209
  #define __Pyx_DOCSTR(n)  (n)
148
210
#endif
 
211
 
149
212
#ifdef __cplusplus
150
213
#define __PYX_EXTERN_C extern "C"
151
214
#else
152
215
#define __PYX_EXTERN_C extern
153
216
#endif
 
217
 
 
218
#if defined(WIN32) || defined(MS_WINDOWS)
 
219
#define _USE_MATH_DEFINES
 
220
#endif
154
221
#include <math.h>
155
222
#define __PYX_HAVE_API__gevent__core
156
 
#include "libevent-internal.h"
157
223
#include "sys/types.h"
158
224
#include "frameobject.h"
159
225
#include "libevent.h"
160
226
#include "string.h"
161
227
#include "errno.h"
162
228
 
 
229
#ifdef PYREX_WITHOUT_ASSERTIONS
 
230
#define CYTHON_WITHOUT_ASSERTIONS
 
231
#endif
 
232
 
 
233
 
 
234
/* inline attribute */
163
235
#ifndef CYTHON_INLINE
164
236
  #if defined(__GNUC__)
165
237
    #define CYTHON_INLINE __inline__
166
238
  #elif defined(_MSC_VER)
167
239
    #define CYTHON_INLINE __inline
 
240
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
 
241
    #define CYTHON_INLINE inline
168
242
  #else
169
 
    #define CYTHON_INLINE 
 
243
    #define CYTHON_INLINE
170
244
  #endif
171
245
#endif
172
246
 
 
247
/* unused attribute */
 
248
#ifndef CYTHON_UNUSED
 
249
# if defined(__GNUC__)
 
250
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
 
251
#     define CYTHON_UNUSED __attribute__ ((__unused__))
 
252
#   else
 
253
#     define CYTHON_UNUSED
 
254
#   endif
 
255
# elif defined(__ICC) || defined(__INTEL_COMPILER)
 
256
#   define CYTHON_UNUSED __attribute__ ((__unused__))
 
257
# else
 
258
#   define CYTHON_UNUSED
 
259
# endif
 
260
#endif
 
261
 
173
262
typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
174
263
 
175
264
 
176
265
/* Type Conversion Predeclarations */
177
266
 
178
 
#if PY_MAJOR_VERSION < 3
179
 
#define __Pyx_PyBytes_FromString          PyString_FromString
180
 
#define __Pyx_PyBytes_FromStringAndSize   PyString_FromStringAndSize
181
 
#define __Pyx_PyBytes_AsString            PyString_AsString
182
 
#else
183
 
#define __Pyx_PyBytes_FromString          PyBytes_FromString
184
 
#define __Pyx_PyBytes_FromStringAndSize   PyBytes_FromStringAndSize
185
 
#define __Pyx_PyBytes_AsString            PyBytes_AsString
186
 
#endif
187
 
 
188
 
#define __Pyx_PyBytes_FromUString(s)      __Pyx_PyBytes_FromString((char*)s)
189
 
#define __Pyx_PyBytes_AsUString(s)        ((unsigned char*) __Pyx_PyBytes_AsString(s))
 
267
#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
 
268
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
190
269
 
191
270
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
192
271
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
193
272
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
194
273
 
195
 
#if !defined(T_PYSSIZET)
196
 
#if PY_VERSION_HEX < 0x02050000
197
 
#define T_PYSSIZET T_INT
198
 
#elif !defined(T_LONGLONG)
199
 
#define T_PYSSIZET \
200
 
        ((sizeof(Py_ssize_t) == sizeof(int))  ? T_INT  : \
201
 
        ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1))
202
 
#else
203
 
#define T_PYSSIZET \
204
 
        ((sizeof(Py_ssize_t) == sizeof(int))          ? T_INT      : \
205
 
        ((sizeof(Py_ssize_t) == sizeof(long))         ? T_LONG     : \
206
 
        ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1)))
207
 
#endif
208
 
#endif
209
 
 
210
 
 
211
 
#if !defined(T_ULONGLONG)
212
 
#define __Pyx_T_UNSIGNED_INT(x) \
213
 
        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
214
 
        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
215
 
        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
216
 
        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : -1))))
217
 
#else
218
 
#define __Pyx_T_UNSIGNED_INT(x) \
219
 
        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
220
 
        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
221
 
        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
222
 
        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : \
223
 
        ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))))
224
 
#endif
225
 
#if !defined(T_LONGLONG)
226
 
#define __Pyx_T_SIGNED_INT(x) \
227
 
        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
228
 
        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
229
 
        ((sizeof(x) == sizeof(int))   ? T_INT : \
230
 
        ((sizeof(x) == sizeof(long))  ? T_LONG : -1))))
231
 
#else
232
 
#define __Pyx_T_SIGNED_INT(x) \
233
 
        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
234
 
        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
235
 
        ((sizeof(x) == sizeof(int))   ? T_INT : \
236
 
        ((sizeof(x) == sizeof(long))  ? T_LONG : \
237
 
        ((sizeof(x) == sizeof(PY_LONG_LONG))   ? T_LONGLONG : -1)))))
238
 
#endif
239
 
 
240
 
#define __Pyx_T_FLOATING(x) \
241
 
        ((sizeof(x) == sizeof(float)) ? T_FLOAT : \
242
 
        ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1))
243
 
 
244
 
#if !defined(T_SIZET)
245
 
#if !defined(T_ULONGLONG)
246
 
#define T_SIZET \
247
 
        ((sizeof(size_t) == sizeof(unsigned int))  ? T_UINT  : \
248
 
        ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1))
249
 
#else
250
 
#define T_SIZET \
251
 
        ((sizeof(size_t) == sizeof(unsigned int))          ? T_UINT      : \
252
 
        ((sizeof(size_t) == sizeof(unsigned long))         ? T_ULONG     : \
253
 
        ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))
254
 
#endif
255
 
#endif
256
 
 
257
274
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
258
275
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
259
276
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
263
280
 
264
281
#ifdef __GNUC__
265
282
/* Test for GCC > 2.95 */
266
 
#if __GNUC__ > 2 ||               (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) 
 
283
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
267
284
#define likely(x)   __builtin_expect(!!(x), 1)
268
285
#define unlikely(x) __builtin_expect(!!(x), 0)
269
286
#else /* __GNUC__ > 2 ... */
283
300
static int __pyx_clineno = 0;
284
301
static const char * __pyx_cfilenm= __FILE__;
285
302
static const char *__pyx_filename;
286
 
static const char **__pyx_f;
287
 
 
 
303
 
 
304
 
 
305
static const char *__pyx_f[] = {
 
306
  "core.pyx",
 
307
  "evhttp.pxi",
 
308
  "evbuffer.pxi",
 
309
  "evdns.pxi",
 
310
};
288
311
 
289
312
/* Type declarations */
290
313
 
292
315
 
293
316
typedef void *__pyx_t_6gevent_4core_event_base;
294
317
 
295
 
/* "/home/denis/work/gevent/gevent/core.pyx":165
 
318
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":144
 
319
 * 
 
320
 * 
 
321
 * cdef class http_request_base:             # <<<<<<<<<<<<<<
 
322
 *     """Wrapper around libevent's :class:`evhttp_request` structure."""
 
323
 * 
 
324
 */
 
325
 
 
326
struct __pyx_obj_6gevent_4core_http_request_base {
 
327
  PyObject_HEAD
 
328
  PyObject *__weakref__;
 
329
  struct evhttp_request *__pyx___obj;
 
330
  PyObject *_input_buffer;
 
331
  PyObject *_output_buffer;
 
332
};
 
333
 
 
334
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":466
 
335
 * 
 
336
 * 
 
337
 * cdef class http_request_client(http_request_base):             # <<<<<<<<<<<<<<
 
338
 *     """Wrapper around libevent's :class:`evhttp_request` structure."""
 
339
 * 
 
340
 */
 
341
 
 
342
struct __pyx_obj_6gevent_4core_http_request_client {
 
343
  struct __pyx_obj_6gevent_4core_http_request_base __pyx_base;
 
344
  struct __pyx_vtabstruct_6gevent_4core_http_request_client *__pyx_vtab;
 
345
  int _owned;
 
346
  PyObject *callback;
 
347
  int _incref;
 
348
};
 
349
 
 
350
/* "gevent/core.pyx":145
296
351
 * 
297
352
 * 
298
353
 * cdef class event:             # <<<<<<<<<<<<<<
304
359
  PyObject_HEAD
305
360
  struct __pyx_vtabstruct_6gevent_4core_event *__pyx_vtab;
306
361
  struct event ev;
307
 
  PyObject *_callback;
308
 
  PyObject *_arg;
 
362
  PyObject *callback;
 
363
  PyObject *arg;
309
364
  int _incref;
310
365
};
311
366
 
312
 
/* "/home/denis/work/gevent/gevent/core.pyx":413
 
367
/* "gevent/core.pyx":370
313
368
 * 
314
369
 * 
315
370
 * cdef class active_event(event):             # <<<<<<<<<<<<<<
321
376
  struct __pyx_obj_6gevent_4core_event __pyx_base;
322
377
};
323
378
 
324
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":106
325
 
 * 
326
 
 * 
327
 
 * cdef class http_request:             # <<<<<<<<<<<<<<
 
379
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":395
 
380
 * 
 
381
 * 
 
382
 * cdef class http_request(http_request_base):             # <<<<<<<<<<<<<<
328
383
 *     """Wrapper around libevent's :class:`evhttp_request` structure."""
329
384
 * 
330
385
 */
331
386
 
332
387
struct __pyx_obj_6gevent_4core_http_request {
333
 
  PyObject_HEAD
334
 
  PyObject *__weakref__;
335
 
  struct evhttp_request *__pyx___obj;
336
 
  PyObject *_input_buffer;
337
 
  PyObject *_output_buffer;
 
388
  struct __pyx_obj_6gevent_4core_http_request_base __pyx_base;
338
389
  PyObject *default_response_headers;
339
390
};
340
391
 
341
 
/* "/home/denis/work/gevent/gevent/core.pyx":343
 
392
/* "gevent/core.pyx":300
342
393
 * 
343
394
 * 
344
395
 * cdef class read_event(event):             # <<<<<<<<<<<<<<
350
401
  struct __pyx_obj_6gevent_4core_event __pyx_base;
351
402
};
352
403
 
353
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":415
 
404
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":505
354
405
 * 
355
406
 * 
356
407
 * cdef class http_connection:             # <<<<<<<<<<<<<<
361
412
struct __pyx_obj_6gevent_4core_http_connection {
362
413
  PyObject_HEAD
363
414
  struct evhttp_connection *__pyx___obj;
 
415
  int _owned;
364
416
};
365
417
 
366
 
/* "/home/denis/work/gevent/gevent/evbuffer.pxi":20
 
418
/* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":20
367
419
 * 
368
420
 * 
369
421
 * cdef class buffer:             # <<<<<<<<<<<<<<
376
428
  struct evbuffer *__pyx___obj;
377
429
};
378
430
 
379
 
/* "/home/denis/work/gevent/gevent/core.pyx":403
 
431
/* "gevent/core.pyx":360
380
432
 * 
381
433
 * 
382
434
 * cdef class signal(event):             # <<<<<<<<<<<<<<
388
440
  struct __pyx_obj_6gevent_4core_event __pyx_base;
389
441
};
390
442
 
391
 
/* "/home/denis/work/gevent/gevent/core.pyx":393
 
443
/* "gevent/core.pyx":350
392
444
 * 
393
445
 * 
394
446
 * cdef class timer(event):             # <<<<<<<<<<<<<<
400
452
  struct __pyx_obj_6gevent_4core_event __pyx_base;
401
453
};
402
454
 
403
 
/* "/home/denis/work/gevent/gevent/core.pyx":354
 
455
/* "gevent/core.pyx":311
404
456
 * 
405
457
 * 
406
458
 * cdef class write_event(event):             # <<<<<<<<<<<<<<
412
464
  struct __pyx_obj_6gevent_4core_event __pyx_base;
413
465
};
414
466
 
415
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":508
 
467
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":658
416
468
 * 
417
469
 * 
418
470
 * cdef class http:             # <<<<<<<<<<<<<<
429
481
};
430
482
 
431
483
 
432
 
/* "/home/denis/work/gevent/gevent/core.pyx":165
 
484
/* "gevent/core.pyx":145
433
485
 * 
434
486
 * 
435
487
 * cdef class event:             # <<<<<<<<<<<<<<
444
496
static struct __pyx_vtabstruct_6gevent_4core_event *__pyx_vtabptr_6gevent_4core_event;
445
497
 
446
498
 
447
 
/* "/home/denis/work/gevent/gevent/core.pyx":343
 
499
/* "gevent/core.pyx":300
448
500
 * 
449
501
 * 
450
502
 * cdef class read_event(event):             # <<<<<<<<<<<<<<
458
510
static struct __pyx_vtabstruct_6gevent_4core_read_event *__pyx_vtabptr_6gevent_4core_read_event;
459
511
 
460
512
 
461
 
/* "/home/denis/work/gevent/gevent/core.pyx":413
 
513
/* "gevent/core.pyx":370
462
514
 * 
463
515
 * 
464
516
 * cdef class active_event(event):             # <<<<<<<<<<<<<<
472
524
static struct __pyx_vtabstruct_6gevent_4core_active_event *__pyx_vtabptr_6gevent_4core_active_event;
473
525
 
474
526
 
475
 
/* "/home/denis/work/gevent/gevent/core.pyx":354
 
527
/* "gevent/core.pyx":311
476
528
 * 
477
529
 * 
478
530
 * cdef class write_event(event):             # <<<<<<<<<<<<<<
486
538
static struct __pyx_vtabstruct_6gevent_4core_write_event *__pyx_vtabptr_6gevent_4core_write_event;
487
539
 
488
540
 
489
 
/* "/home/denis/work/gevent/gevent/core.pyx":393
 
541
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":466
 
542
 * 
 
543
 * 
 
544
 * cdef class http_request_client(http_request_base):             # <<<<<<<<<<<<<<
 
545
 *     """Wrapper around libevent's :class:`evhttp_request` structure."""
 
546
 * 
 
547
 */
 
548
 
 
549
struct __pyx_vtabstruct_6gevent_4core_http_request_client {
 
550
  PyObject *(*_addref)(struct __pyx_obj_6gevent_4core_http_request_client *);
 
551
  PyObject *(*_delref)(struct __pyx_obj_6gevent_4core_http_request_client *);
 
552
};
 
553
static struct __pyx_vtabstruct_6gevent_4core_http_request_client *__pyx_vtabptr_6gevent_4core_http_request_client;
 
554
 
 
555
 
 
556
/* "gevent/core.pyx":350
490
557
 * 
491
558
 * 
492
559
 * cdef class timer(event):             # <<<<<<<<<<<<<<
500
567
static struct __pyx_vtabstruct_6gevent_4core_timer *__pyx_vtabptr_6gevent_4core_timer;
501
568
 
502
569
 
503
 
/* "/home/denis/work/gevent/gevent/core.pyx":403
 
570
/* "gevent/core.pyx":360
504
571
 * 
505
572
 * 
506
573
 * cdef class signal(event):             # <<<<<<<<<<<<<<
559
626
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
560
627
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
561
628
 
 
629
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
 
630
 
562
631
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
563
632
 
564
633
static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
565
634
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
566
635
 
567
 
static void __Pyx_RaiseDoubleKeywordsError(
568
 
    const char* func_name, PyObject* kw_name); /*proto*/
569
 
 
570
636
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
571
637
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
572
638
 
 
639
static void __Pyx_RaiseDoubleKeywordsError(
 
640
    const char* func_name, PyObject* kw_name); /*proto*/
 
641
 
573
642
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
574
643
 
575
644
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
576
645
 
577
 
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void);
 
646
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
578
647
 
579
648
static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
580
 
static int __Pyx_EndUnpack(PyObject *); /*proto*/
 
649
static int __Pyx_EndUnpack(PyObject *, Py_ssize_t expected); /*proto*/
 
650
 
 
651
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
 
652
 
 
653
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
 
654
    const char* function_name, int kw_allowed); /*proto*/
 
655
 
 
656
static PyObject* __Pyx_PyEval_CallObjectWithKeywords(PyObject*, PyObject*, PyObject*); /*proto*/
581
657
 
582
658
static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
583
659
    if (likely(PyList_CheckExact(L))) {
595
671
    }
596
672
}
597
673
 
598
 
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
599
 
    const char* function_name, int kw_allowed); /*proto*/
600
 
 
601
 
static PyObject* __Pyx_PyEval_CallObjectWithKeywords(PyObject*, PyObject*, PyObject*); /*proto*/
 
674
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
 
675
    const char *name, int exact); /*proto*/
602
676
 
603
677
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
604
678
 
605
 
#define __Pyx_SetItemInt(o, i, v, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
606
 
                                                    __Pyx_SetItemInt_Fast(o, i, v, size <= sizeof(long)) : \
 
679
#define __Pyx_SetItemInt(o, i, v, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
 
680
                                                    __Pyx_SetItemInt_Fast(o, i, v) : \
607
681
                                                    __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
608
682
 
609
683
static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
614
688
    return r;
615
689
}
616
690
 
617
 
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int fits_long) {
 
691
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v) {
618
692
    if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
619
693
        Py_INCREF(v);
620
694
        Py_DECREF(PyList_GET_ITEM(o, i));
624
698
    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0)))
625
699
        return PySequence_SetItem(o, i, v);
626
700
    else {
627
 
        PyObject *j = fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i);
 
701
        PyObject *j = PyInt_FromSsize_t(i);
628
702
        return __Pyx_SetItemInt_Generic(o, j, v);
629
703
    }
630
704
}
634
708
 
635
709
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
636
710
 
637
 
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); /*proto*/
638
 
 
639
 
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
640
 
 
641
 
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
 
711
static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/
 
712
 
 
713
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
 
714
                                   PyObject *modname); /*proto*/
 
715
 
 
716
#define __pyx_binding_PyCFunctionType_USED 1
 
717
 
 
718
typedef struct {
 
719
    PyCFunctionObject func;
 
720
} __pyx_binding_PyCFunctionType_object;
 
721
 
 
722
static PyTypeObject __pyx_binding_PyCFunctionType_type;
 
723
static PyTypeObject *__pyx_binding_PyCFunctionType = NULL;
 
724
 
 
725
static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module); /* proto */
 
726
#define __pyx_binding_PyCFunctionType_New(ml, self) __pyx_binding_PyCFunctionType_NewEx(ml, self, NULL)
 
727
 
 
728
static int __pyx_binding_PyCFunctionType_init(void); /* proto */
 
729
 
 
730
#include "descrobject.h"
 
731
static PyObject* __Pyx_Method_ClassMethod(PyObject *method); /*proto*/
642
732
 
643
733
#ifndef __PYX_FORCE_INIT_THREADS
644
734
  #if PY_VERSION_HEX < 0x02040200
668
758
 
669
759
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
670
760
 
 
761
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
 
762
 
671
763
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
672
764
 
673
765
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
696
788
static PyTypeObject *__pyx_ptype_6gevent_4core_signal = 0;
697
789
static PyTypeObject *__pyx_ptype_6gevent_4core_active_event = 0;
698
790
static PyTypeObject *__pyx_ptype_6gevent_4core_buffer = 0;
 
791
static PyTypeObject *__pyx_ptype_6gevent_4core_http_request_base = 0;
699
792
static PyTypeObject *__pyx_ptype_6gevent_4core_http_request = 0;
 
793
static PyTypeObject *__pyx_ptype_6gevent_4core_http_request_client = 0;
700
794
static PyTypeObject *__pyx_ptype_6gevent_4core_http_connection = 0;
701
795
static PyTypeObject *__pyx_ptype_6gevent_4core_http = 0;
702
796
static void __pyx_f_6gevent_4core___event_handler(int, short, void *); /*proto*/
703
797
static void __pyx_f_6gevent_4core___simple_handler(int, short, void *); /*proto*/
704
798
static void __pyx_f_6gevent_4core___evdns_callback(int, char, int, int, void *, void *); /*proto*/
 
799
static void __pyx_f_6gevent_4core__http_request_cb_handler(struct evhttp_request *, void *); /*proto*/
705
800
static void __pyx_f_6gevent_4core__http_cb_handler(struct evhttp_request *, void *); /*proto*/
706
801
static void __pyx_f_6gevent_4core__http_closecb_handler(struct evhttp_connection *, void *); /*proto*/
707
802
static void __pyx_f_6gevent_4core__http_cb_reply_error(struct evhttp_request *, void *); /*proto*/
708
803
static void __pyx_f_6gevent_4core_report_internal_error(struct evhttp_request *); /*proto*/
709
804
#define __Pyx_MODULE_NAME "gevent.core"
710
 
int __pyx_module_is_main_gevent__core = 0;
 
805
static int __pyx_module_is_main_gevent__core = 0;
711
806
 
712
807
/* Implementation of gevent.core */
713
808
static PyObject *__pyx_builtin_UserWarning;
718
813
static PyObject *__pyx_builtin_id;
719
814
static PyObject *__pyx_builtin_NotImplementedError;
720
815
static PyObject *__pyx_builtin_StopIteration;
721
 
static PyObject *__pyx_builtin_min;
722
816
static PyObject *__pyx_builtin_Exception;
 
817
static PyObject *__pyx_builtin_RuntimeError;
723
818
static PyObject *__pyx_builtin_TypeError;
724
 
static PyObject *__pyx_builtin_RuntimeError;
725
819
static char __pyx_k_1[] = "Failed to execute callback for %s\n\n";
726
820
static char __pyx_k_2[] = "|";
727
821
static char __pyx_k_3[] = "Negative timeouts are deprecated. Use None to disable timeout.";
738
832
static char __pyx_k_18[] = "evdns_resolve_reverse(%r, %r) returned %s";
739
833
static char __pyx_k_19[] = "evdns_resolve_reverse_ipv6(%r, %r) returned %s";
740
834
static char __pyx_k_20[] = "evbuffer_drain(0x%x, %s) returned %s\n";
741
 
static char __pyx_k_21[] = "default_response_headers";
 
835
static char __pyx_k_21[] = "evbuffer_add() returned %s";
742
836
static char __pyx_k_22[] = "\"%s %s HTTP/%s.%s\" %s:%s";
743
837
static char __pyx_k_23[] = " response=%s";
744
838
static char __pyx_k_24[] = " input=%s";
746
840
static char __pyx_k_26[] = "<Error>";
747
841
static char __pyx_k_27[] = "<%s %s>";
748
842
static char __pyx_k_28[] = "<%s _obj=0x%x %s>";
749
 
static char __pyx_k_29[] = "_add_default_response_headers";
750
 
static char __pyx_k_30[] = "Expected str or buffer: %r";
751
 
static char __pyx_k_31[] = "Internal error in evhttp_add_header";
752
 
static char __pyx_k_32[] = "HttpConnectionDeleted";
753
 
static char __pyx_k_33[] = "<%s _obj=0x%x%s>";
754
 
static char __pyx_k_34[] = "%s: Failed to handle request: %s\n\n";
755
 
static char __pyx_k_35[] = "Content-type";
756
 
static char __pyx_k_36[] = "text/plain";
757
 
static char __pyx_k_37[] = "Content-length";
758
 
static char __pyx_k_38[] = "Internal Server Error";
759
 
static char __pyx_k_39[] = "127.0.0.1";
760
 
static char __pyx_k_40[] = "evhttp_bind_socket(%r, %r) returned %r";
761
 
static char __pyx_k_41[] = "evhttp_accept_socket(%r) returned %r";
762
 
static char __pyx_k_42[] = "User callback that will be called once the event is signalled.\n\n        The prototype: ``callback(event instance, evtype)``.\n        ";
763
 
static char __pyx_k_43[] = "Optional object set and read only by the user.";
764
 
static char __pyx_k_44[] = "Return True if the event is still scheduled to run.";
765
 
static char __pyx_k_45[] = "Wrappers around libevent API.\n\nThis module provides a mechanism to execute a function when a\nspecific event on a file handle, file descriptor, or signal occurs,\nor after a given time has passed. It also provides wrappers around\nstructures and functions from libevent-dns and libevent-http.\n\nThis module does not work with the greenlets. A callback passed\nto a method from this module will be executed in the event loop,\nwhich is running in the :class:`Hub <gevent.hub.Hub>` greenlet.\nTherefore it must not use any synchronous gevent API,\nthat is, the functions that switch to the Hub. It's OK to call asynchronous\nstuff like :func:`gevent.spawn`, :meth:`Event.set <gevent.event.Event.set` or\n:meth:`Queue.put_nowait <gevent.queue.Queue.put_nowait>`.\n\nThe code is based on pyevent_.\n\n.. _pyevent: http://code.google.com/p/pyevent/\n";
766
 
static char __pyx_k_46[] = "Dug Song <dugsong@monkey.org>";
767
 
static char __pyx_k_47[] = "Martin Murray <mmurray@monkey.org>";
768
 
static char __pyx_k_48[] = "Copyright (c) 2004 Dug Song";
769
 
static char __pyx_k_49[] = "Copyright (c) 2003 Martin Murray";
770
 
static char __pyx_k_50[] = "http://monkey.org/~dugsong/pyevent/";
771
 
static char __pyx_k_51[] = "0.4+";
772
 
static char __pyx_k_52[] = "Create a new scheduled event with evtype=EV_READ|EV_WRITE";
773
 
static char __pyx_k_53[] = "dns_resolve_reverse_ipv6";
774
 
static char __pyx_k_54[] = "DNS_ERR_SERVERFAILED";
775
 
static char __pyx_k_55[] = "1.3.99-trunk";
776
 
static char __pyx_k_56[] = "libevent version mismatch: system version is %r but this gevent is compiled against %r";
777
 
static char __pyx_k_57[] = "Raised when an attribute is accessed of http_request instance whose _obj is 0";
778
 
static char __pyx_k_58[] = "Raised when an attribute is accessed of http_connection instance whose _obj is 0";
779
 
static char __pyx_k_59[] = "event.add (line 273)";
780
 
static char __pyx_k_60[] = "event.cancel (line 300)";
781
 
static char __pyx_k_61[] = "init (line 427)";
782
 
static char __pyx_k_62[] = "dispatch (line 432)";
783
 
static char __pyx_k_63[] = "loop (line 445)";
784
 
static char __pyx_k_64[] = "get_version (line 461)";
785
 
static char __pyx_k_65[] = "get_method (line 466)";
786
 
static char __pyx_k_66[] = "get_header_version (line 479)";
787
 
static char __pyx_k_67[] = "reinit (line 490)";
788
 
static char __pyx_k_68[] = "dns_init (line 40)";
789
 
static char __pyx_k_69[] = "dns_shutdown (line 45)";
790
 
static char __pyx_k_70[] = "dns_resolve_ipv4 (line 84)";
791
 
static char __pyx_k_71[] = "dns_resolve_ipv6 (line 97)";
792
 
static char __pyx_k_72[] = "dns_resolve_reverse (line 110)";
793
 
static char __pyx_k_73[] = "dns_resolve_reverse_ipv6 (line 123)";
794
 
static char __pyx_k_74[] = "buffer.read (line 57)";
795
 
static char __pyx_k_75[] = "http_request.remove_input_header (line 392)";
796
 
static char __pyx_k_76[] = "http_request.remove_output_header (line 398)";
797
 
static char __pyx_k_77[] = "remove_output_header";
 
843
static char __pyx_k_29[] = "Internal error in evhttp_add_header";
 
844
static char __pyx_k_32[] = "default_response_headers";
 
845
static char __pyx_k_34[] = "_add_default_response_headers";
 
846
static char __pyx_k_35[] = "Expected str or buffer: %r";
 
847
static char __pyx_k_36[] = "evhttp_request_new() failed";
 
848
static char __pyx_k_38[] = "HttpConnectionDeleted";
 
849
static char __pyx_k_39[] = "<%s _obj=0x%x%s>";
 
850
static char __pyx_k_40[] = "Internal error in evhttp\n";
 
851
static char __pyx_k_42[] = "Failed to execute callback for evhttp request.\n";
 
852
static char __pyx_k_44[] = "%s: Failed to handle request: %s\n\n";
 
853
static char __pyx_k_45[] = "Content-type";
 
854
static char __pyx_k_46[] = "text/plain";
 
855
static char __pyx_k_47[] = "Content-length";
 
856
static char __pyx_k_48[] = "Internal Server Error";
 
857
static char __pyx_k_49[] = "127.0.0.1";
 
858
static char __pyx_k_50[] = "evhttp_bind_socket(%r, %r) returned %r";
 
859
static char __pyx_k_51[] = "evhttp_accept_socket(%r) returned %r";
 
860
static char __pyx_k_52[] = "Return True if the event is still scheduled to run.";
 
861
static char __pyx_k_53[] = "Wrappers around libevent API.\n\nThis module provides a mechanism to execute a function when a\nspecific event on a file handle, file descriptor, or signal occurs,\nor after a given time has passed. It also provides wrappers around\nstructures and functions from libevent-dns and libevent-http.\n\nThis module does not work with the greenlets. A callback passed\nto a method from this module will be executed in the event loop,\nwhich is running in the :class:`Hub <gevent.hub.Hub>` greenlet.\nTherefore it must not use any synchronous gevent API,\nthat is, the functions that switch to the Hub. It's OK to call asynchronous\nstuff like :func:`gevent.spawn`, :meth:`Event.set <gevent.event.Event.set` or\n:meth:`Queue.put_nowait <gevent.queue.Queue.put_nowait>`.\n\nThe code is based on pyevent_.\n\n.. _pyevent: http://code.google.com/p/pyevent/\n";
 
862
static char __pyx_k_54[] = "Dug Song <dugsong@monkey.org>";
 
863
static char __pyx_k_55[] = "Martin Murray <mmurray@monkey.org>";
 
864
static char __pyx_k_57[] = "Copyright (c) 2004 Dug Song";
 
865
static char __pyx_k_58[] = "Copyright (c) 2003 Martin Murray";
 
866
static char __pyx_k_60[] = "http://monkey.org/~dugsong/pyevent/";
 
867
static char __pyx_k_61[] = "0.4+";
 
868
static char __pyx_k_62[] = "gevent.core";
 
869
static char __pyx_k_63[] = "Create a new scheduled event with evtype=EV_READ|EV_WRITE";
 
870
static char __pyx_k_64[] = "dns_resolve_reverse_ipv6";
 
871
static char __pyx_k_65[] = "DNS_ERR_SERVERFAILED";
 
872
static char __pyx_k_66[] = "1.3.99-trunk";
 
873
static char __pyx_k_67[] = "libevent version mismatch: system version is %r but this gevent is compiled against %r";
 
874
static char __pyx_k_68[] = "Raised when an attribute is accessed of http_request instance whose _obj is 0";
 
875
static char __pyx_k_69[] = "Raised when an attribute is accessed of http_connection instance whose _obj is 0";
798
876
static char __pyx_k__21[] = "21";
799
877
static char __pyx_k__ev[] = "ev";
800
878
static char __pyx_k__fd[] = "fd";
801
879
static char __pyx_k__id[] = "id";
802
 
static char __pyx_k__tb[] = "tb";
803
880
static char __pyx_k__BSD[] = "BSD";
804
881
static char __pyx_k__GET[] = "GET";
805
882
static char __pyx_k__PUT[] = "PUT";
809
886
static char __pyx_k__get[] = "get";
810
887
static char __pyx_k__hex[] = "hex";
811
888
static char __pyx_k__key[] = "key";
812
 
static char __pyx_k__min[] = "min";
813
889
static char __pyx_k__msg[] = "msg";
 
890
static char __pyx_k__new[] = "new";
 
891
static char __pyx_k__obj[] = "obj";
814
892
static char __pyx_k__pop[] = "pop";
 
893
static char __pyx_k__req[] = "req";
815
894
static char __pyx_k__sys[] = "sys";
816
 
static char __pyx_k__typ[] = "typ";
817
895
static char __pyx_k__uri[] = "uri";
818
896
static char __pyx_k__HEAD[] = "HEAD";
819
897
static char __pyx_k__INIT[] = "INIT";
820
898
static char __pyx_k__POST[] = "POST";
821
899
static char __pyx_k__READ[] = "READ";
822
 
static char __pyx_k___arg[] = "_arg";
823
900
static char __pyx_k___obj[] = "_obj";
824
901
static char __pyx_k__code[] = "code";
825
902
static char __pyx_k__hint[] = "hint";
832
909
static char __pyx_k__name[] = "name";
833
910
static char __pyx_k__peer[] = "peer";
834
911
static char __pyx_k__port[] = "port";
835
 
static char __pyx_k__read[] = "read";
836
912
static char __pyx_k__self[] = "self";
837
913
static char __pyx_k__size[] = "size";
838
914
static char __pyx_k__type[] = "type";
839
915
static char __pyx_k__warn[] = "warn";
 
916
static char __pyx_k__PATCH[] = "PATCH";
 
917
static char __pyx_k__TRACE[] = "TRACE";
840
918
static char __pyx_k__WRITE[] = "WRITE";
841
919
static char __pyx_k____obj[] = "__obj";
842
920
static char __pyx_k__close[] = "close";
844
922
static char __pyx_k__evcon[] = "evcon";
845
923
static char __pyx_k__event[] = "event";
846
924
static char __pyx_k__flags[] = "flags";
 
925
static char __pyx_k__lower[] = "lower";
847
926
static char __pyx_k__major[] = "major";
848
927
static char __pyx_k__minor[] = "minor";
 
928
static char __pyx_k__owned[] = "owned";
849
929
static char __pyx_k__timer[] = "timer";
850
930
static char __pyx_k__value[] = "value";
851
931
static char __pyx_k__write[] = "write";
852
932
static char __pyx_k__ACTIVE[] = "ACTIVE";
853
933
static char __pyx_k__DELETE[] = "DELETE";
854
934
static char __pyx_k__SIGNAL[] = "SIGNAL";
 
935
static char __pyx_k___owned[] = "_owned";
 
936
static char __pyx_k__append[] = "append";
855
937
static char __pyx_k__buffer[] = "buffer";
856
938
static char __pyx_k__cancel[] = "cancel";
857
939
static char __pyx_k__detach[] = "detach";
864
946
static char __pyx_k__signal[] = "signal";
865
947
static char __pyx_k__stderr[] = "stderr";
866
948
static char __pyx_k__tv_sec[] = "tv_sec";
 
949
static char __pyx_k__CONNECT[] = "CONNECT";
867
950
static char __pyx_k__DNS_PTR[] = "DNS_PTR";
868
951
static char __pyx_k__IOError[] = "IOError";
 
952
static char __pyx_k__OPTIONS[] = "OPTIONS";
869
953
static char __pyx_k__PERSIST[] = "PERSIST";
870
954
static char __pyx_k__TIMEOUT[] = "TIMEOUT";
871
955
static char __pyx_k____all__[] = "__all__";
903
987
static char __pyx_k__Exception[] = "Exception";
904
988
static char __pyx_k__TypeError[] = "TypeError";
905
989
static char __pyx_k____class__[] = "__class__";
906
 
static char __pyx_k___callback[] = "_callback";
907
990
static char __pyx_k___requests[] = "_requests";
908
991
static char __pyx_k__ev_events[] = "ev_events";
909
992
static char __pyx_k__exc_clear[] = "exc_clear";
933
1016
static char __pyx_k__dns_shutdown[] = "dns_shutdown";
934
1017
static char __pyx_k__http_request[] = "http_request";
935
1018
static char __pyx_k__input_buffer[] = "input_buffer";
 
1019
static char __pyx_k__set_exc_info[] = "set_exc_info";
936
1020
static char __pyx_k__DNS_IPv6_AAAA[] = "DNS_IPv6_AAAA";
937
1021
static char __pyx_k__ObjectDeleted[] = "ObjectDeleted";
938
1022
static char __pyx_k__StopIteration[] = "StopIteration";
961
1045
static char __pyx_k__readwrite_event[] = "readwrite_event";
962
1046
static char __pyx_k__DNS_ERR_NOTEXIST[] = "DNS_ERR_NOTEXIST";
963
1047
static char __pyx_k__DNS_ERR_SHUTDOWN[] = "DNS_ERR_SHUTDOWN";
 
1048
static char __pyx_k__EVHTTP_REQ_PATCH[] = "EVHTTP_REQ_PATCH";
 
1049
static char __pyx_k__EVHTTP_REQ_TRACE[] = "EVHTTP_REQ_TRACE";
964
1050
static char __pyx_k__HTTP_method2name[] = "HTTP_method2name";
965
1051
static char __pyx_k__dns_resolve_ipv4[] = "dns_resolve_ipv4";
966
1052
static char __pyx_k__dns_resolve_ipv6[] = "dns_resolve_ipv6";
970
1056
static char __pyx_k__add_output_header[] = "add_output_header";
971
1057
static char __pyx_k__dns_err_to_string[] = "dns_err_to_string";
972
1058
static char __pyx_k__DeprecationWarning[] = "DeprecationWarning";
 
1059
static char __pyx_k__EVHTTP_REQ_CONNECT[] = "EVHTTP_REQ_CONNECT";
 
1060
static char __pyx_k__EVHTTP_REQ_OPTIONS[] = "EVHTTP_REQ_OPTIONS";
973
1061
static char __pyx_k__HttpRequestDeleted[] = "HttpRequestDeleted";
974
1062
static char __pyx_k__find_output_header[] = "find_output_header";
975
1063
static char __pyx_k__get_header_version[] = "get_header_version";
977
1065
static char __pyx_k__DNS_QUERY_NO_SEARCH[] = "DNS_QUERY_NO_SEARCH";
978
1066
static char __pyx_k__NotImplementedError[] = "NotImplementedError";
979
1067
static char __pyx_k__dns_resolve_reverse[] = "dns_resolve_reverse";
980
 
static char __pyx_k__remove_input_header[] = "remove_input_header";
981
1068
static PyObject *__pyx_kp_s_1;
982
1069
static PyObject *__pyx_kp_s_10;
983
1070
static PyObject *__pyx_kp_s_11;
987
1074
static PyObject *__pyx_kp_s_19;
988
1075
static PyObject *__pyx_kp_s_2;
989
1076
static PyObject *__pyx_kp_s_20;
990
 
static PyObject *__pyx_n_s_21;
 
1077
static PyObject *__pyx_kp_s_21;
991
1078
static PyObject *__pyx_kp_s_22;
992
1079
static PyObject *__pyx_kp_s_23;
993
1080
static PyObject *__pyx_kp_s_24;
995
1082
static PyObject *__pyx_kp_s_26;
996
1083
static PyObject *__pyx_kp_s_27;
997
1084
static PyObject *__pyx_kp_s_28;
998
 
static PyObject *__pyx_n_s_29;
 
1085
static PyObject *__pyx_kp_s_29;
999
1086
static PyObject *__pyx_kp_s_3;
1000
 
static PyObject *__pyx_kp_s_30;
1001
 
static PyObject *__pyx_kp_s_31;
1002
1087
static PyObject *__pyx_n_s_32;
1003
 
static PyObject *__pyx_kp_s_33;
1004
 
static PyObject *__pyx_kp_s_34;
 
1088
static PyObject *__pyx_n_s_34;
 
1089
static PyObject *__pyx_kp_s_35;
 
1090
static PyObject *__pyx_kp_s_36;
 
1091
static PyObject *__pyx_n_s_38;
 
1092
static PyObject *__pyx_kp_s_39;
1005
1093
static PyObject *__pyx_kp_s_4;
1006
1094
static PyObject *__pyx_kp_s_40;
1007
 
static PyObject *__pyx_kp_s_41;
1008
 
static PyObject *__pyx_kp_s_46;
1009
 
static PyObject *__pyx_kp_s_47;
1010
 
static PyObject *__pyx_kp_s_48;
1011
 
static PyObject *__pyx_kp_s_49;
 
1095
static PyObject *__pyx_kp_s_42;
 
1096
static PyObject *__pyx_kp_s_44;
1012
1097
static PyObject *__pyx_kp_s_5;
1013
1098
static PyObject *__pyx_kp_s_50;
1014
1099
static PyObject *__pyx_kp_s_51;
1015
 
static PyObject *__pyx_kp_s_52;
1016
 
static PyObject *__pyx_n_s_53;
1017
 
static PyObject *__pyx_n_s_54;
 
1100
static PyObject *__pyx_kp_s_54;
1018
1101
static PyObject *__pyx_kp_s_55;
1019
 
static PyObject *__pyx_kp_s_56;
1020
1102
static PyObject *__pyx_kp_s_57;
1021
1103
static PyObject *__pyx_kp_s_58;
1022
 
static PyObject *__pyx_kp_u_59;
1023
1104
static PyObject *__pyx_kp_s_6;
1024
 
static PyObject *__pyx_kp_u_60;
1025
 
static PyObject *__pyx_kp_u_61;
1026
 
static PyObject *__pyx_kp_u_62;
1027
 
static PyObject *__pyx_kp_u_63;
1028
 
static PyObject *__pyx_kp_u_64;
1029
 
static PyObject *__pyx_kp_u_65;
1030
 
static PyObject *__pyx_kp_u_66;
1031
 
static PyObject *__pyx_kp_u_67;
1032
 
static PyObject *__pyx_kp_u_68;
1033
 
static PyObject *__pyx_kp_u_69;
 
1105
static PyObject *__pyx_kp_s_60;
 
1106
static PyObject *__pyx_kp_s_61;
 
1107
static PyObject *__pyx_n_s_62;
 
1108
static PyObject *__pyx_kp_s_63;
 
1109
static PyObject *__pyx_n_s_64;
 
1110
static PyObject *__pyx_n_s_65;
 
1111
static PyObject *__pyx_kp_s_66;
 
1112
static PyObject *__pyx_kp_s_67;
 
1113
static PyObject *__pyx_kp_s_68;
 
1114
static PyObject *__pyx_kp_s_69;
1034
1115
static PyObject *__pyx_kp_s_7;
1035
 
static PyObject *__pyx_kp_u_70;
1036
 
static PyObject *__pyx_kp_u_71;
1037
 
static PyObject *__pyx_kp_u_72;
1038
 
static PyObject *__pyx_kp_u_73;
1039
 
static PyObject *__pyx_kp_u_74;
1040
 
static PyObject *__pyx_kp_u_75;
1041
 
static PyObject *__pyx_kp_u_76;
1042
 
static PyObject *__pyx_n_s_77;
1043
1116
static PyObject *__pyx_kp_s_8;
1044
1117
static PyObject *__pyx_kp_s_9;
1045
1118
static PyObject *__pyx_n_s__ACTIVE;
1046
1119
static PyObject *__pyx_n_s__AttributeError;
1047
1120
static PyObject *__pyx_n_s__BSD;
 
1121
static PyObject *__pyx_n_s__CONNECT;
1048
1122
static PyObject *__pyx_n_s__DELETE;
1049
1123
static PyObject *__pyx_n_s__DNS_ERR_FORMAT;
1050
1124
static PyObject *__pyx_n_s__DNS_ERR_NONE;
1061
1135
static PyObject *__pyx_n_s__DNS_QUERY_NO_SEARCH;
1062
1136
static PyObject *__pyx_n_s__DeprecationWarning;
1063
1137
static PyObject *__pyx_n_s__EVHTTP_REQUEST;
 
1138
static PyObject *__pyx_n_s__EVHTTP_REQ_CONNECT;
1064
1139
static PyObject *__pyx_n_s__EVHTTP_REQ_DELETE;
1065
1140
static PyObject *__pyx_n_s__EVHTTP_REQ_GET;
1066
1141
static PyObject *__pyx_n_s__EVHTTP_REQ_HEAD;
 
1142
static PyObject *__pyx_n_s__EVHTTP_REQ_OPTIONS;
 
1143
static PyObject *__pyx_n_s__EVHTTP_REQ_PATCH;
1067
1144
static PyObject *__pyx_n_s__EVHTTP_REQ_POST;
1068
1145
static PyObject *__pyx_n_s__EVHTTP_REQ_PUT;
 
1146
static PyObject *__pyx_n_s__EVHTTP_REQ_TRACE;
1069
1147
static PyObject *__pyx_n_s__EVHTTP_RESPONSE;
1070
1148
static PyObject *__pyx_n_s__Exception;
1071
1149
static PyObject *__pyx_n_s__GET;
1077
1155
static PyObject *__pyx_n_s__INTERNAL;
1078
1156
static PyObject *__pyx_n_s__IOError;
1079
1157
static PyObject *__pyx_n_s__NotImplementedError;
 
1158
static PyObject *__pyx_n_s__OPTIONS;
1080
1159
static PyObject *__pyx_n_s__ObjectDeleted;
 
1160
static PyObject *__pyx_n_s__PATCH;
1081
1161
static PyObject *__pyx_n_s__PERSIST;
1082
1162
static PyObject *__pyx_n_s__POST;
1083
1163
static PyObject *__pyx_n_s__PUT;
1086
1166
static PyObject *__pyx_n_s__SIGNAL;
1087
1167
static PyObject *__pyx_n_s__StopIteration;
1088
1168
static PyObject *__pyx_n_s__TIMEOUT;
 
1169
static PyObject *__pyx_n_s__TRACE;
1089
1170
static PyObject *__pyx_n_s__TypeError;
1090
1171
static PyObject *__pyx_n_s__UserWarning;
1091
1172
static PyObject *__pyx_n_s__WRITE;
1103
1184
static PyObject *__pyx_n_s____url__;
1104
1185
static PyObject *__pyx_n_s____version__;
1105
1186
static PyObject *__pyx_n_s___addref;
1106
 
static PyObject *__pyx_n_s___arg;
1107
 
static PyObject *__pyx_n_s___callback;
1108
1187
static PyObject *__pyx_n_s___delref;
1109
1188
static PyObject *__pyx_n_s___format;
1110
1189
static PyObject *__pyx_n_s___incref;
1111
1190
static PyObject *__pyx_n_s___input_buffer;
1112
1191
static PyObject *__pyx_n_s___obj;
1113
1192
static PyObject *__pyx_n_s___output_buffer;
 
1193
static PyObject *__pyx_n_s___owned;
1114
1194
static PyObject *__pyx_n_s___requests;
1115
1195
static PyObject *__pyx_n_s__active_event;
1116
1196
static PyObject *__pyx_n_s__add;
1117
1197
static PyObject *__pyx_n_s__add_output_header;
1118
1198
static PyObject *__pyx_n_s__address;
 
1199
static PyObject *__pyx_n_s__append;
1119
1200
static PyObject *__pyx_n_s__arg;
1120
1201
static PyObject *__pyx_n_s__buf;
1121
1202
static PyObject *__pyx_n_s__buffer;
1169
1250
static PyObject *__pyx_n_s__keys;
1170
1251
static PyObject *__pyx_n_s__kind;
1171
1252
static PyObject *__pyx_n_s__loop;
 
1253
static PyObject *__pyx_n_s__lower;
1172
1254
static PyObject *__pyx_n_s__major;
1173
 
static PyObject *__pyx_n_s__min;
1174
1255
static PyObject *__pyx_n_s__minor;
1175
1256
static PyObject *__pyx_n_s__msg;
1176
1257
static PyObject *__pyx_n_s__name;
 
1258
static PyObject *__pyx_n_s__new;
1177
1259
static PyObject *__pyx_n_s__nonblock;
 
1260
static PyObject *__pyx_n_s__obj;
1178
1261
static PyObject *__pyx_n_s__output_buffer;
1179
1262
static PyObject *__pyx_n_s__output_headers;
 
1263
static PyObject *__pyx_n_s__owned;
1180
1264
static PyObject *__pyx_n_s__packed_ip;
1181
1265
static PyObject *__pyx_n_s__peer;
1182
1266
static PyObject *__pyx_n_s__pending;
1186
1270
static PyObject *__pyx_n_s__port;
1187
1271
static PyObject *__pyx_n_s__pprint;
1188
1272
static PyObject *__pyx_n_s__print_exc;
1189
 
static PyObject *__pyx_n_s__read;
1190
1273
static PyObject *__pyx_n_s__read_event;
1191
1274
static PyObject *__pyx_n_s__readline;
1192
1275
static PyObject *__pyx_n_s__readwrite_event;
1194
1277
static PyObject *__pyx_n_s__reinit;
1195
1278
static PyObject *__pyx_n_s__remote_host;
1196
1279
static PyObject *__pyx_n_s__remote_port;
1197
 
static PyObject *__pyx_n_s__remove_input_header;
1198
1280
static PyObject *__pyx_n_s__replace;
 
1281
static PyObject *__pyx_n_s__req;
1199
1282
static PyObject *__pyx_n_s__response_code;
1200
1283
static PyObject *__pyx_n_s__response_code_line;
1201
1284
static PyObject *__pyx_n_s__seconds;
1202
1285
static PyObject *__pyx_n_s__self;
 
1286
static PyObject *__pyx_n_s__set_exc_info;
1203
1287
static PyObject *__pyx_n_s__signal;
1204
1288
static PyObject *__pyx_n_s__signalnum;
1205
1289
static PyObject *__pyx_n_s__size;
1206
1290
static PyObject *__pyx_n_s__stacklevel;
1207
1291
static PyObject *__pyx_n_s__stderr;
1208
1292
static PyObject *__pyx_n_s__sys;
1209
 
static PyObject *__pyx_n_s__tb;
1210
1293
static PyObject *__pyx_n_s__timeout;
1211
1294
static PyObject *__pyx_n_s__timer;
1212
1295
static PyObject *__pyx_n_s__traceback;
1213
1296
static PyObject *__pyx_n_s__tv_sec;
1214
1297
static PyObject *__pyx_n_s__tv_usec;
1215
 
static PyObject *__pyx_n_s__typ;
1216
1298
static PyObject *__pyx_n_s__type;
1217
1299
static PyObject *__pyx_n_s__typestr;
1218
1300
static PyObject *__pyx_n_s__uri;
1230
1312
static PyObject *__pyx_int_5;
1231
1313
static PyObject *__pyx_int_8;
1232
1314
static PyObject *__pyx_int_neg_1;
 
1315
static PyObject *__pyx_int_16;
 
1316
static PyObject *__pyx_int_32;
 
1317
static PyObject *__pyx_int_64;
1233
1318
static PyObject *__pyx_int_65;
1234
1319
static PyObject *__pyx_int_66;
1235
1320
static PyObject *__pyx_int_67;
1236
1321
static PyObject *__pyx_int_68;
 
1322
static PyObject *__pyx_int_128;
 
1323
static PyObject *__pyx_int_256;
1237
1324
static PyObject *__pyx_k_12;
1238
1325
static PyObject *__pyx_k_13;
1239
1326
static PyObject *__pyx_k_14;
1240
1327
static PyObject *__pyx_k_15;
 
1328
static PyObject *__pyx_k_33;
 
1329
static PyObject *__pyx_k_tuple_30;
 
1330
static PyObject *__pyx_k_tuple_31;
 
1331
static PyObject *__pyx_k_tuple_37;
 
1332
static PyObject *__pyx_k_tuple_41;
 
1333
static PyObject *__pyx_k_tuple_43;
 
1334
static PyObject *__pyx_k_tuple_56;
 
1335
static PyObject *__pyx_k_tuple_59;
1241
1336
 
1242
 
/* "/home/denis/work/gevent/gevent/core.pyx":149
 
1337
/* "gevent/core.pyx":129
1243
1338
 * 
1244
1339
 * 
1245
1340
 * cdef void __event_handler(int fd, short evtype, void *arg) with gil:             # <<<<<<<<<<<<<<
1258
1353
  PyObject *__pyx_t_7 = NULL;
1259
1354
  PyObject *__pyx_t_8 = NULL;
1260
1355
  int __pyx_t_9;
 
1356
  #ifdef WITH_THREAD
1261
1357
  PyGILState_STATE _save = PyGILState_Ensure();
 
1358
  #endif
1262
1359
  __Pyx_RefNannySetupContext("__event_handler");
1263
1360
 
1264
 
  /* "/home/denis/work/gevent/gevent/core.pyx":150
 
1361
  /* "gevent/core.pyx":130
1265
1362
 * 
1266
1363
 * cdef void __event_handler(int fd, short evtype, void *arg) with gil:
1267
1364
 *     cdef event self = <event>arg             # <<<<<<<<<<<<<<
1268
1365
 *     try:
1269
 
 *         self._callback(self, evtype)
 
1366
 *         self.callback(self, evtype)
1270
1367
 */
1271
1368
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6gevent_4core_event *)__pyx_v_arg)));
1272
1369
  __pyx_v_self = ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_arg);
1273
1370
 
1274
 
  /* "/home/denis/work/gevent/gevent/core.pyx":151
 
1371
  /* "gevent/core.pyx":131
1275
1372
 * cdef void __event_handler(int fd, short evtype, void *arg) with gil:
1276
1373
 *     cdef event self = <event>arg
1277
1374
 *     try:             # <<<<<<<<<<<<<<
1278
 
 *         self._callback(self, evtype)
 
1375
 *         self.callback(self, evtype)
1279
1376
 *     except:
1280
1377
 */
1281
1378
  /*try:*/ {
1287
1384
      __Pyx_XGOTREF(__pyx_save_exc_tb);
1288
1385
      /*try:*/ {
1289
1386
 
1290
 
        /* "/home/denis/work/gevent/gevent/core.pyx":152
 
1387
        /* "gevent/core.pyx":132
1291
1388
 *     cdef event self = <event>arg
1292
1389
 *     try:
1293
 
 *         self._callback(self, evtype)             # <<<<<<<<<<<<<<
 
1390
 *         self.callback(self, evtype)             # <<<<<<<<<<<<<<
1294
1391
 *     except:
1295
1392
 *         traceback.print_exc()
1296
1393
 */
1297
 
        __pyx_t_1 = PyInt_FromLong(__pyx_v_evtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
 
1394
        __pyx_t_1 = PyInt_FromLong(__pyx_v_evtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
1298
1395
        __Pyx_GOTREF(__pyx_t_1);
1299
 
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
1300
 
        __Pyx_GOTREF(__pyx_t_2);
 
1396
        __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
 
1397
        __Pyx_GOTREF(((PyObject *)__pyx_t_2));
1301
1398
        __Pyx_INCREF(((PyObject *)__pyx_v_self));
1302
1399
        PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
1303
1400
        __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
1304
1401
        PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
1305
1402
        __Pyx_GIVEREF(__pyx_t_1);
1306
1403
        __pyx_t_1 = 0;
1307
 
        __pyx_t_1 = PyObject_Call(__pyx_v_self->_callback, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
 
1404
        __pyx_t_1 = PyObject_Call(__pyx_v_self->callback, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
1308
1405
        __Pyx_GOTREF(__pyx_t_1);
1309
 
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
1406
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
1310
1407
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1311
1408
      }
1312
1409
      __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
1317
1414
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
1318
1415
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
1319
1416
 
1320
 
      /* "/home/denis/work/gevent/gevent/core.pyx":153
 
1417
      /* "gevent/core.pyx":133
1321
1418
 *     try:
1322
 
 *         self._callback(self, evtype)
 
1419
 *         self.callback(self, evtype)
1323
1420
 *     except:             # <<<<<<<<<<<<<<
1324
1421
 *         traceback.print_exc()
1325
1422
 *         try:
1326
1423
 */
1327
1424
      /*except:*/ {
1328
1425
        __Pyx_AddTraceback("gevent.core.__event_handler");
1329
 
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
 
1426
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
1330
1427
        __Pyx_GOTREF(__pyx_t_1);
1331
1428
        __Pyx_GOTREF(__pyx_t_2);
1332
1429
        __Pyx_GOTREF(__pyx_t_3);
1333
1430
 
1334
 
        /* "/home/denis/work/gevent/gevent/core.pyx":154
1335
 
 *         self._callback(self, evtype)
 
1431
        /* "gevent/core.pyx":134
 
1432
 *         self.callback(self, evtype)
1336
1433
 *     except:
1337
1434
 *         traceback.print_exc()             # <<<<<<<<<<<<<<
1338
1435
 *         try:
1339
1436
 *             sys.stderr.write('Failed to execute callback for %s\n\n' % (self, ))
1340
1437
 */
1341
 
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
 
1438
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
1342
1439
        __Pyx_GOTREF(__pyx_t_4);
1343
 
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
 
1440
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
1344
1441
        __Pyx_GOTREF(__pyx_t_5);
1345
1442
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1346
 
        __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
 
1443
        __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
1347
1444
        __Pyx_GOTREF(__pyx_t_4);
1348
1445
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1349
1446
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1350
1447
 
1351
 
        /* "/home/denis/work/gevent/gevent/core.pyx":155
 
1448
        /* "gevent/core.pyx":135
1352
1449
 *     except:
1353
1450
 *         traceback.print_exc()
1354
1451
 *         try:             # <<<<<<<<<<<<<<
1363
1460
          __Pyx_XGOTREF(__pyx_save_exc_tb);
1364
1461
          /*try:*/ {
1365
1462
 
1366
 
            /* "/home/denis/work/gevent/gevent/core.pyx":156
 
1463
            /* "gevent/core.pyx":136
1367
1464
 *         traceback.print_exc()
1368
1465
 *         try:
1369
1466
 *             sys.stderr.write('Failed to execute callback for %s\n\n' % (self, ))             # <<<<<<<<<<<<<<
1370
1467
 *         except:
1371
1468
 *             traceback.print_exc()
1372
1469
 */
1373
 
            __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
 
1470
            __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
1374
1471
            __Pyx_GOTREF(__pyx_t_4);
1375
 
            __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__stderr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
 
1472
            __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__stderr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
1376
1473
            __Pyx_GOTREF(__pyx_t_5);
1377
1474
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1378
 
            __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
 
1475
            __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
1379
1476
            __Pyx_GOTREF(__pyx_t_4);
1380
1477
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1381
 
            __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
1382
 
            __Pyx_GOTREF(__pyx_t_5);
 
1478
            __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
 
1479
            __Pyx_GOTREF(((PyObject *)__pyx_t_5));
1383
1480
            __Pyx_INCREF(((PyObject *)__pyx_v_self));
1384
1481
            PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_self));
1385
1482
            __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
1386
 
            __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
1387
 
            __Pyx_GOTREF(__pyx_t_6);
1388
 
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1389
 
            __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
1390
 
            __Pyx_GOTREF(__pyx_t_5);
1391
 
            PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
1392
 
            __Pyx_GIVEREF(__pyx_t_6);
 
1483
            __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
 
1484
            __Pyx_GOTREF(((PyObject *)__pyx_t_6));
 
1485
            __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
 
1486
            __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
 
1487
            __Pyx_GOTREF(((PyObject *)__pyx_t_5));
 
1488
            PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
 
1489
            __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
1393
1490
            __pyx_t_6 = 0;
1394
 
            __pyx_t_6 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
 
1491
            __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
1395
1492
            __Pyx_GOTREF(__pyx_t_6);
1396
1493
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1397
 
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
1494
            __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
1398
1495
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
1399
1496
          }
1400
1497
          __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
1406
1503
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
1407
1504
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
1408
1505
 
1409
 
          /* "/home/denis/work/gevent/gevent/core.pyx":157
 
1506
          /* "gevent/core.pyx":137
1410
1507
 *         try:
1411
1508
 *             sys.stderr.write('Failed to execute callback for %s\n\n' % (self, ))
1412
1509
 *         except:             # <<<<<<<<<<<<<<
1415
1512
 */
1416
1513
          /*except:*/ {
1417
1514
            __Pyx_AddTraceback("gevent.core.__event_handler");
1418
 
            if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
 
1515
            if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
1419
1516
            __Pyx_GOTREF(__pyx_t_6);
1420
1517
            __Pyx_GOTREF(__pyx_t_5);
1421
1518
            __Pyx_GOTREF(__pyx_t_4);
1422
1519
 
1423
 
            /* "/home/denis/work/gevent/gevent/core.pyx":158
 
1520
            /* "gevent/core.pyx":138
1424
1521
 *             sys.stderr.write('Failed to execute callback for %s\n\n' % (self, ))
1425
1522
 *         except:
1426
1523
 *             traceback.print_exc()             # <<<<<<<<<<<<<<
1427
1524
 *         sys.exc_clear()
1428
1525
 *     finally:
1429
1526
 */
1430
 
            __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
 
1527
            __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
1431
1528
            __Pyx_GOTREF(__pyx_t_7);
1432
 
            __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
 
1529
            __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
1433
1530
            __Pyx_GOTREF(__pyx_t_8);
1434
1531
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1435
 
            __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
 
1532
            __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
1436
1533
            __Pyx_GOTREF(__pyx_t_7);
1437
1534
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
1438
1535
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1455
1552
          __pyx_L23_try_end:;
1456
1553
        }
1457
1554
 
1458
 
        /* "/home/denis/work/gevent/gevent/core.pyx":159
 
1555
        /* "gevent/core.pyx":139
1459
1556
 *         except:
1460
1557
 *             traceback.print_exc()
1461
1558
 *         sys.exc_clear()             # <<<<<<<<<<<<<<
1462
1559
 *     finally:
1463
1560
 *         if not event_pending(&self.ev, EV_READ|EV_WRITE|EV_SIGNAL|EV_TIMEOUT, NULL):
1464
1561
 */
1465
 
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
 
1562
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
1466
1563
        __Pyx_GOTREF(__pyx_t_4);
1467
 
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__exc_clear); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
 
1564
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__exc_clear); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
1468
1565
        __Pyx_GOTREF(__pyx_t_5);
1469
1566
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1470
 
        __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
 
1567
        __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
1471
1568
        __Pyx_GOTREF(__pyx_t_4);
1472
1569
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
1473
1570
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1490
1587
      __pyx_L13_try_end:;
1491
1588
    }
1492
1589
  }
 
1590
 
 
1591
  /* "gevent/core.pyx":141
 
1592
 *         sys.exc_clear()
 
1593
 *     finally:
 
1594
 *         if not event_pending(&self.ev, EV_READ|EV_WRITE|EV_SIGNAL|EV_TIMEOUT, NULL):             # <<<<<<<<<<<<<<
 
1595
 *             self._delref()
 
1596
 * 
 
1597
 */
1493
1598
  /*finally:*/ {
1494
1599
    int __pyx_why;
1495
1600
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
1511
1616
      goto __pyx_L5;
1512
1617
    }
1513
1618
    __pyx_L5:;
1514
 
 
1515
 
    /* "/home/denis/work/gevent/gevent/core.pyx":161
1516
 
 *         sys.exc_clear()
1517
 
 *     finally:
1518
 
 *         if not event_pending(&self.ev, EV_READ|EV_WRITE|EV_SIGNAL|EV_TIMEOUT, NULL):             # <<<<<<<<<<<<<<
1519
 
 *             self._delref()
1520
 
 * 
1521
 
 */
1522
1619
    __pyx_t_9 = (!event_pending((&__pyx_v_self->ev), (((EV_READ | EV_WRITE) | EV_SIGNAL) | EV_TIMEOUT), NULL));
1523
1620
    if (__pyx_t_9) {
1524
1621
 
1525
 
      /* "/home/denis/work/gevent/gevent/core.pyx":162
 
1622
      /* "gevent/core.pyx":142
1526
1623
 *     finally:
1527
1624
 *         if not event_pending(&self.ev, EV_READ|EV_WRITE|EV_SIGNAL|EV_TIMEOUT, NULL):
1528
1625
 *             self._delref()             # <<<<<<<<<<<<<<
1529
1626
 * 
1530
1627
 * 
1531
1628
 */
1532
 
      __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_4core_event *)__pyx_v_self->__pyx_vtab)->_delref(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
 
1629
      __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_4core_event *)__pyx_v_self->__pyx_vtab)->_delref(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
1533
1630
      __Pyx_GOTREF(__pyx_t_3);
1534
1631
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1535
1632
      goto __pyx_L27;
1570
1667
  __pyx_L0:;
1571
1668
  __Pyx_XDECREF((PyObject *)__pyx_v_self);
1572
1669
  __Pyx_RefNannyFinishContext();
 
1670
  #ifdef WITH_THREAD
1573
1671
  PyGILState_Release(_save);
 
1672
  #endif
1574
1673
}
1575
1674
 
1576
 
/* "/home/denis/work/gevent/gevent/core.pyx":177
1577
 
 *     cdef int _incref # 1 if we already INCREFed this object once (because libevent references it)
 
1675
/* "gevent/core.pyx":158
 
1676
 *     cdef int _incref  # 1 if we already INCREFed this object once (because libevent references it)
1578
1677
 * 
1579
1678
 *     def __init__(self, short evtype, int handle, callback, arg=None):             # <<<<<<<<<<<<<<
1580
 
 *         self._callback = callback
1581
 
 *         self._arg = arg
 
1679
 *         self.callback = callback
 
1680
 *         self.arg = arg
1582
1681
 */
1583
1682
 
1584
1683
static int __pyx_pf_6gevent_4core_5event___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1615
1714
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__handle);
1616
1715
      if (likely(values[1])) kw_args--;
1617
1716
      else {
1618
 
        __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
1717
        __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1619
1718
      }
1620
1719
      case  2:
1621
1720
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__callback);
1622
1721
      if (likely(values[2])) kw_args--;
1623
1722
      else {
1624
 
        __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
1723
        __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1625
1724
      }
1626
1725
      case  3:
1627
 
      if (kw_args > 1) {
 
1726
      if (kw_args > 0) {
1628
1727
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arg);
1629
 
        if (unlikely(value)) { values[3] = value; kw_args--; }
 
1728
        if (value) { values[3] = value; kw_args--; }
1630
1729
      }
1631
1730
    }
1632
1731
    if (unlikely(kw_args > 0)) {
1633
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
1732
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1634
1733
    }
1635
 
    __pyx_v_evtype = __Pyx_PyInt_AsShort(values[0]); if (unlikely((__pyx_v_evtype == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1636
 
    __pyx_v_handle = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
1734
    __pyx_v_evtype = __Pyx_PyInt_AsShort(values[0]); if (unlikely((__pyx_v_evtype == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
1735
    __pyx_v_handle = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1637
1736
    __pyx_v_callback = values[2];
1638
1737
    __pyx_v_arg = values[3];
1639
1738
  } else {
1643
1742
      __pyx_v_arg = PyTuple_GET_ITEM(__pyx_args, 3);
1644
1743
      case  3:
1645
1744
      __pyx_v_callback = PyTuple_GET_ITEM(__pyx_args, 2);
1646
 
      __pyx_v_handle = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1647
 
      __pyx_v_evtype = __Pyx_PyInt_AsShort(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_evtype == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
1745
      __pyx_v_handle = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
1746
      __pyx_v_evtype = __Pyx_PyInt_AsShort(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_evtype == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1648
1747
      break;
1649
1748
      default: goto __pyx_L5_argtuple_error;
1650
1749
    }
1651
1750
  }
1652
1751
  goto __pyx_L4_argument_unpacking_done;
1653
1752
  __pyx_L5_argtuple_error:;
1654
 
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
1753
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1655
1754
  __pyx_L3_error:;
1656
1755
  __Pyx_AddTraceback("gevent.core.event.__init__");
 
1756
  __Pyx_RefNannyFinishContext();
1657
1757
  return -1;
1658
1758
  __pyx_L4_argument_unpacking_done:;
1659
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
1660
 
  __Pyx_INCREF(__pyx_v_callback);
1661
 
  __Pyx_INCREF(__pyx_v_arg);
1662
1759
 
1663
 
  /* "/home/denis/work/gevent/gevent/core.pyx":178
 
1760
  /* "gevent/core.pyx":159
1664
1761
 * 
1665
1762
 *     def __init__(self, short evtype, int handle, callback, arg=None):
1666
 
 *         self._callback = callback             # <<<<<<<<<<<<<<
1667
 
 *         self._arg = arg
 
1763
 *         self.callback = callback             # <<<<<<<<<<<<<<
 
1764
 *         self.arg = arg
1668
1765
 *         self._incref = 0
1669
1766
 */
1670
1767
  __Pyx_INCREF(__pyx_v_callback);
1671
1768
  __Pyx_GIVEREF(__pyx_v_callback);
1672
 
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_callback);
1673
 
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_callback);
1674
 
  ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_callback = __pyx_v_callback;
 
1769
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback);
 
1770
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback);
 
1771
  ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback = __pyx_v_callback;
1675
1772
 
1676
 
  /* "/home/denis/work/gevent/gevent/core.pyx":179
 
1773
  /* "gevent/core.pyx":160
1677
1774
 *     def __init__(self, short evtype, int handle, callback, arg=None):
1678
 
 *         self._callback = callback
1679
 
 *         self._arg = arg             # <<<<<<<<<<<<<<
 
1775
 *         self.callback = callback
 
1776
 *         self.arg = arg             # <<<<<<<<<<<<<<
1680
1777
 *         self._incref = 0
1681
1778
 *         cdef void* c_self = <void*>self
1682
1779
 */
1683
1780
  __Pyx_INCREF(__pyx_v_arg);
1684
1781
  __Pyx_GIVEREF(__pyx_v_arg);
1685
 
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_arg);
1686
 
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_arg);
1687
 
  ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_arg = __pyx_v_arg;
 
1782
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg);
 
1783
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg);
 
1784
  ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg = __pyx_v_arg;
1688
1785
 
1689
 
  /* "/home/denis/work/gevent/gevent/core.pyx":180
1690
 
 *         self._callback = callback
1691
 
 *         self._arg = arg
 
1786
  /* "gevent/core.pyx":161
 
1787
 *         self.callback = callback
 
1788
 *         self.arg = arg
1692
1789
 *         self._incref = 0             # <<<<<<<<<<<<<<
1693
1790
 *         cdef void* c_self = <void*>self
1694
1791
 *         if evtype == 0 and not handle:
1695
1792
 */
1696
1793
  ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_incref = 0;
1697
1794
 
1698
 
  /* "/home/denis/work/gevent/gevent/core.pyx":181
1699
 
 *         self._arg = arg
 
1795
  /* "gevent/core.pyx":162
 
1796
 *         self.arg = arg
1700
1797
 *         self._incref = 0
1701
1798
 *         cdef void* c_self = <void*>self             # <<<<<<<<<<<<<<
1702
1799
 *         if evtype == 0 and not handle:
1704
1801
 */
1705
1802
  __pyx_v_c_self = ((void *)__pyx_v_self);
1706
1803
 
1707
 
  /* "/home/denis/work/gevent/gevent/core.pyx":182
 
1804
  /* "gevent/core.pyx":163
1708
1805
 *         self._incref = 0
1709
1806
 *         cdef void* c_self = <void*>self
1710
1807
 *         if evtype == 0 and not handle:             # <<<<<<<<<<<<<<
1720
1817
  }
1721
1818
  if (__pyx_t_3) {
1722
1819
 
1723
 
    /* "/home/denis/work/gevent/gevent/core.pyx":183
 
1820
    /* "gevent/core.pyx":164
1724
1821
 *         cdef void* c_self = <void*>self
1725
1822
 *         if evtype == 0 and not handle:
1726
1823
 *             evtimer_set(&self.ev, __event_handler, c_self)             # <<<<<<<<<<<<<<
1732
1829
  }
1733
1830
  /*else*/ {
1734
1831
 
1735
 
    /* "/home/denis/work/gevent/gevent/core.pyx":185
 
1832
    /* "gevent/core.pyx":166
1736
1833
 *             evtimer_set(&self.ev, __event_handler, c_self)
1737
1834
 *         else:
1738
1835
 *             event_set(&self.ev, handle, evtype, __event_handler, c_self)             # <<<<<<<<<<<<<<
1744
1841
  __pyx_L6:;
1745
1842
 
1746
1843
  __pyx_r = 0;
1747
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
1748
 
  __Pyx_DECREF(__pyx_v_callback);
1749
 
  __Pyx_DECREF(__pyx_v_arg);
1750
1844
  __Pyx_RefNannyFinishContext();
1751
1845
  return __pyx_r;
1752
1846
}
1753
1847
 
1754
 
/* "/home/denis/work/gevent/gevent/core.pyx":187
 
1848
/* "gevent/core.pyx":168
1755
1849
 *             event_set(&self.ev, handle, evtype, __event_handler, c_self)
1756
1850
 * 
1757
1851
 *     cdef _addref(self):             # <<<<<<<<<<<<<<
1758
1852
 *         if self._incref <= 0:
1759
 
 *             Py_INCREF(self)
 
1853
 *             Py_INCREF(<PyObjectPtr>self)
1760
1854
 */
1761
1855
 
1762
1856
static  PyObject *__pyx_f_6gevent_4core_5event__addref(struct __pyx_obj_6gevent_4core_event *__pyx_v_self) {
1763
1857
  PyObject *__pyx_r = NULL;
1764
1858
  int __pyx_t_1;
1765
1859
  __Pyx_RefNannySetupContext("_addref");
1766
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
1767
1860
 
1768
 
  /* "/home/denis/work/gevent/gevent/core.pyx":188
 
1861
  /* "gevent/core.pyx":169
1769
1862
 * 
1770
1863
 *     cdef _addref(self):
1771
1864
 *         if self._incref <= 0:             # <<<<<<<<<<<<<<
1772
 
 *             Py_INCREF(self)
 
1865
 *             Py_INCREF(<PyObjectPtr>self)
1773
1866
 *             self._incref += 1
1774
1867
 */
1775
1868
  __pyx_t_1 = (__pyx_v_self->_incref <= 0);
1776
1869
  if (__pyx_t_1) {
1777
1870
 
1778
 
    /* "/home/denis/work/gevent/gevent/core.pyx":189
 
1871
    /* "gevent/core.pyx":170
1779
1872
 *     cdef _addref(self):
1780
1873
 *         if self._incref <= 0:
1781
 
 *             Py_INCREF(self)             # <<<<<<<<<<<<<<
 
1874
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
1782
1875
 *             self._incref += 1
1783
1876
 * 
1784
1877
 */
1785
 
    Py_INCREF(((PyObject *)__pyx_v_self));
 
1878
    Py_INCREF(((PyObject*)__pyx_v_self));
1786
1879
 
1787
 
    /* "/home/denis/work/gevent/gevent/core.pyx":190
 
1880
    /* "gevent/core.pyx":171
1788
1881
 *         if self._incref <= 0:
1789
 
 *             Py_INCREF(self)
 
1882
 *             Py_INCREF(<PyObjectPtr>self)
1790
1883
 *             self._incref += 1             # <<<<<<<<<<<<<<
1791
1884
 * 
1792
1885
 *     cdef _delref(self):
1793
1886
 */
1794
 
    __pyx_v_self->_incref += 1;
 
1887
    __pyx_v_self->_incref = (__pyx_v_self->_incref + 1);
1795
1888
    goto __pyx_L3;
1796
1889
  }
1797
1890
  __pyx_L3:;
1798
1891
 
1799
1892
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1800
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
1801
1893
  __Pyx_XGIVEREF(__pyx_r);
1802
1894
  __Pyx_RefNannyFinishContext();
1803
1895
  return __pyx_r;
1804
1896
}
1805
1897
 
1806
 
/* "/home/denis/work/gevent/gevent/core.pyx":192
 
1898
/* "gevent/core.pyx":173
1807
1899
 *             self._incref += 1
1808
1900
 * 
1809
1901
 *     cdef _delref(self):             # <<<<<<<<<<<<<<
1810
1902
 *         if self._incref > 0:
1811
 
 *             Py_DECREF(self)
 
1903
 *             Py_DECREF(<PyObjectPtr>self)
1812
1904
 */
1813
1905
 
1814
1906
static  PyObject *__pyx_f_6gevent_4core_5event__delref(struct __pyx_obj_6gevent_4core_event *__pyx_v_self) {
1815
1907
  PyObject *__pyx_r = NULL;
1816
1908
  int __pyx_t_1;
1817
1909
  __Pyx_RefNannySetupContext("_delref");
1818
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
1819
1910
 
1820
 
  /* "/home/denis/work/gevent/gevent/core.pyx":193
 
1911
  /* "gevent/core.pyx":174
1821
1912
 * 
1822
1913
 *     cdef _delref(self):
1823
1914
 *         if self._incref > 0:             # <<<<<<<<<<<<<<
1824
 
 *             Py_DECREF(self)
 
1915
 *             Py_DECREF(<PyObjectPtr>self)
1825
1916
 *             self._incref -= 1
1826
1917
 */
1827
1918
  __pyx_t_1 = (__pyx_v_self->_incref > 0);
1828
1919
  if (__pyx_t_1) {
1829
1920
 
1830
 
    /* "/home/denis/work/gevent/gevent/core.pyx":194
 
1921
    /* "gevent/core.pyx":175
1831
1922
 *     cdef _delref(self):
1832
1923
 *         if self._incref > 0:
1833
 
 *             Py_DECREF(self)             # <<<<<<<<<<<<<<
 
1924
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
1834
1925
 *             self._incref -= 1
1835
1926
 * 
1836
1927
 */
1837
 
    Py_DECREF(((PyObject *)__pyx_v_self));
 
1928
    Py_DECREF(((PyObject*)__pyx_v_self));
1838
1929
 
1839
 
    /* "/home/denis/work/gevent/gevent/core.pyx":195
 
1930
    /* "gevent/core.pyx":176
1840
1931
 *         if self._incref > 0:
1841
 
 *             Py_DECREF(self)
 
1932
 *             Py_DECREF(<PyObjectPtr>self)
1842
1933
 *             self._incref -= 1             # <<<<<<<<<<<<<<
1843
1934
 * 
1844
 
 *     property callback:
1845
 
 */
1846
 
    __pyx_v_self->_incref -= 1;
1847
 
    goto __pyx_L3;
1848
 
  }
1849
 
  __pyx_L3:;
1850
 
 
1851
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1852
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
1853
 
  __Pyx_XGIVEREF(__pyx_r);
1854
 
  __Pyx_RefNannyFinishContext();
1855
 
  return __pyx_r;
1856
 
}
1857
 
 
1858
 
/* "/home/denis/work/gevent/gevent/core.pyx":203
1859
 
 *         """
1860
 
 * 
1861
 
 *         def __get__(self):             # <<<<<<<<<<<<<<
1862
 
 *             return self._callback
1863
 
 * 
1864
 
 */
1865
 
 
1866
 
static PyObject *__pyx_pf_6gevent_4core_5event_8callback___get__(PyObject *__pyx_v_self); /*proto*/
1867
 
static PyObject *__pyx_pf_6gevent_4core_5event_8callback___get__(PyObject *__pyx_v_self) {
1868
 
  PyObject *__pyx_r = NULL;
1869
 
  __Pyx_RefNannySetupContext("__get__");
1870
 
 
1871
 
  /* "/home/denis/work/gevent/gevent/core.pyx":204
1872
 
 * 
1873
 
 *         def __get__(self):
1874
 
 *             return self._callback             # <<<<<<<<<<<<<<
1875
 
 * 
1876
 
 *         def __set__(self, new):
1877
 
 */
1878
 
  __Pyx_XDECREF(__pyx_r);
1879
 
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_callback);
1880
 
  __pyx_r = ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_callback;
1881
 
  goto __pyx_L0;
1882
 
 
1883
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1884
 
  __pyx_L0:;
1885
 
  __Pyx_XGIVEREF(__pyx_r);
1886
 
  __Pyx_RefNannyFinishContext();
1887
 
  return __pyx_r;
1888
 
}
1889
 
 
1890
 
/* "/home/denis/work/gevent/gevent/core.pyx":206
1891
 
 *             return self._callback
1892
 
 * 
1893
 
 *         def __set__(self, new):             # <<<<<<<<<<<<<<
1894
 
 *             self._callback = new
1895
 
 * 
1896
 
 */
1897
 
 
1898
 
static int __pyx_pf_6gevent_4core_5event_8callback___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_new); /*proto*/
1899
 
static int __pyx_pf_6gevent_4core_5event_8callback___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_new) {
1900
 
  int __pyx_r;
1901
 
  __Pyx_RefNannySetupContext("__set__");
1902
 
 
1903
 
  /* "/home/denis/work/gevent/gevent/core.pyx":207
1904
 
 * 
1905
 
 *         def __set__(self, new):
1906
 
 *             self._callback = new             # <<<<<<<<<<<<<<
1907
 
 * 
1908
 
 *     property arg:
1909
 
 */
1910
 
  __Pyx_INCREF(__pyx_v_new);
1911
 
  __Pyx_GIVEREF(__pyx_v_new);
1912
 
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_callback);
1913
 
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_callback);
1914
 
  ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_callback = __pyx_v_new;
1915
 
 
1916
 
  __pyx_r = 0;
1917
 
  __Pyx_RefNannyFinishContext();
1918
 
  return __pyx_r;
1919
 
}
1920
 
 
1921
 
/* "/home/denis/work/gevent/gevent/core.pyx":212
1922
 
 *         """Optional object set and read only by the user."""
1923
 
 * 
1924
 
 *         def __get__(self):             # <<<<<<<<<<<<<<
1925
 
 *             return self._arg
1926
 
 * 
1927
 
 */
1928
 
 
1929
 
static PyObject *__pyx_pf_6gevent_4core_5event_3arg___get__(PyObject *__pyx_v_self); /*proto*/
1930
 
static PyObject *__pyx_pf_6gevent_4core_5event_3arg___get__(PyObject *__pyx_v_self) {
1931
 
  PyObject *__pyx_r = NULL;
1932
 
  __Pyx_RefNannySetupContext("__get__");
1933
 
 
1934
 
  /* "/home/denis/work/gevent/gevent/core.pyx":213
1935
 
 * 
1936
 
 *         def __get__(self):
1937
 
 *             return self._arg             # <<<<<<<<<<<<<<
1938
 
 * 
1939
 
 *         def __set__(self, new):
1940
 
 */
1941
 
  __Pyx_XDECREF(__pyx_r);
1942
 
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_arg);
1943
 
  __pyx_r = ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_arg;
1944
 
  goto __pyx_L0;
1945
 
 
1946
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1947
 
  __pyx_L0:;
1948
 
  __Pyx_XGIVEREF(__pyx_r);
1949
 
  __Pyx_RefNannyFinishContext();
1950
 
  return __pyx_r;
1951
 
}
1952
 
 
1953
 
/* "/home/denis/work/gevent/gevent/core.pyx":215
1954
 
 *             return self._arg
1955
 
 * 
1956
 
 *         def __set__(self, new):             # <<<<<<<<<<<<<<
1957
 
 *             self._arg = new
1958
 
 * 
1959
 
 */
1960
 
 
1961
 
static int __pyx_pf_6gevent_4core_5event_3arg___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_new); /*proto*/
1962
 
static int __pyx_pf_6gevent_4core_5event_3arg___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_new) {
1963
 
  int __pyx_r;
1964
 
  __Pyx_RefNannySetupContext("__set__");
1965
 
 
1966
 
  /* "/home/denis/work/gevent/gevent/core.pyx":216
1967
 
 * 
1968
 
 *         def __set__(self, new):
1969
 
 *             self._arg = new             # <<<<<<<<<<<<<<
1970
 
 * 
1971
1935
 *     property pending:
1972
1936
 */
1973
 
  __Pyx_INCREF(__pyx_v_new);
1974
 
  __Pyx_GIVEREF(__pyx_v_new);
1975
 
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_arg);
1976
 
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_arg);
1977
 
  ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_arg = __pyx_v_new;
 
1937
    __pyx_v_self->_incref = (__pyx_v_self->_incref - 1);
 
1938
    goto __pyx_L3;
 
1939
  }
 
1940
  __pyx_L3:;
1978
1941
 
1979
 
  __pyx_r = 0;
 
1942
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
1943
  __Pyx_XGIVEREF(__pyx_r);
1980
1944
  __Pyx_RefNannyFinishContext();
1981
1945
  return __pyx_r;
1982
1946
}
1983
1947
 
1984
 
/* "/home/denis/work/gevent/gevent/core.pyx":221
 
1948
/* "gevent/core.pyx":181
1985
1949
 *         """Return True if the event is still scheduled to run."""
1986
1950
 * 
1987
1951
 *         def __get__(self):             # <<<<<<<<<<<<<<
1995
1959
  PyObject *__pyx_t_1 = NULL;
1996
1960
  __Pyx_RefNannySetupContext("__get__");
1997
1961
 
1998
 
  /* "/home/denis/work/gevent/gevent/core.pyx":222
 
1962
  /* "gevent/core.pyx":182
1999
1963
 * 
2000
1964
 *         def __get__(self):
2001
1965
 *             return event_pending(&self.ev, EV_TIMEOUT|EV_SIGNAL|EV_READ|EV_WRITE, NULL)             # <<<<<<<<<<<<<<
2003
1967
 *     property fd:
2004
1968
 */
2005
1969
  __Pyx_XDECREF(__pyx_r);
2006
 
  __pyx_t_1 = PyInt_FromLong(event_pending((&((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->ev), (((EV_TIMEOUT | EV_SIGNAL) | EV_READ) | EV_WRITE), NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1970
  __pyx_t_1 = PyInt_FromLong(event_pending((&((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->ev), (((EV_TIMEOUT | EV_SIGNAL) | EV_READ) | EV_WRITE), NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2007
1971
  __Pyx_GOTREF(__pyx_t_1);
2008
1972
  __pyx_r = __pyx_t_1;
2009
1973
  __pyx_t_1 = 0;
2021
1985
  return __pyx_r;
2022
1986
}
2023
1987
 
2024
 
/* "/home/denis/work/gevent/gevent/core.pyx":226
 
1988
/* "gevent/core.pyx":186
2025
1989
 *     property fd:
2026
1990
 * 
2027
1991
 *         def __get__(self):             # <<<<<<<<<<<<<<
2035
1999
  PyObject *__pyx_t_1 = NULL;
2036
2000
  __Pyx_RefNannySetupContext("__get__");
2037
2001
 
2038
 
  /* "/home/denis/work/gevent/gevent/core.pyx":227
 
2002
  /* "gevent/core.pyx":187
2039
2003
 * 
2040
2004
 *         def __get__(self):
2041
2005
 *             return self.ev.ev_fd             # <<<<<<<<<<<<<<
2043
2007
 *     property events:
2044
2008
 */
2045
2009
  __Pyx_XDECREF(__pyx_r);
2046
 
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->ev.ev_fd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2010
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->ev.ev_fd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2047
2011
  __Pyx_GOTREF(__pyx_t_1);
2048
2012
  __pyx_r = __pyx_t_1;
2049
2013
  __pyx_t_1 = 0;
2061
2025
  return __pyx_r;
2062
2026
}
2063
2027
 
2064
 
/* "/home/denis/work/gevent/gevent/core.pyx":231
 
2028
/* "gevent/core.pyx":191
2065
2029
 *     property events:
2066
2030
 * 
2067
2031
 *         def __get__(self):             # <<<<<<<<<<<<<<
2075
2039
  PyObject *__pyx_t_1 = NULL;
2076
2040
  __Pyx_RefNannySetupContext("__get__");
2077
2041
 
2078
 
  /* "/home/denis/work/gevent/gevent/core.pyx":232
 
2042
  /* "gevent/core.pyx":192
2079
2043
 * 
2080
2044
 *         def __get__(self):
2081
2045
 *             return self.ev.ev_events             # <<<<<<<<<<<<<<
2083
2047
 *     property events_str:
2084
2048
 */
2085
2049
  __Pyx_XDECREF(__pyx_r);
2086
 
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->ev.ev_events); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2050
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->ev.ev_events); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2087
2051
  __Pyx_GOTREF(__pyx_t_1);
2088
2052
  __pyx_r = __pyx_t_1;
2089
2053
  __pyx_t_1 = 0;
2101
2065
  return __pyx_r;
2102
2066
}
2103
2067
 
2104
 
/* "/home/denis/work/gevent/gevent/core.pyx":236
 
2068
/* "gevent/core.pyx":196
2105
2069
 *     property events_str:
2106
2070
 * 
2107
2071
 *         def __get__(self):             # <<<<<<<<<<<<<<
2108
2072
 *             result = []
2109
 
 *             cdef short events = self.ev.ev_events
 
2073
 *             cdef int events = self.ev.ev_events
2110
2074
 */
2111
2075
 
2112
2076
static PyObject *__pyx_pf_6gevent_4core_5event_10events_str___get__(PyObject *__pyx_v_self); /*proto*/
2113
2077
static PyObject *__pyx_pf_6gevent_4core_5event_10events_str___get__(PyObject *__pyx_v_self) {
2114
2078
  PyObject *__pyx_v_result;
2115
 
  short __pyx_v_events;
2116
 
  short __pyx_v_c_event;
 
2079
  int __pyx_v_events;
 
2080
  int __pyx_v_c_event;
2117
2081
  PyObject *__pyx_v_event;
2118
2082
  PyObject *__pyx_v_txt;
2119
2083
  PyObject *__pyx_r = NULL;
2124
2088
  PyObject *__pyx_t_5 = NULL;
2125
2089
  PyObject *__pyx_t_6 = NULL;
2126
2090
  PyObject *__pyx_t_7 = NULL;
2127
 
  short __pyx_t_8;
 
2091
  int __pyx_t_8;
2128
2092
  __Pyx_RefNannySetupContext("__get__");
2129
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
2130
 
  __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
 
2093
  __pyx_v_result = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
2131
2094
  __pyx_v_event = Py_None; __Pyx_INCREF(Py_None);
2132
2095
  __pyx_v_txt = Py_None; __Pyx_INCREF(Py_None);
2133
2096
 
2134
 
  /* "/home/denis/work/gevent/gevent/core.pyx":237
 
2097
  /* "gevent/core.pyx":197
2135
2098
 * 
2136
2099
 *         def __get__(self):
2137
2100
 *             result = []             # <<<<<<<<<<<<<<
2138
 
 *             cdef short events = self.ev.ev_events
2139
 
 *             cdef short c_event
 
2101
 *             cdef int events = self.ev.ev_events
 
2102
 *             cdef int c_event
2140
2103
 */
2141
 
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2104
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2142
2105
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2143
 
  __Pyx_DECREF(__pyx_v_result);
2144
 
  __pyx_v_result = ((PyObject *)__pyx_t_1);
 
2106
  __Pyx_DECREF(((PyObject *)__pyx_v_result));
 
2107
  __pyx_v_result = __pyx_t_1;
2145
2108
  __pyx_t_1 = 0;
2146
2109
 
2147
 
  /* "/home/denis/work/gevent/gevent/core.pyx":238
 
2110
  /* "gevent/core.pyx":198
2148
2111
 *         def __get__(self):
2149
2112
 *             result = []
2150
 
 *             cdef short events = self.ev.ev_events             # <<<<<<<<<<<<<<
2151
 
 *             cdef short c_event
 
2113
 *             cdef int events = self.ev.ev_events             # <<<<<<<<<<<<<<
 
2114
 *             cdef int c_event
2152
2115
 *             for (event, txt) in ((EV_TIMEOUT, 'TIMEOUT'), (EV_READ, 'READ'), (EV_WRITE, 'WRITE'),
2153
2116
 */
2154
2117
  __pyx_v_events = ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->ev.ev_events;
2155
2118
 
2156
 
  /* "/home/denis/work/gevent/gevent/core.pyx":240
2157
 
 *             cdef short events = self.ev.ev_events
2158
 
 *             cdef short c_event
 
2119
  /* "gevent/core.pyx":200
 
2120
 *             cdef int events = self.ev.ev_events
 
2121
 *             cdef int c_event
2159
2122
 *             for (event, txt) in ((EV_TIMEOUT, 'TIMEOUT'), (EV_READ, 'READ'), (EV_WRITE, 'WRITE'),             # <<<<<<<<<<<<<<
2160
2123
 *                                  (EV_SIGNAL, 'SIGNAL'), (EV_PERSIST, 'PERSIST')):
2161
2124
 *                 c_event = event
2162
2125
 */
2163
 
  __pyx_t_1 = PyInt_FromLong(EV_TIMEOUT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2126
  __pyx_t_1 = PyInt_FromLong(EV_TIMEOUT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2164
2127
  __Pyx_GOTREF(__pyx_t_1);
2165
 
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2166
 
  __Pyx_GOTREF(__pyx_t_3);
 
2128
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2129
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
2167
2130
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
2168
2131
  __Pyx_GIVEREF(__pyx_t_1);
2169
2132
  __Pyx_INCREF(((PyObject *)__pyx_n_s__TIMEOUT));
2170
2133
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__TIMEOUT));
2171
2134
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__TIMEOUT));
2172
2135
  __pyx_t_1 = 0;
2173
 
  __pyx_t_1 = PyInt_FromLong(EV_READ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2136
  __pyx_t_1 = PyInt_FromLong(EV_READ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2174
2137
  __Pyx_GOTREF(__pyx_t_1);
2175
 
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2176
 
  __Pyx_GOTREF(__pyx_t_4);
 
2138
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2139
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
2177
2140
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
2178
2141
  __Pyx_GIVEREF(__pyx_t_1);
2179
2142
  __Pyx_INCREF(((PyObject *)__pyx_n_s__READ));
2180
2143
  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__READ));
2181
2144
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__READ));
2182
2145
  __pyx_t_1 = 0;
2183
 
  __pyx_t_1 = PyInt_FromLong(EV_WRITE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2146
  __pyx_t_1 = PyInt_FromLong(EV_WRITE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2184
2147
  __Pyx_GOTREF(__pyx_t_1);
2185
 
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2186
 
  __Pyx_GOTREF(__pyx_t_5);
 
2148
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2149
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
2187
2150
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
2188
2151
  __Pyx_GIVEREF(__pyx_t_1);
2189
2152
  __Pyx_INCREF(((PyObject *)__pyx_n_s__WRITE));
2191
2154
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__WRITE));
2192
2155
  __pyx_t_1 = 0;
2193
2156
 
2194
 
  /* "/home/denis/work/gevent/gevent/core.pyx":241
2195
 
 *             cdef short c_event
 
2157
  /* "gevent/core.pyx":201
 
2158
 *             cdef int c_event
2196
2159
 *             for (event, txt) in ((EV_TIMEOUT, 'TIMEOUT'), (EV_READ, 'READ'), (EV_WRITE, 'WRITE'),
2197
2160
 *                                  (EV_SIGNAL, 'SIGNAL'), (EV_PERSIST, 'PERSIST')):             # <<<<<<<<<<<<<<
2198
2161
 *                 c_event = event
2199
2162
 *                 if events & c_event:
2200
2163
 */
2201
 
  __pyx_t_1 = PyInt_FromLong(EV_SIGNAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2164
  __pyx_t_1 = PyInt_FromLong(EV_SIGNAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2202
2165
  __Pyx_GOTREF(__pyx_t_1);
2203
 
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2204
 
  __Pyx_GOTREF(__pyx_t_6);
 
2166
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2167
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
2205
2168
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
2206
2169
  __Pyx_GIVEREF(__pyx_t_1);
2207
2170
  __Pyx_INCREF(((PyObject *)__pyx_n_s__SIGNAL));
2208
2171
  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_n_s__SIGNAL));
2209
2172
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__SIGNAL));
2210
2173
  __pyx_t_1 = 0;
2211
 
  __pyx_t_1 = PyInt_FromLong(EV_PERSIST); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2174
  __pyx_t_1 = PyInt_FromLong(EV_PERSIST); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2212
2175
  __Pyx_GOTREF(__pyx_t_1);
2213
 
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2214
 
  __Pyx_GOTREF(__pyx_t_7);
 
2176
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2177
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
2215
2178
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
2216
2179
  __Pyx_GIVEREF(__pyx_t_1);
2217
2180
  __Pyx_INCREF(((PyObject *)__pyx_n_s__PERSIST));
2218
2181
  PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_n_s__PERSIST));
2219
2182
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PERSIST));
2220
2183
  __pyx_t_1 = 0;
2221
 
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2222
 
  __Pyx_GOTREF(__pyx_t_1);
2223
 
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
2224
 
  __Pyx_GIVEREF(__pyx_t_3);
2225
 
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
2226
 
  __Pyx_GIVEREF(__pyx_t_4);
2227
 
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
2228
 
  __Pyx_GIVEREF(__pyx_t_5);
2229
 
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_6);
2230
 
  __Pyx_GIVEREF(__pyx_t_6);
2231
 
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_7);
2232
 
  __Pyx_GIVEREF(__pyx_t_7);
 
2184
  __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2185
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
2186
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
 
2187
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
 
2188
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_t_4));
 
2189
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
 
2190
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_5));
 
2191
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
 
2192
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_t_6));
 
2193
  __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
 
2194
  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_t_7));
 
2195
  __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
2233
2196
  __pyx_t_3 = 0;
2234
2197
  __pyx_t_4 = 0;
2235
2198
  __pyx_t_5 = 0;
2236
2199
  __pyx_t_6 = 0;
2237
2200
  __pyx_t_7 = 0;
2238
 
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
2239
 
    __pyx_t_2 = 0; __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7);
2240
 
  } else {
2241
 
    __pyx_t_2 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2242
 
    __Pyx_GOTREF(__pyx_t_7);
2243
 
  }
2244
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
2201
  __pyx_t_2 = 0; __pyx_t_7 = ((PyObject *)__pyx_t_1); __Pyx_INCREF(__pyx_t_7);
 
2202
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
2245
2203
  for (;;) {
2246
2204
 
2247
 
    /* "/home/denis/work/gevent/gevent/core.pyx":240
2248
 
 *             cdef short events = self.ev.ev_events
2249
 
 *             cdef short c_event
 
2205
    /* "gevent/core.pyx":200
 
2206
 *             cdef int events = self.ev.ev_events
 
2207
 *             cdef int c_event
2250
2208
 *             for (event, txt) in ((EV_TIMEOUT, 'TIMEOUT'), (EV_READ, 'READ'), (EV_WRITE, 'WRITE'),             # <<<<<<<<<<<<<<
2251
2209
 *                                  (EV_SIGNAL, 'SIGNAL'), (EV_PERSIST, 'PERSIST')):
2252
2210
 *                 c_event = event
2253
2211
 */
2254
 
    if (likely(PyList_CheckExact(__pyx_t_7))) {
2255
 
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_7)) break;
2256
 
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++;
2257
 
    } else if (likely(PyTuple_CheckExact(__pyx_t_7))) {
2258
 
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
2259
 
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++;
2260
 
    } else {
2261
 
      __pyx_t_1 = PyIter_Next(__pyx_t_7);
2262
 
      if (!__pyx_t_1) {
2263
 
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2264
 
        break;
2265
 
      }
2266
 
      __Pyx_GOTREF(__pyx_t_1);
2267
 
    }
 
2212
    if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
 
2213
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++;
2268
2214
    if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
2269
2215
      PyObject* tuple = __pyx_t_1;
2270
2216
      __pyx_t_6 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_6);
2277
2223
      __pyx_v_txt = __pyx_t_5;
2278
2224
      __pyx_t_5 = 0;
2279
2225
    } else {
2280
 
      __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2226
      __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2281
2227
      __Pyx_GOTREF(__pyx_t_4);
2282
2228
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2283
 
      __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_4, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2229
      __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_4, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2284
2230
      __Pyx_GOTREF(__pyx_t_6);
2285
 
      __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_4, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2231
      __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_4, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2286
2232
      __Pyx_GOTREF(__pyx_t_5);
2287
 
      if (__Pyx_EndUnpack(__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2233
      if (__Pyx_EndUnpack(__pyx_t_4, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2288
2234
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2289
2235
      __Pyx_DECREF(__pyx_v_event);
2290
2236
      __pyx_v_event = __pyx_t_6;
2294
2240
      __pyx_t_5 = 0;
2295
2241
    }
2296
2242
 
2297
 
    /* "/home/denis/work/gevent/gevent/core.pyx":242
 
2243
    /* "gevent/core.pyx":202
2298
2244
 *             for (event, txt) in ((EV_TIMEOUT, 'TIMEOUT'), (EV_READ, 'READ'), (EV_WRITE, 'WRITE'),
2299
2245
 *                                  (EV_SIGNAL, 'SIGNAL'), (EV_PERSIST, 'PERSIST')):
2300
2246
 *                 c_event = event             # <<<<<<<<<<<<<<
2301
2247
 *                 if events & c_event:
2302
2248
 *                     result.append(txt)
2303
2249
 */
2304
 
    __pyx_t_8 = __Pyx_PyInt_AsShort(__pyx_v_event); if (unlikely((__pyx_t_8 == (short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2250
    __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_v_event); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2305
2251
    __pyx_v_c_event = __pyx_t_8;
2306
2252
 
2307
 
    /* "/home/denis/work/gevent/gevent/core.pyx":243
 
2253
    /* "gevent/core.pyx":203
2308
2254
 *                                  (EV_SIGNAL, 'SIGNAL'), (EV_PERSIST, 'PERSIST')):
2309
2255
 *                 c_event = event
2310
2256
 *                 if events & c_event:             # <<<<<<<<<<<<<<
2311
2257
 *                     result.append(txt)
2312
 
 *                     c_event = c_event ^ 0xffffff
 
2258
 *                     events = events & (~c_event)
2313
2259
 */
2314
2260
    __pyx_t_8 = (__pyx_v_events & __pyx_v_c_event);
2315
2261
    if (__pyx_t_8) {
2316
2262
 
2317
 
      /* "/home/denis/work/gevent/gevent/core.pyx":244
 
2263
      /* "gevent/core.pyx":204
2318
2264
 *                 c_event = event
2319
2265
 *                 if events & c_event:
2320
2266
 *                     result.append(txt)             # <<<<<<<<<<<<<<
2321
 
 *                     c_event = c_event ^ 0xffffff
2322
 
 *                     events = events & c_event
 
2267
 *                     events = events & (~c_event)
 
2268
 *             if events:
2323
2269
 */
2324
 
      __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_result, __pyx_v_txt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2325
 
      __Pyx_GOTREF(__pyx_t_1);
2326
 
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
2270
      if (unlikely(__pyx_v_result == Py_None)) {
 
2271
        PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
 
2272
      }
 
2273
      __pyx_t_8 = PyList_Append(__pyx_v_result, __pyx_v_txt); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2327
2274
 
2328
 
      /* "/home/denis/work/gevent/gevent/core.pyx":245
 
2275
      /* "gevent/core.pyx":205
2329
2276
 *                 if events & c_event:
2330
2277
 *                     result.append(txt)
2331
 
 *                     c_event = c_event ^ 0xffffff             # <<<<<<<<<<<<<<
2332
 
 *                     events = events & c_event
2333
 
 *             if events:
2334
 
 */
2335
 
      __pyx_v_c_event = (__pyx_v_c_event ^ 0xffffff);
2336
 
 
2337
 
      /* "/home/denis/work/gevent/gevent/core.pyx":246
2338
 
 *                     result.append(txt)
2339
 
 *                     c_event = c_event ^ 0xffffff
2340
 
 *                     events = events & c_event             # <<<<<<<<<<<<<<
 
2278
 *                     events = events & (~c_event)             # <<<<<<<<<<<<<<
2341
2279
 *             if events:
2342
2280
 *                 result.append(hex(events))
2343
2281
 */
2344
 
      __pyx_v_events = (__pyx_v_events & __pyx_v_c_event);
 
2282
      __pyx_v_events = (__pyx_v_events & (~__pyx_v_c_event));
2345
2283
      goto __pyx_L7;
2346
2284
    }
2347
2285
    __pyx_L7:;
2348
2286
  }
2349
2287
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2350
2288
 
2351
 
  /* "/home/denis/work/gevent/gevent/core.pyx":247
2352
 
 *                     c_event = c_event ^ 0xffffff
2353
 
 *                     events = events & c_event
 
2289
  /* "gevent/core.pyx":206
 
2290
 *                     result.append(txt)
 
2291
 *                     events = events & (~c_event)
2354
2292
 *             if events:             # <<<<<<<<<<<<<<
2355
2293
 *                 result.append(hex(events))
2356
2294
 *             return '|'.join(result)
2357
2295
 */
2358
 
  __pyx_t_8 = __pyx_v_events;
2359
 
  if (__pyx_t_8) {
 
2296
  if (__pyx_v_events) {
2360
2297
 
2361
 
    /* "/home/denis/work/gevent/gevent/core.pyx":248
2362
 
 *                     events = events & c_event
 
2298
    /* "gevent/core.pyx":207
 
2299
 *                     events = events & (~c_event)
2363
2300
 *             if events:
2364
2301
 *                 result.append(hex(events))             # <<<<<<<<<<<<<<
2365
2302
 *             return '|'.join(result)
2366
2303
 * 
2367
2304
 */
2368
 
    __pyx_t_7 = PyInt_FromLong(__pyx_v_events); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2305
    if (unlikely(__pyx_v_result == Py_None)) {
 
2306
      PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
 
2307
    }
 
2308
    __pyx_t_7 = PyInt_FromLong(__pyx_v_events); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2369
2309
    __Pyx_GOTREF(__pyx_t_7);
2370
 
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2371
 
    __Pyx_GOTREF(__pyx_t_1);
 
2310
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2311
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2372
2312
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
2373
2313
    __Pyx_GIVEREF(__pyx_t_7);
2374
2314
    __pyx_t_7 = 0;
2375
 
    __pyx_t_7 = PyObject_Call(__pyx_builtin_hex, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2315
    __pyx_t_7 = PyObject_Call(__pyx_builtin_hex, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2376
2316
    __Pyx_GOTREF(__pyx_t_7);
2377
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2378
 
    __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_result, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2379
 
    __Pyx_GOTREF(__pyx_t_1);
 
2317
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
2318
    __pyx_t_8 = PyList_Append(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2380
2319
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2381
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2382
2320
    goto __pyx_L8;
2383
2321
  }
2384
2322
  __pyx_L8:;
2385
2323
 
2386
 
  /* "/home/denis/work/gevent/gevent/core.pyx":249
 
2324
  /* "gevent/core.pyx":208
2387
2325
 *             if events:
2388
2326
 *                 result.append(hex(events))
2389
2327
 *             return '|'.join(result)             # <<<<<<<<<<<<<<
2391
2329
 *     property flags:
2392
2330
 */
2393
2331
  __Pyx_XDECREF(__pyx_r);
2394
 
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2395
 
  __Pyx_GOTREF(__pyx_t_1);
2396
 
  __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2332
  __pyx_t_7 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2397
2333
  __Pyx_GOTREF(__pyx_t_7);
2398
 
  __Pyx_INCREF(__pyx_v_result);
2399
 
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_result);
2400
 
  __Pyx_GIVEREF(__pyx_v_result);
2401
 
  __pyx_t_5 = PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2334
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2335
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
2336
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
 
2337
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result));
 
2338
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
 
2339
  __pyx_t_5 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2402
2340
  __Pyx_GOTREF(__pyx_t_5);
2403
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2404
2341
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
2342
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
2405
2343
  __pyx_r = __pyx_t_5;
2406
2344
  __pyx_t_5 = 0;
2407
2345
  goto __pyx_L0;
2421
2359
  __Pyx_DECREF(__pyx_v_result);
2422
2360
  __Pyx_DECREF(__pyx_v_event);
2423
2361
  __Pyx_DECREF(__pyx_v_txt);
2424
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
2425
2362
  __Pyx_XGIVEREF(__pyx_r);
2426
2363
  __Pyx_RefNannyFinishContext();
2427
2364
  return __pyx_r;
2428
2365
}
2429
2366
 
2430
 
/* "/home/denis/work/gevent/gevent/core.pyx":253
 
2367
/* "gevent/core.pyx":212
2431
2368
 *     property flags:
2432
2369
 * 
2433
2370
 *         def __get__(self):             # <<<<<<<<<<<<<<
2441
2378
  PyObject *__pyx_t_1 = NULL;
2442
2379
  __Pyx_RefNannySetupContext("__get__");
2443
2380
 
2444
 
  /* "/home/denis/work/gevent/gevent/core.pyx":254
 
2381
  /* "gevent/core.pyx":213
2445
2382
 * 
2446
2383
 *         def __get__(self):
2447
2384
 *             return self.ev.ev_flags             # <<<<<<<<<<<<<<
2449
2386
 *     property flags_str:
2450
2387
 */
2451
2388
  __Pyx_XDECREF(__pyx_r);
2452
 
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->ev.ev_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2389
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->ev.ev_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2453
2390
  __Pyx_GOTREF(__pyx_t_1);
2454
2391
  __pyx_r = __pyx_t_1;
2455
2392
  __pyx_t_1 = 0;
2467
2404
  return __pyx_r;
2468
2405
}
2469
2406
 
2470
 
/* "/home/denis/work/gevent/gevent/core.pyx":258
 
2407
/* "gevent/core.pyx":217
2471
2408
 *     property flags_str:
2472
2409
 * 
2473
2410
 *         def __get__(self):             # <<<<<<<<<<<<<<
2493
2430
  PyObject *__pyx_t_8 = NULL;
2494
2431
  int __pyx_t_9;
2495
2432
  __Pyx_RefNannySetupContext("__get__");
2496
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
2497
 
  __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
 
2433
  __pyx_v_result = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
2498
2434
  __pyx_v_flag = Py_None; __Pyx_INCREF(Py_None);
2499
2435
  __pyx_v_txt = Py_None; __Pyx_INCREF(Py_None);
2500
2436
 
2501
 
  /* "/home/denis/work/gevent/gevent/core.pyx":259
 
2437
  /* "gevent/core.pyx":218
2502
2438
 * 
2503
2439
 *         def __get__(self):
2504
2440
 *             result = []             # <<<<<<<<<<<<<<
2505
2441
 *             cdef int flags = self.ev.ev_flags
2506
2442
 *             cdef int c_flag
2507
2443
 */
2508
 
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2444
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2509
2445
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2510
 
  __Pyx_DECREF(__pyx_v_result);
2511
 
  __pyx_v_result = ((PyObject *)__pyx_t_1);
 
2446
  __Pyx_DECREF(((PyObject *)__pyx_v_result));
 
2447
  __pyx_v_result = __pyx_t_1;
2512
2448
  __pyx_t_1 = 0;
2513
2449
 
2514
 
  /* "/home/denis/work/gevent/gevent/core.pyx":260
 
2450
  /* "gevent/core.pyx":219
2515
2451
 *         def __get__(self):
2516
2452
 *             result = []
2517
2453
 *             cdef int flags = self.ev.ev_flags             # <<<<<<<<<<<<<<
2520
2456
 */
2521
2457
  __pyx_v_flags = ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->ev.ev_flags;
2522
2458
 
2523
 
  /* "/home/denis/work/gevent/gevent/core.pyx":262
 
2459
  /* "gevent/core.pyx":221
2524
2460
 *             cdef int flags = self.ev.ev_flags
2525
2461
 *             cdef int c_flag
2526
2462
 *             for (flag, txt) in ((EVLIST_TIMEOUT, 'TIMEOUT'), (EVLIST_INSERTED, 'INSERTED'), (EVLIST_SIGNAL, 'SIGNAL'),             # <<<<<<<<<<<<<<
2527
2463
 *                                 (EVLIST_ACTIVE, 'ACTIVE'), (EVLIST_INTERNAL, 'INTERNAL'), (EVLIST_INIT, 'INIT')):
2528
2464
 *                 c_flag = flag
2529
2465
 */
2530
 
  __pyx_t_1 = PyInt_FromLong(EVLIST_TIMEOUT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2466
  __pyx_t_1 = PyInt_FromLong(EVLIST_TIMEOUT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2531
2467
  __Pyx_GOTREF(__pyx_t_1);
2532
 
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2533
 
  __Pyx_GOTREF(__pyx_t_3);
 
2468
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2469
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
2534
2470
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
2535
2471
  __Pyx_GIVEREF(__pyx_t_1);
2536
2472
  __Pyx_INCREF(((PyObject *)__pyx_n_s__TIMEOUT));
2537
2473
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__TIMEOUT));
2538
2474
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__TIMEOUT));
2539
2475
  __pyx_t_1 = 0;
2540
 
  __pyx_t_1 = PyInt_FromLong(EVLIST_INSERTED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2476
  __pyx_t_1 = PyInt_FromLong(EVLIST_INSERTED); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2541
2477
  __Pyx_GOTREF(__pyx_t_1);
2542
 
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2543
 
  __Pyx_GOTREF(__pyx_t_4);
 
2478
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2479
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
2544
2480
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
2545
2481
  __Pyx_GIVEREF(__pyx_t_1);
2546
2482
  __Pyx_INCREF(((PyObject *)__pyx_n_s__INSERTED));
2547
2483
  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__INSERTED));
2548
2484
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__INSERTED));
2549
2485
  __pyx_t_1 = 0;
2550
 
  __pyx_t_1 = PyInt_FromLong(EVLIST_SIGNAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2486
  __pyx_t_1 = PyInt_FromLong(EVLIST_SIGNAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2551
2487
  __Pyx_GOTREF(__pyx_t_1);
2552
 
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2553
 
  __Pyx_GOTREF(__pyx_t_5);
 
2488
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2489
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
2554
2490
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
2555
2491
  __Pyx_GIVEREF(__pyx_t_1);
2556
2492
  __Pyx_INCREF(((PyObject *)__pyx_n_s__SIGNAL));
2558
2494
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__SIGNAL));
2559
2495
  __pyx_t_1 = 0;
2560
2496
 
2561
 
  /* "/home/denis/work/gevent/gevent/core.pyx":263
 
2497
  /* "gevent/core.pyx":222
2562
2498
 *             cdef int c_flag
2563
2499
 *             for (flag, txt) in ((EVLIST_TIMEOUT, 'TIMEOUT'), (EVLIST_INSERTED, 'INSERTED'), (EVLIST_SIGNAL, 'SIGNAL'),
2564
2500
 *                                 (EVLIST_ACTIVE, 'ACTIVE'), (EVLIST_INTERNAL, 'INTERNAL'), (EVLIST_INIT, 'INIT')):             # <<<<<<<<<<<<<<
2565
2501
 *                 c_flag = flag
2566
2502
 *                 if flags & c_flag:
2567
2503
 */
2568
 
  __pyx_t_1 = PyInt_FromLong(EVLIST_ACTIVE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2504
  __pyx_t_1 = PyInt_FromLong(EVLIST_ACTIVE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2569
2505
  __Pyx_GOTREF(__pyx_t_1);
2570
 
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2571
 
  __Pyx_GOTREF(__pyx_t_6);
 
2506
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2507
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
2572
2508
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
2573
2509
  __Pyx_GIVEREF(__pyx_t_1);
2574
2510
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ACTIVE));
2575
2511
  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_n_s__ACTIVE));
2576
2512
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ACTIVE));
2577
2513
  __pyx_t_1 = 0;
2578
 
  __pyx_t_1 = PyInt_FromLong(EVLIST_INTERNAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2514
  __pyx_t_1 = PyInt_FromLong(EVLIST_INTERNAL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2579
2515
  __Pyx_GOTREF(__pyx_t_1);
2580
 
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2581
 
  __Pyx_GOTREF(__pyx_t_7);
 
2516
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2517
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
2582
2518
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
2583
2519
  __Pyx_GIVEREF(__pyx_t_1);
2584
2520
  __Pyx_INCREF(((PyObject *)__pyx_n_s__INTERNAL));
2585
2521
  PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_n_s__INTERNAL));
2586
2522
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__INTERNAL));
2587
2523
  __pyx_t_1 = 0;
2588
 
  __pyx_t_1 = PyInt_FromLong(EVLIST_INIT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2524
  __pyx_t_1 = PyInt_FromLong(EVLIST_INIT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2589
2525
  __Pyx_GOTREF(__pyx_t_1);
2590
 
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2591
 
  __Pyx_GOTREF(__pyx_t_8);
 
2526
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2527
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
2592
2528
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
2593
2529
  __Pyx_GIVEREF(__pyx_t_1);
2594
2530
  __Pyx_INCREF(((PyObject *)__pyx_n_s__INIT));
2595
2531
  PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_n_s__INIT));
2596
2532
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__INIT));
2597
2533
  __pyx_t_1 = 0;
2598
 
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2599
 
  __Pyx_GOTREF(__pyx_t_1);
2600
 
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
2601
 
  __Pyx_GIVEREF(__pyx_t_3);
2602
 
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
2603
 
  __Pyx_GIVEREF(__pyx_t_4);
2604
 
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
2605
 
  __Pyx_GIVEREF(__pyx_t_5);
2606
 
  PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_6);
2607
 
  __Pyx_GIVEREF(__pyx_t_6);
2608
 
  PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_7);
2609
 
  __Pyx_GIVEREF(__pyx_t_7);
2610
 
  PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_8);
2611
 
  __Pyx_GIVEREF(__pyx_t_8);
 
2534
  __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2535
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
2536
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_3));
 
2537
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
 
2538
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_t_4));
 
2539
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
 
2540
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_t_5));
 
2541
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
 
2542
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_t_6));
 
2543
  __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
 
2544
  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_t_7));
 
2545
  __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
 
2546
  PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_t_8));
 
2547
  __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
2612
2548
  __pyx_t_3 = 0;
2613
2549
  __pyx_t_4 = 0;
2614
2550
  __pyx_t_5 = 0;
2615
2551
  __pyx_t_6 = 0;
2616
2552
  __pyx_t_7 = 0;
2617
2553
  __pyx_t_8 = 0;
2618
 
  if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
2619
 
    __pyx_t_2 = 0; __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8);
2620
 
  } else {
2621
 
    __pyx_t_2 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2622
 
    __Pyx_GOTREF(__pyx_t_8);
2623
 
  }
2624
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
2554
  __pyx_t_2 = 0; __pyx_t_8 = ((PyObject *)__pyx_t_1); __Pyx_INCREF(__pyx_t_8);
 
2555
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
2625
2556
  for (;;) {
2626
2557
 
2627
 
    /* "/home/denis/work/gevent/gevent/core.pyx":262
 
2558
    /* "gevent/core.pyx":221
2628
2559
 *             cdef int flags = self.ev.ev_flags
2629
2560
 *             cdef int c_flag
2630
2561
 *             for (flag, txt) in ((EVLIST_TIMEOUT, 'TIMEOUT'), (EVLIST_INSERTED, 'INSERTED'), (EVLIST_SIGNAL, 'SIGNAL'),             # <<<<<<<<<<<<<<
2631
2562
 *                                 (EVLIST_ACTIVE, 'ACTIVE'), (EVLIST_INTERNAL, 'INTERNAL'), (EVLIST_INIT, 'INIT')):
2632
2563
 *                 c_flag = flag
2633
2564
 */
2634
 
    if (likely(PyList_CheckExact(__pyx_t_8))) {
2635
 
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_8)) break;
2636
 
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++;
2637
 
    } else if (likely(PyTuple_CheckExact(__pyx_t_8))) {
2638
 
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
2639
 
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++;
2640
 
    } else {
2641
 
      __pyx_t_1 = PyIter_Next(__pyx_t_8);
2642
 
      if (!__pyx_t_1) {
2643
 
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2644
 
        break;
2645
 
      }
2646
 
      __Pyx_GOTREF(__pyx_t_1);
2647
 
    }
 
2565
    if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
 
2566
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++;
2648
2567
    if (PyTuple_CheckExact(__pyx_t_1) && likely(PyTuple_GET_SIZE(__pyx_t_1) == 2)) {
2649
2568
      PyObject* tuple = __pyx_t_1;
2650
2569
      __pyx_t_7 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_7);
2657
2576
      __pyx_v_txt = __pyx_t_6;
2658
2577
      __pyx_t_6 = 0;
2659
2578
    } else {
2660
 
      __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2579
      __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2661
2580
      __Pyx_GOTREF(__pyx_t_5);
2662
2581
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2663
 
      __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_5, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2582
      __pyx_t_7 = __Pyx_UnpackItem(__pyx_t_5, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2664
2583
      __Pyx_GOTREF(__pyx_t_7);
2665
 
      __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_5, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2584
      __pyx_t_6 = __Pyx_UnpackItem(__pyx_t_5, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2666
2585
      __Pyx_GOTREF(__pyx_t_6);
2667
 
      if (__Pyx_EndUnpack(__pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2586
      if (__Pyx_EndUnpack(__pyx_t_5, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2668
2587
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2669
2588
      __Pyx_DECREF(__pyx_v_flag);
2670
2589
      __pyx_v_flag = __pyx_t_7;
2674
2593
      __pyx_t_6 = 0;
2675
2594
    }
2676
2595
 
2677
 
    /* "/home/denis/work/gevent/gevent/core.pyx":264
 
2596
    /* "gevent/core.pyx":223
2678
2597
 *             for (flag, txt) in ((EVLIST_TIMEOUT, 'TIMEOUT'), (EVLIST_INSERTED, 'INSERTED'), (EVLIST_SIGNAL, 'SIGNAL'),
2679
2598
 *                                 (EVLIST_ACTIVE, 'ACTIVE'), (EVLIST_INTERNAL, 'INTERNAL'), (EVLIST_INIT, 'INIT')):
2680
2599
 *                 c_flag = flag             # <<<<<<<<<<<<<<
2681
2600
 *                 if flags & c_flag:
2682
2601
 *                     result.append(txt)
2683
2602
 */
2684
 
    __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_flag); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2603
    __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_flag); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2685
2604
    __pyx_v_c_flag = __pyx_t_9;
2686
2605
 
2687
 
    /* "/home/denis/work/gevent/gevent/core.pyx":265
 
2606
    /* "gevent/core.pyx":224
2688
2607
 *                                 (EVLIST_ACTIVE, 'ACTIVE'), (EVLIST_INTERNAL, 'INTERNAL'), (EVLIST_INIT, 'INIT')):
2689
2608
 *                 c_flag = flag
2690
2609
 *                 if flags & c_flag:             # <<<<<<<<<<<<<<
2691
2610
 *                     result.append(txt)
2692
 
 *                     c_flag = c_flag ^ 0xffffffff
 
2611
 *                     flags = flags & (~c_flag)
2693
2612
 */
2694
2613
    __pyx_t_9 = (__pyx_v_flags & __pyx_v_c_flag);
2695
2614
    if (__pyx_t_9) {
2696
2615
 
2697
 
      /* "/home/denis/work/gevent/gevent/core.pyx":266
 
2616
      /* "gevent/core.pyx":225
2698
2617
 *                 c_flag = flag
2699
2618
 *                 if flags & c_flag:
2700
2619
 *                     result.append(txt)             # <<<<<<<<<<<<<<
2701
 
 *                     c_flag = c_flag ^ 0xffffffff
2702
 
 *                     flags = flags & c_flag
 
2620
 *                     flags = flags & (~c_flag)
 
2621
 *             if flags:
2703
2622
 */
2704
 
      __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_result, __pyx_v_txt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2705
 
      __Pyx_GOTREF(__pyx_t_1);
2706
 
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
2623
      if (unlikely(__pyx_v_result == Py_None)) {
 
2624
        PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
 
2625
      }
 
2626
      __pyx_t_9 = PyList_Append(__pyx_v_result, __pyx_v_txt); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2707
2627
 
2708
 
      /* "/home/denis/work/gevent/gevent/core.pyx":267
 
2628
      /* "gevent/core.pyx":226
2709
2629
 *                 if flags & c_flag:
2710
2630
 *                     result.append(txt)
2711
 
 *                     c_flag = c_flag ^ 0xffffffff             # <<<<<<<<<<<<<<
2712
 
 *                     flags = flags & c_flag
2713
 
 *             if flags:
2714
 
 */
2715
 
      __pyx_v_c_flag = (__pyx_v_c_flag ^ 0xffffffff);
2716
 
 
2717
 
      /* "/home/denis/work/gevent/gevent/core.pyx":268
2718
 
 *                     result.append(txt)
2719
 
 *                     c_flag = c_flag ^ 0xffffffff
2720
 
 *                     flags = flags & c_flag             # <<<<<<<<<<<<<<
 
2631
 *                     flags = flags & (~c_flag)             # <<<<<<<<<<<<<<
2721
2632
 *             if flags:
2722
2633
 *                 result.append(hex(flags))
2723
2634
 */
2724
 
      __pyx_v_flags = (__pyx_v_flags & __pyx_v_c_flag);
 
2635
      __pyx_v_flags = (__pyx_v_flags & (~__pyx_v_c_flag));
2725
2636
      goto __pyx_L7;
2726
2637
    }
2727
2638
    __pyx_L7:;
2728
2639
  }
2729
2640
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2730
2641
 
2731
 
  /* "/home/denis/work/gevent/gevent/core.pyx":269
2732
 
 *                     c_flag = c_flag ^ 0xffffffff
2733
 
 *                     flags = flags & c_flag
 
2642
  /* "gevent/core.pyx":227
 
2643
 *                     result.append(txt)
 
2644
 *                     flags = flags & (~c_flag)
2734
2645
 *             if flags:             # <<<<<<<<<<<<<<
2735
2646
 *                 result.append(hex(flags))
2736
2647
 *             return '|'.join(result)
2737
2648
 */
2738
 
  __pyx_t_9 = __pyx_v_flags;
2739
 
  if (__pyx_t_9) {
 
2649
  if (__pyx_v_flags) {
2740
2650
 
2741
 
    /* "/home/denis/work/gevent/gevent/core.pyx":270
2742
 
 *                     flags = flags & c_flag
 
2651
    /* "gevent/core.pyx":228
 
2652
 *                     flags = flags & (~c_flag)
2743
2653
 *             if flags:
2744
2654
 *                 result.append(hex(flags))             # <<<<<<<<<<<<<<
2745
2655
 *             return '|'.join(result)
2746
2656
 * 
2747
2657
 */
2748
 
    __pyx_t_8 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2658
    if (unlikely(__pyx_v_result == Py_None)) {
 
2659
      PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
 
2660
    }
 
2661
    __pyx_t_8 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2749
2662
    __Pyx_GOTREF(__pyx_t_8);
2750
 
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2751
 
    __Pyx_GOTREF(__pyx_t_1);
 
2663
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2664
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
2752
2665
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
2753
2666
    __Pyx_GIVEREF(__pyx_t_8);
2754
2667
    __pyx_t_8 = 0;
2755
 
    __pyx_t_8 = PyObject_Call(__pyx_builtin_hex, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2668
    __pyx_t_8 = PyObject_Call(__pyx_builtin_hex, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2756
2669
    __Pyx_GOTREF(__pyx_t_8);
2757
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2758
 
    __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_result, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2759
 
    __Pyx_GOTREF(__pyx_t_1);
 
2670
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
2671
    __pyx_t_9 = PyList_Append(__pyx_v_result, __pyx_t_8); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2760
2672
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2761
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2762
2673
    goto __pyx_L8;
2763
2674
  }
2764
2675
  __pyx_L8:;
2765
2676
 
2766
 
  /* "/home/denis/work/gevent/gevent/core.pyx":271
 
2677
  /* "gevent/core.pyx":229
2767
2678
 *             if flags:
2768
2679
 *                 result.append(hex(flags))
2769
2680
 *             return '|'.join(result)             # <<<<<<<<<<<<<<
2771
2682
 *     def add(self, timeout=None):
2772
2683
 */
2773
2684
  __Pyx_XDECREF(__pyx_r);
2774
 
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2775
 
  __Pyx_GOTREF(__pyx_t_1);
2776
 
  __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2685
  __pyx_t_8 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__join); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2777
2686
  __Pyx_GOTREF(__pyx_t_8);
2778
 
  __Pyx_INCREF(__pyx_v_result);
2779
 
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result);
2780
 
  __Pyx_GIVEREF(__pyx_v_result);
2781
 
  __pyx_t_6 = PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2687
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2688
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
2689
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
 
2690
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result));
 
2691
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
 
2692
  __pyx_t_6 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2782
2693
  __Pyx_GOTREF(__pyx_t_6);
2783
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2784
2694
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
2695
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
2785
2696
  __pyx_r = __pyx_t_6;
2786
2697
  __pyx_t_6 = 0;
2787
2698
  goto __pyx_L0;
2802
2713
  __Pyx_DECREF(__pyx_v_result);
2803
2714
  __Pyx_DECREF(__pyx_v_flag);
2804
2715
  __Pyx_DECREF(__pyx_v_txt);
2805
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
2806
2716
  __Pyx_XGIVEREF(__pyx_r);
2807
2717
  __Pyx_RefNannyFinishContext();
2808
2718
  return __pyx_r;
2809
2719
}
2810
2720
 
2811
 
/* "/home/denis/work/gevent/gevent/core.pyx":273
 
2721
/* "gevent/core.pyx":231
2812
2722
 *             return '|'.join(result)
2813
2723
 * 
2814
2724
 *     def add(self, timeout=None):             # <<<<<<<<<<<<<<
2816
2726
 *         after which the event will be executed."""
2817
2727
 */
2818
2728
 
2819
 
static PyObject *__pyx_pf_6gevent_4core_5event_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2820
 
static char __pyx_doc_6gevent_4core_5event_add[] = "Add event to be executed after an optional *timeout* - number of seconds\n        after which the event will be executed.";
2821
 
static PyObject *__pyx_pf_6gevent_4core_5event_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
2729
static PyObject *__pyx_pf_6gevent_4core_5event_1add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
2730
static char __pyx_doc_6gevent_4core_5event_1add[] = "Add event to be executed after an optional *timeout* - number of seconds\n        after which the event will be executed.";
 
2731
static PyObject *__pyx_pf_6gevent_4core_5event_1add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2822
2732
  PyObject *__pyx_v_timeout = 0;
2823
2733
  struct timeval __pyx_v_tv;
2824
2734
  double __pyx_v_c_timeout;
2825
2735
  int __pyx_v_result;
2826
 
  PyObject *__pyx_v_errno;
2827
2736
  PyObject *__pyx_v_warnings;
2828
2737
  PyObject *__pyx_r = NULL;
2829
2738
  int __pyx_t_1;
2832
2741
  PyObject *__pyx_t_4 = NULL;
2833
2742
  PyObject *__pyx_t_5 = NULL;
2834
2743
  PyObject *__pyx_t_6 = NULL;
2835
 
  int __pyx_t_7;
2836
2744
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__timeout,0};
2837
2745
  __Pyx_RefNannySetupContext("add");
2838
2746
  if (unlikely(__pyx_kwds)) {
2846
2754
    }
2847
2755
    switch (PyTuple_GET_SIZE(__pyx_args)) {
2848
2756
      case  0:
2849
 
      if (kw_args > 1) {
 
2757
      if (kw_args > 0) {
2850
2758
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__timeout);
2851
 
        if (unlikely(value)) { values[0] = value; kw_args--; }
 
2759
        if (value) { values[0] = value; kw_args--; }
2852
2760
      }
2853
2761
    }
2854
2762
    if (unlikely(kw_args > 0)) {
2855
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2763
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2856
2764
    }
2857
2765
    __pyx_v_timeout = values[0];
2858
2766
  } else {
2865
2773
  }
2866
2774
  goto __pyx_L4_argument_unpacking_done;
2867
2775
  __pyx_L5_argtuple_error:;
2868
 
  __Pyx_RaiseArgtupleInvalid("add", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
2776
  __Pyx_RaiseArgtupleInvalid("add", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2869
2777
  __pyx_L3_error:;
2870
2778
  __Pyx_AddTraceback("gevent.core.event.add");
 
2779
  __Pyx_RefNannyFinishContext();
2871
2780
  return NULL;
2872
2781
  __pyx_L4_argument_unpacking_done:;
2873
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
2874
 
  __Pyx_INCREF(__pyx_v_timeout);
2875
 
  __pyx_v_errno = Py_None; __Pyx_INCREF(Py_None);
2876
2782
  __pyx_v_warnings = Py_None; __Pyx_INCREF(Py_None);
2877
2783
 
2878
 
  /* "/home/denis/work/gevent/gevent/core.pyx":279
 
2784
  /* "gevent/core.pyx":237
2879
2785
 *         cdef double c_timeout
2880
2786
 *         cdef int result
2881
 
 *         errno = 0  # event_add sometime does not set errno             # <<<<<<<<<<<<<<
2882
 
 *         if timeout is None:
2883
 
 *             result = event_add(&self.ev, NULL)
2884
 
 */
2885
 
  __Pyx_INCREF(__pyx_int_0);
2886
 
  __Pyx_DECREF(__pyx_v_errno);
2887
 
  __pyx_v_errno = __pyx_int_0;
2888
 
 
2889
 
  /* "/home/denis/work/gevent/gevent/core.pyx":280
2890
 
 *         cdef int result
2891
 
 *         errno = 0  # event_add sometime does not set errno
2892
2787
 *         if timeout is None:             # <<<<<<<<<<<<<<
2893
2788
 *             result = event_add(&self.ev, NULL)
2894
2789
 *         else:
2896
2791
  __pyx_t_1 = (__pyx_v_timeout == Py_None);
2897
2792
  if (__pyx_t_1) {
2898
2793
 
2899
 
    /* "/home/denis/work/gevent/gevent/core.pyx":281
2900
 
 *         errno = 0  # event_add sometime does not set errno
 
2794
    /* "gevent/core.pyx":238
 
2795
 *         cdef int result
2901
2796
 *         if timeout is None:
2902
2797
 *             result = event_add(&self.ev, NULL)             # <<<<<<<<<<<<<<
2903
2798
 *         else:
2908
2803
  }
2909
2804
  /*else*/ {
2910
2805
 
2911
 
    /* "/home/denis/work/gevent/gevent/core.pyx":283
 
2806
    /* "gevent/core.pyx":240
2912
2807
 *             result = event_add(&self.ev, NULL)
2913
2808
 *         else:
2914
2809
 *             c_timeout = <double>timeout             # <<<<<<<<<<<<<<
2915
2810
 *             if c_timeout < 0.0:
2916
2811
 *                 #raise ValueError('Expected a non-negative number or None: %r' % (timeout, ))
2917
2812
 */
2918
 
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_timeout); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2919
 
    __pyx_v_c_timeout = ((double)__pyx_t_2);
 
2813
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_timeout); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2814
    __pyx_v_c_timeout = __pyx_t_2;
2920
2815
 
2921
 
    /* "/home/denis/work/gevent/gevent/core.pyx":284
 
2816
    /* "gevent/core.pyx":241
2922
2817
 *         else:
2923
2818
 *             c_timeout = <double>timeout
2924
2819
 *             if c_timeout < 0.0:             # <<<<<<<<<<<<<<
2928
2823
    __pyx_t_1 = (__pyx_v_c_timeout < 0.0);
2929
2824
    if (__pyx_t_1) {
2930
2825
 
2931
 
      /* "/home/denis/work/gevent/gevent/core.pyx":286
 
2826
      /* "gevent/core.pyx":243
2932
2827
 *             if c_timeout < 0.0:
2933
2828
 *                 #raise ValueError('Expected a non-negative number or None: %r' % (timeout, ))
2934
2829
 *                 import warnings             # <<<<<<<<<<<<<<
2935
2830
 *                 warnings.warn('Negative timeouts are deprecated. Use None to disable timeout.', DeprecationWarning, stacklevel=2)
2936
2831
 *                 result = event_add(&self.ev, NULL)
2937
2832
 */
2938
 
      __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__warnings), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2833
      __pyx_t_3 = __Pyx_Import(((PyObject *)__pyx_n_s__warnings), 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2939
2834
      __Pyx_GOTREF(__pyx_t_3);
2940
2835
      __Pyx_DECREF(__pyx_v_warnings);
2941
2836
      __pyx_v_warnings = __pyx_t_3;
2942
2837
      __pyx_t_3 = 0;
2943
2838
 
2944
 
      /* "/home/denis/work/gevent/gevent/core.pyx":287
 
2839
      /* "gevent/core.pyx":244
2945
2840
 *                 #raise ValueError('Expected a non-negative number or None: %r' % (timeout, ))
2946
2841
 *                 import warnings
2947
2842
 *                 warnings.warn('Negative timeouts are deprecated. Use None to disable timeout.', DeprecationWarning, stacklevel=2)             # <<<<<<<<<<<<<<
2948
2843
 *                 result = event_add(&self.ev, NULL)
2949
2844
 *             else:
2950
2845
 */
2951
 
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_warnings, __pyx_n_s__warn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2846
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_warnings, __pyx_n_s__warn); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2952
2847
      __Pyx_GOTREF(__pyx_t_3);
2953
 
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2954
 
      __Pyx_GOTREF(__pyx_t_4);
 
2848
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2849
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
2955
2850
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
2956
2851
      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_kp_s_3));
2957
2852
      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
2958
2853
      __Pyx_INCREF(__pyx_builtin_DeprecationWarning);
2959
2854
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_builtin_DeprecationWarning);
2960
2855
      __Pyx_GIVEREF(__pyx_builtin_DeprecationWarning);
2961
 
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2856
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2962
2857
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
2963
 
      if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__stacklevel), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2964
 
      __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2858
      if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__stacklevel), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2859
      __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2965
2860
      __Pyx_GOTREF(__pyx_t_6);
2966
2861
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2967
 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
2862
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
2968
2863
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
2969
2864
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2970
2865
 
2971
 
      /* "/home/denis/work/gevent/gevent/core.pyx":288
 
2866
      /* "gevent/core.pyx":245
2972
2867
 *                 import warnings
2973
2868
 *                 warnings.warn('Negative timeouts are deprecated. Use None to disable timeout.', DeprecationWarning, stacklevel=2)
2974
2869
 *                 result = event_add(&self.ev, NULL)             # <<<<<<<<<<<<<<
2980
2875
    }
2981
2876
    /*else*/ {
2982
2877
 
2983
 
      /* "/home/denis/work/gevent/gevent/core.pyx":290
 
2878
      /* "gevent/core.pyx":247
2984
2879
 *                 result = event_add(&self.ev, NULL)
2985
2880
 *             else:
2986
2881
 *                 tv.tv_sec = <long>c_timeout             # <<<<<<<<<<<<<<
2989
2884
 */
2990
2885
      __pyx_v_tv.tv_sec = ((long)__pyx_v_c_timeout);
2991
2886
 
2992
 
      /* "/home/denis/work/gevent/gevent/core.pyx":291
 
2887
      /* "gevent/core.pyx":248
2993
2888
 *             else:
2994
2889
 *                 tv.tv_sec = <long>c_timeout
2995
2890
 *                 tv.tv_usec = <unsigned int>((c_timeout - <double>tv.tv_sec) * 1000000.0)             # <<<<<<<<<<<<<<
2998
2893
 */
2999
2894
      __pyx_v_tv.tv_usec = ((unsigned int)((__pyx_v_c_timeout - ((double)__pyx_v_tv.tv_sec)) * 1000000.0));
3000
2895
 
3001
 
      /* "/home/denis/work/gevent/gevent/core.pyx":292
 
2896
      /* "gevent/core.pyx":249
3002
2897
 *                 tv.tv_sec = <long>c_timeout
3003
2898
 *                 tv.tv_usec = <unsigned int>((c_timeout - <double>tv.tv_sec) * 1000000.0)
3004
2899
 *                 result = event_add(&self.ev, &tv)             # <<<<<<<<<<<<<<
3011
2906
  }
3012
2907
  __pyx_L6:;
3013
2908
 
3014
 
  /* "/home/denis/work/gevent/gevent/core.pyx":293
 
2909
  /* "gevent/core.pyx":250
3015
2910
 *                 tv.tv_usec = <unsigned int>((c_timeout - <double>tv.tv_sec) * 1000000.0)
3016
2911
 *                 result = event_add(&self.ev, &tv)
3017
2912
 *         if result < 0:             # <<<<<<<<<<<<<<
3021
2916
  __pyx_t_1 = (__pyx_v_result < 0);
3022
2917
  if (__pyx_t_1) {
3023
2918
 
3024
 
    /* "/home/denis/work/gevent/gevent/core.pyx":294
 
2919
    /* "gevent/core.pyx":251
3025
2920
 *                 result = event_add(&self.ev, &tv)
3026
2921
 *         if result < 0:
3027
2922
 *             if errno:             # <<<<<<<<<<<<<<
3028
2923
 *                 raise IOError(errno, strerror(errno))
3029
2924
 *             else:
3030
2925
 */
3031
 
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_errno); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3032
 
    if (__pyx_t_1) {
 
2926
    if (errno) {
3033
2927
 
3034
 
      /* "/home/denis/work/gevent/gevent/core.pyx":295
 
2928
      /* "gevent/core.pyx":252
3035
2929
 *         if result < 0:
3036
2930
 *             if errno:
3037
2931
 *                 raise IOError(errno, strerror(errno))             # <<<<<<<<<<<<<<
3038
2932
 *             else:
3039
2933
 *                 raise IOError("event_add(fileno=%s) returned %s" % (self.fd, result))
3040
2934
 */
3041
 
      __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_errno); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3042
 
      __pyx_t_6 = __Pyx_PyBytes_FromString(strerror(__pyx_t_7)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3043
 
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
3044
 
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3045
 
      __Pyx_GOTREF(__pyx_t_5);
3046
 
      __Pyx_INCREF(__pyx_v_errno);
3047
 
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_errno);
3048
 
      __Pyx_GIVEREF(__pyx_v_errno);
3049
 
      PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_6));
3050
 
      __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
3051
 
      __pyx_t_6 = 0;
3052
 
      __pyx_t_6 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3053
 
      __Pyx_GOTREF(__pyx_t_6);
3054
 
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3055
 
      __Pyx_Raise(__pyx_t_6, 0, 0);
3056
 
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3057
 
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3058
 
      goto __pyx_L9;
3059
 
    }
3060
 
    /*else*/ {
3061
 
 
3062
 
      /* "/home/denis/work/gevent/gevent/core.pyx":297
3063
 
 *                 raise IOError(errno, strerror(errno))
3064
 
 *             else:
3065
 
 *                 raise IOError("event_add(fileno=%s) returned %s" % (self.fd, result))             # <<<<<<<<<<<<<<
3066
 
 *         self._addref()
3067
 
 * 
3068
 
 */
3069
 
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fd); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3070
 
      __Pyx_GOTREF(__pyx_t_6);
3071
 
      __pyx_t_5 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3072
 
      __Pyx_GOTREF(__pyx_t_5);
3073
 
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3074
 
      __Pyx_GOTREF(__pyx_t_4);
 
2935
      __pyx_t_6 = PyInt_FromLong(errno); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2936
      __Pyx_GOTREF(__pyx_t_6);
 
2937
      __pyx_t_5 = PyBytes_FromString(strerror(errno)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2938
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
 
2939
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2940
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
3075
2941
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
3076
2942
      __Pyx_GIVEREF(__pyx_t_6);
3077
 
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
3078
 
      __Pyx_GIVEREF(__pyx_t_5);
 
2943
      PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_t_5));
 
2944
      __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
3079
2945
      __pyx_t_6 = 0;
3080
2946
      __pyx_t_5 = 0;
3081
 
      __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3082
 
      __Pyx_GOTREF(__pyx_t_5);
3083
 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3084
 
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3085
 
      __Pyx_GOTREF(__pyx_t_4);
3086
 
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
3087
 
      __Pyx_GIVEREF(__pyx_t_5);
3088
 
      __pyx_t_5 = 0;
3089
 
      __pyx_t_5 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3090
 
      __Pyx_GOTREF(__pyx_t_5);
3091
 
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
2947
      __pyx_t_5 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2948
      __Pyx_GOTREF(__pyx_t_5);
 
2949
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
3092
2950
      __Pyx_Raise(__pyx_t_5, 0, 0);
3093
2951
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3094
 
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2952
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2953
      goto __pyx_L9;
 
2954
    }
 
2955
    /*else*/ {
 
2956
 
 
2957
      /* "gevent/core.pyx":254
 
2958
 *                 raise IOError(errno, strerror(errno))
 
2959
 *             else:
 
2960
 *                 raise IOError("event_add(fileno=%s) returned %s" % (self.fd, result))             # <<<<<<<<<<<<<<
 
2961
 *         self._addref()
 
2962
 * 
 
2963
 */
 
2964
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fd); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2965
      __Pyx_GOTREF(__pyx_t_5);
 
2966
      __pyx_t_4 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2967
      __Pyx_GOTREF(__pyx_t_4);
 
2968
      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2969
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
 
2970
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
 
2971
      __Pyx_GIVEREF(__pyx_t_5);
 
2972
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
 
2973
      __Pyx_GIVEREF(__pyx_t_4);
 
2974
      __pyx_t_5 = 0;
 
2975
      __pyx_t_4 = 0;
 
2976
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2977
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
 
2978
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
 
2979
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2980
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
 
2981
      PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_4));
 
2982
      __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
 
2983
      __pyx_t_4 = 0;
 
2984
      __pyx_t_4 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2985
      __Pyx_GOTREF(__pyx_t_4);
 
2986
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
 
2987
      __Pyx_Raise(__pyx_t_4, 0, 0);
 
2988
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
2989
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3095
2990
    }
3096
2991
    __pyx_L9:;
3097
2992
    goto __pyx_L8;
3098
2993
  }
3099
2994
  __pyx_L8:;
3100
2995
 
3101
 
  /* "/home/denis/work/gevent/gevent/core.pyx":298
 
2996
  /* "gevent/core.pyx":255
3102
2997
 *             else:
3103
2998
 *                 raise IOError("event_add(fileno=%s) returned %s" % (self.fd, result))
3104
2999
 *         self._addref()             # <<<<<<<<<<<<<<
3105
3000
 * 
3106
3001
 *     def cancel(self):
3107
3002
 */
3108
 
  __pyx_t_5 = ((struct __pyx_vtabstruct_6gevent_4core_event *)((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->__pyx_vtab)->_addref(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3109
 
  __Pyx_GOTREF(__pyx_t_5);
3110
 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
3003
  __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_4core_event *)((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->__pyx_vtab)->_addref(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3004
  __Pyx_GOTREF(__pyx_t_4);
 
3005
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3111
3006
 
3112
3007
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3113
3008
  goto __pyx_L0;
3119
3014
  __Pyx_AddTraceback("gevent.core.event.add");
3120
3015
  __pyx_r = NULL;
3121
3016
  __pyx_L0:;
3122
 
  __Pyx_DECREF(__pyx_v_errno);
3123
3017
  __Pyx_DECREF(__pyx_v_warnings);
3124
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
3125
 
  __Pyx_DECREF(__pyx_v_timeout);
3126
3018
  __Pyx_XGIVEREF(__pyx_r);
3127
3019
  __Pyx_RefNannyFinishContext();
3128
3020
  return __pyx_r;
3129
3021
}
3130
3022
 
3131
 
/* "/home/denis/work/gevent/gevent/core.pyx":300
 
3023
/* "gevent/core.pyx":257
3132
3024
 *         self._addref()
3133
3025
 * 
3134
3026
 *     def cancel(self):             # <<<<<<<<<<<<<<
3136
3028
 *         cdef int result
3137
3029
 */
3138
3030
 
3139
 
static PyObject *__pyx_pf_6gevent_4core_5event_cancel(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
3140
 
static char __pyx_doc_6gevent_4core_5event_cancel[] = "Remove event from the event queue.";
3141
 
static PyObject *__pyx_pf_6gevent_4core_5event_cancel(PyObject *__pyx_v_self, PyObject *unused) {
 
3031
static PyObject *__pyx_pf_6gevent_4core_5event_2cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
3032
static char __pyx_doc_6gevent_4core_5event_2cancel[] = "Remove event from the event queue.";
 
3033
static PyObject *__pyx_pf_6gevent_4core_5event_2cancel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3142
3034
  int __pyx_v_result;
3143
3035
  PyObject *__pyx_r = NULL;
3144
3036
  int __pyx_t_1;
3145
3037
  int __pyx_t_2;
3146
3038
  PyObject *__pyx_t_3 = NULL;
3147
3039
  __Pyx_RefNannySetupContext("cancel");
3148
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
3149
3040
 
3150
 
  /* "/home/denis/work/gevent/gevent/core.pyx":303
 
3041
  /* "gevent/core.pyx":260
3151
3042
 *         """Remove event from the event queue."""
3152
3043
 *         cdef int result
3153
3044
 *         if event_pending(&self.ev, EV_TIMEOUT|EV_SIGNAL|EV_READ|EV_WRITE, NULL):             # <<<<<<<<<<<<<<
3157
3048
  __pyx_t_1 = event_pending((&((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->ev), (((EV_TIMEOUT | EV_SIGNAL) | EV_READ) | EV_WRITE), NULL);
3158
3049
  if (__pyx_t_1) {
3159
3050
 
3160
 
    /* "/home/denis/work/gevent/gevent/core.pyx":304
 
3051
    /* "gevent/core.pyx":261
3161
3052
 *         cdef int result
3162
3053
 *         if event_pending(&self.ev, EV_TIMEOUT|EV_SIGNAL|EV_READ|EV_WRITE, NULL):
3163
3054
 *             result = event_del(&self.ev)             # <<<<<<<<<<<<<<
3166
3057
 */
3167
3058
    __pyx_v_result = event_del((&((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->ev));
3168
3059
 
3169
 
    /* "/home/denis/work/gevent/gevent/core.pyx":305
 
3060
    /* "gevent/core.pyx":262
3170
3061
 *         if event_pending(&self.ev, EV_TIMEOUT|EV_SIGNAL|EV_READ|EV_WRITE, NULL):
3171
3062
 *             result = event_del(&self.ev)
3172
3063
 *             if result < 0:             # <<<<<<<<<<<<<<
3176
3067
    __pyx_t_2 = (__pyx_v_result < 0);
3177
3068
    if (__pyx_t_2) {
3178
3069
 
3179
 
      /* "/home/denis/work/gevent/gevent/core.pyx":306
 
3070
      /* "gevent/core.pyx":263
3180
3071
 *             result = event_del(&self.ev)
3181
3072
 *             if result < 0:
3182
3073
 *                 return result             # <<<<<<<<<<<<<<
3184
3075
 *             return result
3185
3076
 */
3186
3077
      __Pyx_XDECREF(__pyx_r);
3187
 
      __pyx_t_3 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3078
      __pyx_t_3 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3188
3079
      __Pyx_GOTREF(__pyx_t_3);
3189
3080
      __pyx_r = __pyx_t_3;
3190
3081
      __pyx_t_3 = 0;
3193
3084
    }
3194
3085
    __pyx_L6:;
3195
3086
 
3196
 
    /* "/home/denis/work/gevent/gevent/core.pyx":307
 
3087
    /* "gevent/core.pyx":264
3197
3088
 *             if result < 0:
3198
3089
 *                 return result
3199
3090
 *             self._delref()             # <<<<<<<<<<<<<<
3200
3091
 *             return result
3201
3092
 * 
3202
3093
 */
3203
 
    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_4core_event *)((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->__pyx_vtab)->_delref(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3094
    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_4core_event *)((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->__pyx_vtab)->_delref(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3204
3095
    __Pyx_GOTREF(__pyx_t_3);
3205
3096
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3206
3097
 
3207
 
    /* "/home/denis/work/gevent/gevent/core.pyx":308
 
3098
    /* "gevent/core.pyx":265
3208
3099
 *                 return result
3209
3100
 *             self._delref()
3210
3101
 *             return result             # <<<<<<<<<<<<<<
3212
3103
 *     def __repr__(self):
3213
3104
 */
3214
3105
    __Pyx_XDECREF(__pyx_r);
3215
 
    __pyx_t_3 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3106
    __pyx_t_3 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3216
3107
    __Pyx_GOTREF(__pyx_t_3);
3217
3108
    __pyx_r = __pyx_t_3;
3218
3109
    __pyx_t_3 = 0;
3228
3119
  __Pyx_AddTraceback("gevent.core.event.cancel");
3229
3120
  __pyx_r = NULL;
3230
3121
  __pyx_L0:;
3231
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
3232
3122
  __Pyx_XGIVEREF(__pyx_r);
3233
3123
  __Pyx_RefNannyFinishContext();
3234
3124
  return __pyx_r;
3235
3125
}
3236
3126
 
3237
 
/* "/home/denis/work/gevent/gevent/core.pyx":310
 
3127
/* "gevent/core.pyx":267
3238
3128
 *             return result
3239
3129
 * 
3240
3130
 *     def __repr__(self):             # <<<<<<<<<<<<<<
3242
3132
 *             pending = ' pending'
3243
3133
 */
3244
3134
 
3245
 
static PyObject *__pyx_pf_6gevent_4core_5event___repr__(PyObject *__pyx_v_self); /*proto*/
3246
 
static PyObject *__pyx_pf_6gevent_4core_5event___repr__(PyObject *__pyx_v_self) {
 
3135
static PyObject *__pyx_pf_6gevent_4core_5event_3__repr__(PyObject *__pyx_v_self); /*proto*/
 
3136
static PyObject *__pyx_pf_6gevent_4core_5event_3__repr__(PyObject *__pyx_v_self) {
3247
3137
  PyObject *__pyx_v_pending;
3248
3138
  PyObject *__pyx_v_events_str;
3249
3139
  PyObject *__pyx_r = NULL;
3254
3144
  PyObject *__pyx_t_5 = NULL;
3255
3145
  PyObject *__pyx_t_6 = NULL;
3256
3146
  __Pyx_RefNannySetupContext("__repr__");
3257
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
3258
3147
  __pyx_v_pending = Py_None; __Pyx_INCREF(Py_None);
3259
3148
  __pyx_v_events_str = Py_None; __Pyx_INCREF(Py_None);
3260
3149
 
3261
 
  /* "/home/denis/work/gevent/gevent/core.pyx":311
 
3150
  /* "gevent/core.pyx":268
3262
3151
 * 
3263
3152
 *     def __repr__(self):
3264
3153
 *         if self.pending:             # <<<<<<<<<<<<<<
3265
3154
 *             pending = ' pending'
3266
3155
 *         else:
3267
3156
 */
3268
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pending); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3157
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pending); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3269
3158
  __Pyx_GOTREF(__pyx_t_1);
3270
 
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3159
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3271
3160
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3272
3161
  if (__pyx_t_2) {
3273
3162
 
3274
 
    /* "/home/denis/work/gevent/gevent/core.pyx":312
 
3163
    /* "gevent/core.pyx":269
3275
3164
 *     def __repr__(self):
3276
3165
 *         if self.pending:
3277
3166
 *             pending = ' pending'             # <<<<<<<<<<<<<<
3285
3174
  }
3286
3175
  /*else*/ {
3287
3176
 
3288
 
    /* "/home/denis/work/gevent/gevent/core.pyx":314
 
3177
    /* "gevent/core.pyx":271
3289
3178
 *             pending = ' pending'
3290
3179
 *         else:
3291
3180
 *             pending = ''             # <<<<<<<<<<<<<<
3298
3187
  }
3299
3188
  __pyx_L5:;
3300
3189
 
3301
 
  /* "/home/denis/work/gevent/gevent/core.pyx":315
 
3190
  /* "gevent/core.pyx":272
3302
3191
 *         else:
3303
3192
 *             pending = ''
3304
3193
 *         if self.events_str:             # <<<<<<<<<<<<<<
3305
3194
 *             events_str = ' %s' % self.events_str
3306
3195
 *         else:
3307
3196
 */
3308
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__events_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3197
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__events_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3309
3198
  __Pyx_GOTREF(__pyx_t_1);
3310
 
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3199
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3311
3200
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3312
3201
  if (__pyx_t_2) {
3313
3202
 
3314
 
    /* "/home/denis/work/gevent/gevent/core.pyx":316
 
3203
    /* "gevent/core.pyx":273
3315
3204
 *             pending = ''
3316
3205
 *         if self.events_str:
3317
3206
 *             events_str = ' %s' % self.events_str             # <<<<<<<<<<<<<<
3318
3207
 *         else:
3319
3208
 *             events_str = ''
3320
3209
 */
3321
 
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__events_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3210
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__events_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3322
3211
    __Pyx_GOTREF(__pyx_t_1);
3323
 
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3324
 
    __Pyx_GOTREF(__pyx_t_3);
 
3212
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3213
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
3325
3214
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3326
3215
    __Pyx_DECREF(__pyx_v_events_str);
3327
 
    __pyx_v_events_str = __pyx_t_3;
 
3216
    __pyx_v_events_str = ((PyObject *)__pyx_t_3);
3328
3217
    __pyx_t_3 = 0;
3329
3218
    goto __pyx_L6;
3330
3219
  }
3331
3220
  /*else*/ {
3332
3221
 
3333
 
    /* "/home/denis/work/gevent/gevent/core.pyx":318
 
3222
    /* "gevent/core.pyx":275
3334
3223
 *             events_str = ' %s' % self.events_str
3335
3224
 *         else:
3336
3225
 *             events_str = ''             # <<<<<<<<<<<<<<
3337
3226
 *         return '<%s at %s%s fd=%s%s flags=%s cb=%s arg=%s>' % \
3338
 
 *                (type(self).__name__, hex(id(self)), pending, self.fd, events_str, self.flags_str, self._callback, self._arg)
 
3227
 *                (type(self).__name__, hex(id(self)), pending, self.fd, events_str, self.flags_str, self.callback, self.arg)
3339
3228
 */
3340
3229
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
3341
3230
    __Pyx_DECREF(__pyx_v_events_str);
3343
3232
  }
3344
3233
  __pyx_L6:;
3345
3234
 
3346
 
  /* "/home/denis/work/gevent/gevent/core.pyx":319
 
3235
  /* "gevent/core.pyx":276
3347
3236
 *         else:
3348
3237
 *             events_str = ''
3349
3238
 *         return '<%s at %s%s fd=%s%s flags=%s cb=%s arg=%s>' % \             # <<<<<<<<<<<<<<
3350
 
 *                (type(self).__name__, hex(id(self)), pending, self.fd, events_str, self.flags_str, self._callback, self._arg)
 
3239
 *                (type(self).__name__, hex(id(self)), pending, self.fd, events_str, self.flags_str, self.callback, self.arg)
3351
3240
 * 
3352
3241
 */
3353
3242
  __Pyx_XDECREF(__pyx_r);
3354
3243
 
3355
 
  /* "/home/denis/work/gevent/gevent/core.pyx":320
 
3244
  /* "gevent/core.pyx":277
3356
3245
 *             events_str = ''
3357
3246
 *         return '<%s at %s%s fd=%s%s flags=%s cb=%s arg=%s>' % \
3358
 
 *                (type(self).__name__, hex(id(self)), pending, self.fd, events_str, self.flags_str, self._callback, self._arg)             # <<<<<<<<<<<<<<
 
3247
 *                (type(self).__name__, hex(id(self)), pending, self.fd, events_str, self.flags_str, self.callback, self.arg)             # <<<<<<<<<<<<<<
3359
3248
 * 
3360
3249
 *     def __str__(self):
3361
3250
 */
3362
 
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)Py_TYPE(__pyx_v_self)), __pyx_n_s____name__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3251
  __pyx_t_3 = PyObject_GetAttr(((PyObject *)Py_TYPE(__pyx_v_self)), __pyx_n_s____name__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3363
3252
  __Pyx_GOTREF(__pyx_t_3);
3364
 
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3365
 
  __Pyx_GOTREF(__pyx_t_1);
 
3253
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3254
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3366
3255
  __Pyx_INCREF(__pyx_v_self);
3367
3256
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
3368
3257
  __Pyx_GIVEREF(__pyx_v_self);
3369
 
  __pyx_t_4 = PyObject_Call(__pyx_builtin_id, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3258
  __pyx_t_4 = PyObject_Call(__pyx_builtin_id, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3370
3259
  __Pyx_GOTREF(__pyx_t_4);
3371
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3372
 
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3373
 
  __Pyx_GOTREF(__pyx_t_1);
 
3260
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
3261
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3262
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3374
3263
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
3375
3264
  __Pyx_GIVEREF(__pyx_t_4);
3376
3265
  __pyx_t_4 = 0;
3377
 
  __pyx_t_4 = PyObject_Call(__pyx_builtin_hex, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3266
  __pyx_t_4 = PyObject_Call(__pyx_builtin_hex, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3378
3267
  __Pyx_GOTREF(__pyx_t_4);
3379
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3380
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3268
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
3269
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3381
3270
  __Pyx_GOTREF(__pyx_t_1);
3382
 
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flags_str); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3271
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flags_str); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3383
3272
  __Pyx_GOTREF(__pyx_t_5);
3384
 
  __pyx_t_6 = PyTuple_New(8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3385
 
  __Pyx_GOTREF(__pyx_t_6);
 
3273
  __pyx_t_6 = PyTuple_New(8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3274
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
3386
3275
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
3387
3276
  __Pyx_GIVEREF(__pyx_t_3);
3388
3277
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
3397
3286
  __Pyx_GIVEREF(__pyx_v_events_str);
3398
3287
  PyTuple_SET_ITEM(__pyx_t_6, 5, __pyx_t_5);
3399
3288
  __Pyx_GIVEREF(__pyx_t_5);
3400
 
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_callback);
3401
 
  PyTuple_SET_ITEM(__pyx_t_6, 6, ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_callback);
3402
 
  __Pyx_GIVEREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_callback);
3403
 
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_arg);
3404
 
  PyTuple_SET_ITEM(__pyx_t_6, 7, ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_arg);
3405
 
  __Pyx_GIVEREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_arg);
 
3289
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback);
 
3290
  PyTuple_SET_ITEM(__pyx_t_6, 6, ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback);
 
3291
  __Pyx_GIVEREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback);
 
3292
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg);
 
3293
  PyTuple_SET_ITEM(__pyx_t_6, 7, ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg);
 
3294
  __Pyx_GIVEREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg);
3406
3295
  __pyx_t_3 = 0;
3407
3296
  __pyx_t_4 = 0;
3408
3297
  __pyx_t_1 = 0;
3409
3298
  __pyx_t_5 = 0;
3410
 
  __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3411
 
  __Pyx_GOTREF(__pyx_t_5);
3412
 
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3413
 
  __pyx_r = __pyx_t_5;
 
3299
  __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3300
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
 
3301
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
 
3302
  __pyx_r = ((PyObject *)__pyx_t_5);
3414
3303
  __pyx_t_5 = 0;
3415
3304
  goto __pyx_L0;
3416
3305
 
3427
3316
  __pyx_L0:;
3428
3317
  __Pyx_DECREF(__pyx_v_pending);
3429
3318
  __Pyx_DECREF(__pyx_v_events_str);
3430
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
3431
3319
  __Pyx_XGIVEREF(__pyx_r);
3432
3320
  __Pyx_RefNannyFinishContext();
3433
3321
  return __pyx_r;
3434
3322
}
3435
3323
 
3436
 
/* "/home/denis/work/gevent/gevent/core.pyx":322
3437
 
 *                (type(self).__name__, hex(id(self)), pending, self.fd, events_str, self.flags_str, self._callback, self._arg)
 
3324
/* "gevent/core.pyx":279
 
3325
 *                (type(self).__name__, hex(id(self)), pending, self.fd, events_str, self.flags_str, self.callback, self.arg)
3438
3326
 * 
3439
3327
 *     def __str__(self):             # <<<<<<<<<<<<<<
3440
3328
 *         if self.pending:
3441
3329
 *             pending = ' pending'
3442
3330
 */
3443
3331
 
3444
 
static PyObject *__pyx_pf_6gevent_4core_5event___str__(PyObject *__pyx_v_self); /*proto*/
3445
 
static PyObject *__pyx_pf_6gevent_4core_5event___str__(PyObject *__pyx_v_self) {
 
3332
static PyObject *__pyx_pf_6gevent_4core_5event_4__str__(PyObject *__pyx_v_self); /*proto*/
 
3333
static PyObject *__pyx_pf_6gevent_4core_5event_4__str__(PyObject *__pyx_v_self) {
3446
3334
  PyObject *__pyx_v_pending;
3447
3335
  PyObject *__pyx_v_events_str;
3448
3336
  PyObject *__pyx_v_cb;
3454
3342
  PyObject *__pyx_t_4 = NULL;
3455
3343
  PyObject *__pyx_t_5 = NULL;
3456
3344
  __Pyx_RefNannySetupContext("__str__");
3457
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
3458
3345
  __pyx_v_pending = Py_None; __Pyx_INCREF(Py_None);
3459
3346
  __pyx_v_events_str = Py_None; __Pyx_INCREF(Py_None);
3460
3347
  __pyx_v_cb = Py_None; __Pyx_INCREF(Py_None);
3461
3348
  __pyx_v_arg = Py_None; __Pyx_INCREF(Py_None);
3462
3349
 
3463
 
  /* "/home/denis/work/gevent/gevent/core.pyx":323
 
3350
  /* "gevent/core.pyx":280
3464
3351
 * 
3465
3352
 *     def __str__(self):
3466
3353
 *         if self.pending:             # <<<<<<<<<<<<<<
3467
3354
 *             pending = ' pending'
3468
3355
 *         else:
3469
3356
 */
3470
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pending); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3357
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__pending); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3471
3358
  __Pyx_GOTREF(__pyx_t_1);
3472
 
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3359
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3473
3360
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3474
3361
  if (__pyx_t_2) {
3475
3362
 
3476
 
    /* "/home/denis/work/gevent/gevent/core.pyx":324
 
3363
    /* "gevent/core.pyx":281
3477
3364
 *     def __str__(self):
3478
3365
 *         if self.pending:
3479
3366
 *             pending = ' pending'             # <<<<<<<<<<<<<<
3487
3374
  }
3488
3375
  /*else*/ {
3489
3376
 
3490
 
    /* "/home/denis/work/gevent/gevent/core.pyx":326
 
3377
    /* "gevent/core.pyx":283
3491
3378
 *             pending = ' pending'
3492
3379
 *         else:
3493
3380
 *             pending = ''             # <<<<<<<<<<<<<<
3500
3387
  }
3501
3388
  __pyx_L5:;
3502
3389
 
3503
 
  /* "/home/denis/work/gevent/gevent/core.pyx":327
 
3390
  /* "gevent/core.pyx":284
3504
3391
 *         else:
3505
3392
 *             pending = ''
3506
3393
 *         if self.events_str:             # <<<<<<<<<<<<<<
3507
3394
 *             events_str = ' %s' % self.events_str
3508
3395
 *         else:
3509
3396
 */
3510
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__events_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3397
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__events_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3511
3398
  __Pyx_GOTREF(__pyx_t_1);
3512
 
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3399
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3513
3400
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3514
3401
  if (__pyx_t_2) {
3515
3402
 
3516
 
    /* "/home/denis/work/gevent/gevent/core.pyx":328
 
3403
    /* "gevent/core.pyx":285
3517
3404
 *             pending = ''
3518
3405
 *         if self.events_str:
3519
3406
 *             events_str = ' %s' % self.events_str             # <<<<<<<<<<<<<<
3520
3407
 *         else:
3521
3408
 *             events_str = ''
3522
3409
 */
3523
 
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__events_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3410
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__events_str); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3524
3411
    __Pyx_GOTREF(__pyx_t_1);
3525
 
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3526
 
    __Pyx_GOTREF(__pyx_t_3);
 
3412
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3413
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
3527
3414
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3528
3415
    __Pyx_DECREF(__pyx_v_events_str);
3529
 
    __pyx_v_events_str = __pyx_t_3;
 
3416
    __pyx_v_events_str = ((PyObject *)__pyx_t_3);
3530
3417
    __pyx_t_3 = 0;
3531
3418
    goto __pyx_L6;
3532
3419
  }
3533
3420
  /*else*/ {
3534
3421
 
3535
 
    /* "/home/denis/work/gevent/gevent/core.pyx":330
 
3422
    /* "gevent/core.pyx":287
3536
3423
 *             events_str = ' %s' % self.events_str
3537
3424
 *         else:
3538
3425
 *             events_str = ''             # <<<<<<<<<<<<<<
3539
 
 *         cb = str(self._callback).replace('\n', '\n' + ' ' * 8)
3540
 
 *         arg = pformat(self._arg, indent=2).replace('\n', '\n' + ' ' * 8)
 
3426
 *         cb = str(self.callback).replace('\n', '\n' + ' ' * 8)
 
3427
 *         arg = pformat(self.arg, indent=2).replace('\n', '\n' + ' ' * 8)
3541
3428
 */
3542
3429
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
3543
3430
    __Pyx_DECREF(__pyx_v_events_str);
3545
3432
  }
3546
3433
  __pyx_L6:;
3547
3434
 
3548
 
  /* "/home/denis/work/gevent/gevent/core.pyx":331
 
3435
  /* "gevent/core.pyx":288
3549
3436
 *         else:
3550
3437
 *             events_str = ''
3551
 
 *         cb = str(self._callback).replace('\n', '\n' + ' ' * 8)             # <<<<<<<<<<<<<<
3552
 
 *         arg = pformat(self._arg, indent=2).replace('\n', '\n' + ' ' * 8)
 
3438
 *         cb = str(self.callback).replace('\n', '\n' + ' ' * 8)             # <<<<<<<<<<<<<<
 
3439
 *         arg = pformat(self.arg, indent=2).replace('\n', '\n' + ' ' * 8)
3553
3440
 *         return '%s%s fd=%s%s flags=%s\n  cb  = %s\n  arg = %s' % \
3554
3441
 */
3555
 
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3556
 
  __Pyx_GOTREF(__pyx_t_3);
3557
 
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_callback);
3558
 
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_callback);
3559
 
  __Pyx_GIVEREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_callback);
3560
 
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3561
 
  __Pyx_GOTREF(__pyx_t_1);
3562
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3563
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__replace); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3564
 
  __Pyx_GOTREF(__pyx_t_3);
3565
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3566
 
  __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_kp_s_10), __pyx_int_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3567
 
  __Pyx_GOTREF(__pyx_t_1);
3568
 
  __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s_9), __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3569
 
  __Pyx_GOTREF(__pyx_t_4);
3570
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3571
 
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3572
 
  __Pyx_GOTREF(__pyx_t_1);
 
3442
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3443
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
3444
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback);
 
3445
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback);
 
3446
  __Pyx_GIVEREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback);
 
3447
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3448
  __Pyx_GOTREF(__pyx_t_1);
 
3449
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
 
3450
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__replace); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3451
  __Pyx_GOTREF(__pyx_t_3);
 
3452
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
3453
  __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_kp_s_10), __pyx_int_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3454
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
3455
  __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s_9), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3456
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
 
3457
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
3458
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3459
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
3573
3460
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
3574
3461
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_9));
3575
3462
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
3576
 
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
3577
 
  __Pyx_GIVEREF(__pyx_t_4);
 
3463
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_t_4));
 
3464
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
3578
3465
  __pyx_t_4 = 0;
3579
 
  __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3466
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3580
3467
  __Pyx_GOTREF(__pyx_t_4);
3581
3468
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3582
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
3469
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
3583
3470
  __Pyx_DECREF(__pyx_v_cb);
3584
3471
  __pyx_v_cb = __pyx_t_4;
3585
3472
  __pyx_t_4 = 0;
3586
3473
 
3587
 
  /* "/home/denis/work/gevent/gevent/core.pyx":332
 
3474
  /* "gevent/core.pyx":289
3588
3475
 *             events_str = ''
3589
 
 *         cb = str(self._callback).replace('\n', '\n' + ' ' * 8)
3590
 
 *         arg = pformat(self._arg, indent=2).replace('\n', '\n' + ' ' * 8)             # <<<<<<<<<<<<<<
 
3476
 *         cb = str(self.callback).replace('\n', '\n' + ' ' * 8)
 
3477
 *         arg = pformat(self.arg, indent=2).replace('\n', '\n' + ' ' * 8)             # <<<<<<<<<<<<<<
3591
3478
 *         return '%s%s fd=%s%s flags=%s\n  cb  = %s\n  arg = %s' % \
3592
3479
 *                (type(self).__name__, pending, self.fd, events_str, self.flags_str, cb, arg)
3593
3480
 */
3594
 
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__pformat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3481
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__pformat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3595
3482
  __Pyx_GOTREF(__pyx_t_4);
3596
 
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3597
 
  __Pyx_GOTREF(__pyx_t_1);
3598
 
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_arg);
3599
 
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_arg);
3600
 
  __Pyx_GIVEREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->_arg);
3601
 
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3483
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3484
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
3485
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg);
 
3486
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg);
 
3487
  __Pyx_GIVEREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg);
 
3488
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3602
3489
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
3603
 
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__indent), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3604
 
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_4, __pyx_t_1, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3490
  if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__indent), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3491
  __pyx_t_5 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3605
3492
  __Pyx_GOTREF(__pyx_t_5);
3606
3493
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3607
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
3494
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
3608
3495
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
3609
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__replace); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3496
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__replace); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3610
3497
  __Pyx_GOTREF(__pyx_t_3);
3611
3498
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3612
 
  __pyx_t_5 = PyNumber_Multiply(((PyObject *)__pyx_kp_s_10), __pyx_int_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3613
 
  __Pyx_GOTREF(__pyx_t_5);
3614
 
  __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_9), __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3615
 
  __Pyx_GOTREF(__pyx_t_1);
3616
 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3617
 
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3618
 
  __Pyx_GOTREF(__pyx_t_5);
 
3499
  __pyx_t_5 = PyNumber_Multiply(((PyObject *)__pyx_kp_s_10), __pyx_int_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3500
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
 
3501
  __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_9), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3502
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
3503
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
 
3504
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3505
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
3619
3506
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_9));
3620
3507
  PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_9));
3621
3508
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_9));
3622
 
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
3623
 
  __Pyx_GIVEREF(__pyx_t_1);
 
3509
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_1));
 
3510
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
3624
3511
  __pyx_t_1 = 0;
3625
 
  __pyx_t_1 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3512
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3626
3513
  __Pyx_GOTREF(__pyx_t_1);
3627
3514
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3628
 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
3515
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
3629
3516
  __Pyx_DECREF(__pyx_v_arg);
3630
3517
  __pyx_v_arg = __pyx_t_1;
3631
3518
  __pyx_t_1 = 0;
3632
3519
 
3633
 
  /* "/home/denis/work/gevent/gevent/core.pyx":333
3634
 
 *         cb = str(self._callback).replace('\n', '\n' + ' ' * 8)
3635
 
 *         arg = pformat(self._arg, indent=2).replace('\n', '\n' + ' ' * 8)
 
3520
  /* "gevent/core.pyx":290
 
3521
 *         cb = str(self.callback).replace('\n', '\n' + ' ' * 8)
 
3522
 *         arg = pformat(self.arg, indent=2).replace('\n', '\n' + ' ' * 8)
3636
3523
 *         return '%s%s fd=%s%s flags=%s\n  cb  = %s\n  arg = %s' % \             # <<<<<<<<<<<<<<
3637
3524
 *                (type(self).__name__, pending, self.fd, events_str, self.flags_str, cb, arg)
3638
3525
 * 
3639
3526
 */
3640
3527
  __Pyx_XDECREF(__pyx_r);
3641
3528
 
3642
 
  /* "/home/denis/work/gevent/gevent/core.pyx":334
3643
 
 *         arg = pformat(self._arg, indent=2).replace('\n', '\n' + ' ' * 8)
 
3529
  /* "gevent/core.pyx":291
 
3530
 *         arg = pformat(self.arg, indent=2).replace('\n', '\n' + ' ' * 8)
3644
3531
 *         return '%s%s fd=%s%s flags=%s\n  cb  = %s\n  arg = %s' % \
3645
3532
 *                (type(self).__name__, pending, self.fd, events_str, self.flags_str, cb, arg)             # <<<<<<<<<<<<<<
3646
3533
 * 
3647
3534
 *     def __enter__(self):
3648
3535
 */
3649
 
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)Py_TYPE(__pyx_v_self)), __pyx_n_s____name__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3536
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)Py_TYPE(__pyx_v_self)), __pyx_n_s____name__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3650
3537
  __Pyx_GOTREF(__pyx_t_1);
3651
 
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fd); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3538
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__fd); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3652
3539
  __Pyx_GOTREF(__pyx_t_5);
3653
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flags_str); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3540
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__flags_str); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3654
3541
  __Pyx_GOTREF(__pyx_t_3);
3655
 
  __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3656
 
  __Pyx_GOTREF(__pyx_t_4);
 
3542
  __pyx_t_4 = PyTuple_New(7); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3543
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
3657
3544
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
3658
3545
  __Pyx_GIVEREF(__pyx_t_1);
3659
3546
  __Pyx_INCREF(__pyx_v_pending);
3675
3562
  __pyx_t_1 = 0;
3676
3563
  __pyx_t_5 = 0;
3677
3564
  __pyx_t_3 = 0;
3678
 
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_11), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3679
 
  __Pyx_GOTREF(__pyx_t_3);
3680
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3681
 
  __pyx_r = __pyx_t_3;
 
3565
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_11), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3566
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
3567
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
 
3568
  __pyx_r = ((PyObject *)__pyx_t_3);
3682
3569
  __pyx_t_3 = 0;
3683
3570
  goto __pyx_L0;
3684
3571
 
3696
3583
  __Pyx_DECREF(__pyx_v_events_str);
3697
3584
  __Pyx_DECREF(__pyx_v_cb);
3698
3585
  __Pyx_DECREF(__pyx_v_arg);
3699
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
3700
3586
  __Pyx_XGIVEREF(__pyx_r);
3701
3587
  __Pyx_RefNannyFinishContext();
3702
3588
  return __pyx_r;
3703
3589
}
3704
3590
 
3705
 
/* "/home/denis/work/gevent/gevent/core.pyx":336
 
3591
/* "gevent/core.pyx":293
3706
3592
 *                (type(self).__name__, pending, self.fd, events_str, self.flags_str, cb, arg)
3707
3593
 * 
3708
3594
 *     def __enter__(self):             # <<<<<<<<<<<<<<
3710
3596
 * 
3711
3597
 */
3712
3598
 
3713
 
static PyObject *__pyx_pf_6gevent_4core_5event___enter__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
3714
 
static PyObject *__pyx_pf_6gevent_4core_5event___enter__(PyObject *__pyx_v_self, PyObject *unused) {
 
3599
static PyObject *__pyx_pf_6gevent_4core_5event_5__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
3600
static PyObject *__pyx_pf_6gevent_4core_5event_5__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3715
3601
  PyObject *__pyx_r = NULL;
3716
3602
  __Pyx_RefNannySetupContext("__enter__");
3717
3603
 
3718
 
  /* "/home/denis/work/gevent/gevent/core.pyx":337
 
3604
  /* "gevent/core.pyx":294
3719
3605
 * 
3720
3606
 *     def __enter__(self):
3721
3607
 *         return self             # <<<<<<<<<<<<<<
3734
3620
  return __pyx_r;
3735
3621
}
3736
3622
 
3737
 
/* "/home/denis/work/gevent/gevent/core.pyx":339
 
3623
/* "gevent/core.pyx":296
3738
3624
 *         return self
3739
3625
 * 
3740
3626
 *     def __exit__(self, *exit_args):             # <<<<<<<<<<<<<<
3742
3628
 * 
3743
3629
 */
3744
3630
 
3745
 
static PyObject *__pyx_pf_6gevent_4core_5event___exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3746
 
static PyObject *__pyx_pf_6gevent_4core_5event___exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
3631
static PyObject *__pyx_pf_6gevent_4core_5event_6__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
3632
static PyObject *__pyx_pf_6gevent_4core_5event_6__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3747
3633
  PyObject *__pyx_v_exit_args = 0;
3748
3634
  PyObject *__pyx_r = NULL;
3749
3635
  PyObject *__pyx_t_1 = NULL;
3753
3639
  __Pyx_INCREF(__pyx_args);
3754
3640
  __pyx_v_exit_args = __pyx_args;
3755
3641
 
3756
 
  /* "/home/denis/work/gevent/gevent/core.pyx":340
 
3642
  /* "gevent/core.pyx":297
3757
3643
 * 
3758
3644
 *     def __exit__(self, *exit_args):
3759
3645
 *         self.cancel()             # <<<<<<<<<<<<<<
3760
3646
 * 
3761
3647
 * 
3762
3648
 */
3763
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cancel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3649
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__cancel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3764
3650
  __Pyx_GOTREF(__pyx_t_1);
3765
 
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3651
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3766
3652
  __Pyx_GOTREF(__pyx_t_2);
3767
3653
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3768
3654
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3781
3667
  return __pyx_r;
3782
3668
}
3783
3669
 
3784
 
/* "/home/denis/work/gevent/gevent/core.pyx":346
 
3670
/* "gevent/core.pyx":154
 
3671
 *     """
 
3672
 *     cdef event_t ev
 
3673
 *     cdef public object callback             # <<<<<<<<<<<<<<
 
3674
 *     cdef public object arg
 
3675
 *     cdef int _incref  # 1 if we already INCREFed this object once (because libevent references it)
 
3676
 */
 
3677
 
 
3678
static PyObject *__pyx_pf_6gevent_4core_5event_8callback___get__(PyObject *__pyx_v_self); /*proto*/
 
3679
static PyObject *__pyx_pf_6gevent_4core_5event_8callback___get__(PyObject *__pyx_v_self) {
 
3680
  PyObject *__pyx_r = NULL;
 
3681
  __Pyx_RefNannySetupContext("__get__");
 
3682
  __Pyx_XDECREF(__pyx_r);
 
3683
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback);
 
3684
  __pyx_r = ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback;
 
3685
  goto __pyx_L0;
 
3686
 
 
3687
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
3688
  __pyx_L0:;
 
3689
  __Pyx_XGIVEREF(__pyx_r);
 
3690
  __Pyx_RefNannyFinishContext();
 
3691
  return __pyx_r;
 
3692
}
 
3693
 
 
3694
static int __pyx_pf_6gevent_4core_5event_8callback_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
 
3695
static int __pyx_pf_6gevent_4core_5event_8callback_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
 
3696
  int __pyx_r;
 
3697
  __Pyx_RefNannySetupContext("__set__");
 
3698
  __Pyx_INCREF(__pyx_v_value);
 
3699
  __Pyx_GIVEREF(__pyx_v_value);
 
3700
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback);
 
3701
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback);
 
3702
  ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback = __pyx_v_value;
 
3703
 
 
3704
  __pyx_r = 0;
 
3705
  __Pyx_RefNannyFinishContext();
 
3706
  return __pyx_r;
 
3707
}
 
3708
 
 
3709
static int __pyx_pf_6gevent_4core_5event_8callback_2__del__(PyObject *__pyx_v_self); /*proto*/
 
3710
static int __pyx_pf_6gevent_4core_5event_8callback_2__del__(PyObject *__pyx_v_self) {
 
3711
  int __pyx_r;
 
3712
  __Pyx_RefNannySetupContext("__del__");
 
3713
  __Pyx_INCREF(Py_None);
 
3714
  __Pyx_GIVEREF(Py_None);
 
3715
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback);
 
3716
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback);
 
3717
  ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->callback = Py_None;
 
3718
 
 
3719
  __pyx_r = 0;
 
3720
  __Pyx_RefNannyFinishContext();
 
3721
  return __pyx_r;
 
3722
}
 
3723
 
 
3724
/* "gevent/core.pyx":155
 
3725
 *     cdef event_t ev
 
3726
 *     cdef public object callback
 
3727
 *     cdef public object arg             # <<<<<<<<<<<<<<
 
3728
 *     cdef int _incref  # 1 if we already INCREFed this object once (because libevent references it)
 
3729
 * 
 
3730
 */
 
3731
 
 
3732
static PyObject *__pyx_pf_6gevent_4core_5event_3arg___get__(PyObject *__pyx_v_self); /*proto*/
 
3733
static PyObject *__pyx_pf_6gevent_4core_5event_3arg___get__(PyObject *__pyx_v_self) {
 
3734
  PyObject *__pyx_r = NULL;
 
3735
  __Pyx_RefNannySetupContext("__get__");
 
3736
  __Pyx_XDECREF(__pyx_r);
 
3737
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg);
 
3738
  __pyx_r = ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg;
 
3739
  goto __pyx_L0;
 
3740
 
 
3741
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
3742
  __pyx_L0:;
 
3743
  __Pyx_XGIVEREF(__pyx_r);
 
3744
  __Pyx_RefNannyFinishContext();
 
3745
  return __pyx_r;
 
3746
}
 
3747
 
 
3748
static int __pyx_pf_6gevent_4core_5event_3arg_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
 
3749
static int __pyx_pf_6gevent_4core_5event_3arg_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
 
3750
  int __pyx_r;
 
3751
  __Pyx_RefNannySetupContext("__set__");
 
3752
  __Pyx_INCREF(__pyx_v_value);
 
3753
  __Pyx_GIVEREF(__pyx_v_value);
 
3754
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg);
 
3755
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg);
 
3756
  ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg = __pyx_v_value;
 
3757
 
 
3758
  __pyx_r = 0;
 
3759
  __Pyx_RefNannyFinishContext();
 
3760
  return __pyx_r;
 
3761
}
 
3762
 
 
3763
static int __pyx_pf_6gevent_4core_5event_3arg_2__del__(PyObject *__pyx_v_self); /*proto*/
 
3764
static int __pyx_pf_6gevent_4core_5event_3arg_2__del__(PyObject *__pyx_v_self) {
 
3765
  int __pyx_r;
 
3766
  __Pyx_RefNannySetupContext("__del__");
 
3767
  __Pyx_INCREF(Py_None);
 
3768
  __Pyx_GIVEREF(Py_None);
 
3769
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg);
 
3770
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg);
 
3771
  ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)->arg = Py_None;
 
3772
 
 
3773
  __pyx_r = 0;
 
3774
  __Pyx_RefNannyFinishContext();
 
3775
  return __pyx_r;
 
3776
}
 
3777
 
 
3778
/* "gevent/core.pyx":303
3785
3779
 *     """Create a new scheduled event with evtype=EV_READ"""
3786
3780
 * 
3787
3781
 *     def __init__(self, int handle, callback, timeout=None, arg=None, persist=False):             # <<<<<<<<<<<<<<
3829
3823
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__callback);
3830
3824
      if (likely(values[1])) kw_args--;
3831
3825
      else {
3832
 
        __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
3826
        __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3833
3827
      }
3834
3828
      case  2:
3835
 
      if (kw_args > 1) {
 
3829
      if (kw_args > 0) {
3836
3830
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__timeout);
3837
 
        if (unlikely(value)) { values[2] = value; kw_args--; }
 
3831
        if (value) { values[2] = value; kw_args--; }
3838
3832
      }
3839
3833
      case  3:
3840
 
      if (kw_args > 1) {
 
3834
      if (kw_args > 0) {
3841
3835
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arg);
3842
 
        if (unlikely(value)) { values[3] = value; kw_args--; }
 
3836
        if (value) { values[3] = value; kw_args--; }
3843
3837
      }
3844
3838
      case  4:
3845
 
      if (kw_args > 1) {
 
3839
      if (kw_args > 0) {
3846
3840
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__persist);
3847
 
        if (unlikely(value)) { values[4] = value; kw_args--; }
 
3841
        if (value) { values[4] = value; kw_args--; }
3848
3842
      }
3849
3843
    }
3850
3844
    if (unlikely(kw_args > 0)) {
3851
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
3845
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3852
3846
    }
3853
 
    __pyx_v_handle = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
3847
    __pyx_v_handle = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3854
3848
    __pyx_v_callback = values[1];
3855
3849
    __pyx_v_timeout = values[2];
3856
3850
    __pyx_v_arg = values[3];
3868
3862
      __pyx_v_timeout = PyTuple_GET_ITEM(__pyx_args, 2);
3869
3863
      case  2:
3870
3864
      __pyx_v_callback = PyTuple_GET_ITEM(__pyx_args, 1);
3871
 
      __pyx_v_handle = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
3865
      __pyx_v_handle = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3872
3866
      break;
3873
3867
      default: goto __pyx_L5_argtuple_error;
3874
3868
    }
3875
3869
  }
3876
3870
  goto __pyx_L4_argument_unpacking_done;
3877
3871
  __pyx_L5_argtuple_error:;
3878
 
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
3872
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3879
3873
  __pyx_L3_error:;
3880
3874
  __Pyx_AddTraceback("gevent.core.read_event.__init__");
 
3875
  __Pyx_RefNannyFinishContext();
3881
3876
  return -1;
3882
3877
  __pyx_L4_argument_unpacking_done:;
3883
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
3884
 
  __Pyx_INCREF(__pyx_v_callback);
3885
 
  __Pyx_INCREF(__pyx_v_timeout);
3886
 
  __Pyx_INCREF(__pyx_v_arg);
3887
 
  __Pyx_INCREF(__pyx_v_persist);
3888
3878
 
3889
 
  /* "/home/denis/work/gevent/gevent/core.pyx":347
 
3879
  /* "gevent/core.pyx":304
3890
3880
 * 
3891
3881
 *     def __init__(self, int handle, callback, timeout=None, arg=None, persist=False):
3892
3882
 *         cdef short evtype = EV_READ             # <<<<<<<<<<<<<<
3895
3885
 */
3896
3886
  __pyx_v_evtype = EV_READ;
3897
3887
 
3898
 
  /* "/home/denis/work/gevent/gevent/core.pyx":348
 
3888
  /* "gevent/core.pyx":305
3899
3889
 *     def __init__(self, int handle, callback, timeout=None, arg=None, persist=False):
3900
3890
 *         cdef short evtype = EV_READ
3901
3891
 *         if persist:             # <<<<<<<<<<<<<<
3902
3892
 *             evtype = evtype | EV_PERSIST
3903
3893
 *         event.__init__(self, evtype, handle, callback, arg)
3904
3894
 */
3905
 
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_persist); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3895
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_persist); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3906
3896
  if (__pyx_t_1) {
3907
3897
 
3908
 
    /* "/home/denis/work/gevent/gevent/core.pyx":349
 
3898
    /* "gevent/core.pyx":306
3909
3899
 *         cdef short evtype = EV_READ
3910
3900
 *         if persist:
3911
3901
 *             evtype = evtype | EV_PERSIST             # <<<<<<<<<<<<<<
3917
3907
  }
3918
3908
  __pyx_L6:;
3919
3909
 
3920
 
  /* "/home/denis/work/gevent/gevent/core.pyx":350
 
3910
  /* "gevent/core.pyx":307
3921
3911
 *         if persist:
3922
3912
 *             evtype = evtype | EV_PERSIST
3923
3913
 *         event.__init__(self, evtype, handle, callback, arg)             # <<<<<<<<<<<<<<
3924
3914
 *         self.add(timeout)
3925
3915
 * 
3926
3916
 */
3927
 
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_event)), __pyx_n_s____init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3917
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_event)), __pyx_n_s____init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3928
3918
  __Pyx_GOTREF(__pyx_t_2);
3929
 
  __pyx_t_3 = PyInt_FromLong(__pyx_v_evtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3919
  __pyx_t_3 = PyInt_FromLong(__pyx_v_evtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3930
3920
  __Pyx_GOTREF(__pyx_t_3);
3931
 
  __pyx_t_4 = PyInt_FromLong(__pyx_v_handle); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3921
  __pyx_t_4 = PyInt_FromLong(__pyx_v_handle); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3932
3922
  __Pyx_GOTREF(__pyx_t_4);
3933
 
  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3934
 
  __Pyx_GOTREF(__pyx_t_5);
 
3923
  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3924
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
3935
3925
  __Pyx_INCREF(__pyx_v_self);
3936
3926
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self);
3937
3927
  __Pyx_GIVEREF(__pyx_v_self);
3947
3937
  __Pyx_GIVEREF(__pyx_v_arg);
3948
3938
  __pyx_t_3 = 0;
3949
3939
  __pyx_t_4 = 0;
3950
 
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3940
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3951
3941
  __Pyx_GOTREF(__pyx_t_4);
3952
3942
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3953
 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
3943
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
3954
3944
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3955
3945
 
3956
 
  /* "/home/denis/work/gevent/gevent/core.pyx":351
 
3946
  /* "gevent/core.pyx":308
3957
3947
 *             evtype = evtype | EV_PERSIST
3958
3948
 *         event.__init__(self, evtype, handle, callback, arg)
3959
3949
 *         self.add(timeout)             # <<<<<<<<<<<<<<
3960
3950
 * 
3961
3951
 * 
3962
3952
 */
3963
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__add); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3953
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__add); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3964
3954
  __Pyx_GOTREF(__pyx_t_4);
3965
 
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3966
 
  __Pyx_GOTREF(__pyx_t_5);
 
3955
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3956
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
3967
3957
  __Pyx_INCREF(__pyx_v_timeout);
3968
3958
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_timeout);
3969
3959
  __Pyx_GIVEREF(__pyx_v_timeout);
3970
 
  __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3960
  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3971
3961
  __Pyx_GOTREF(__pyx_t_2);
3972
3962
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3973
 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
3963
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
3974
3964
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3975
3965
 
3976
3966
  __pyx_r = 0;
3983
3973
  __Pyx_AddTraceback("gevent.core.read_event.__init__");
3984
3974
  __pyx_r = -1;
3985
3975
  __pyx_L0:;
3986
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
3987
 
  __Pyx_DECREF(__pyx_v_callback);
3988
 
  __Pyx_DECREF(__pyx_v_timeout);
3989
 
  __Pyx_DECREF(__pyx_v_arg);
3990
 
  __Pyx_DECREF(__pyx_v_persist);
3991
3976
  __Pyx_RefNannyFinishContext();
3992
3977
  return __pyx_r;
3993
3978
}
3994
3979
 
3995
 
/* "/home/denis/work/gevent/gevent/core.pyx":357
 
3980
/* "gevent/core.pyx":314
3996
3981
 *     """Create a new scheduled event with evtype=EV_WRITE"""
3997
3982
 * 
3998
3983
 *     def __init__(self, int handle, callback, timeout=None, arg=None, persist=False):             # <<<<<<<<<<<<<<
4040
4025
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__callback);
4041
4026
      if (likely(values[1])) kw_args--;
4042
4027
      else {
4043
 
        __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4028
        __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4044
4029
      }
4045
4030
      case  2:
4046
 
      if (kw_args > 1) {
 
4031
      if (kw_args > 0) {
4047
4032
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__timeout);
4048
 
        if (unlikely(value)) { values[2] = value; kw_args--; }
 
4033
        if (value) { values[2] = value; kw_args--; }
4049
4034
      }
4050
4035
      case  3:
4051
 
      if (kw_args > 1) {
 
4036
      if (kw_args > 0) {
4052
4037
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arg);
4053
 
        if (unlikely(value)) { values[3] = value; kw_args--; }
 
4038
        if (value) { values[3] = value; kw_args--; }
4054
4039
      }
4055
4040
      case  4:
4056
 
      if (kw_args > 1) {
 
4041
      if (kw_args > 0) {
4057
4042
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__persist);
4058
 
        if (unlikely(value)) { values[4] = value; kw_args--; }
 
4043
        if (value) { values[4] = value; kw_args--; }
4059
4044
      }
4060
4045
    }
4061
4046
    if (unlikely(kw_args > 0)) {
4062
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4047
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4063
4048
    }
4064
 
    __pyx_v_handle = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4049
    __pyx_v_handle = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4065
4050
    __pyx_v_callback = values[1];
4066
4051
    __pyx_v_timeout = values[2];
4067
4052
    __pyx_v_arg = values[3];
4079
4064
      __pyx_v_timeout = PyTuple_GET_ITEM(__pyx_args, 2);
4080
4065
      case  2:
4081
4066
      __pyx_v_callback = PyTuple_GET_ITEM(__pyx_args, 1);
4082
 
      __pyx_v_handle = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4067
      __pyx_v_handle = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4083
4068
      break;
4084
4069
      default: goto __pyx_L5_argtuple_error;
4085
4070
    }
4086
4071
  }
4087
4072
  goto __pyx_L4_argument_unpacking_done;
4088
4073
  __pyx_L5_argtuple_error:;
4089
 
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4074
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4090
4075
  __pyx_L3_error:;
4091
4076
  __Pyx_AddTraceback("gevent.core.write_event.__init__");
 
4077
  __Pyx_RefNannyFinishContext();
4092
4078
  return -1;
4093
4079
  __pyx_L4_argument_unpacking_done:;
4094
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
4095
 
  __Pyx_INCREF(__pyx_v_callback);
4096
 
  __Pyx_INCREF(__pyx_v_timeout);
4097
 
  __Pyx_INCREF(__pyx_v_arg);
4098
 
  __Pyx_INCREF(__pyx_v_persist);
4099
4080
 
4100
 
  /* "/home/denis/work/gevent/gevent/core.pyx":358
 
4081
  /* "gevent/core.pyx":315
4101
4082
 * 
4102
4083
 *     def __init__(self, int handle, callback, timeout=None, arg=None, persist=False):
4103
4084
 *         cdef short evtype = EV_WRITE             # <<<<<<<<<<<<<<
4106
4087
 */
4107
4088
  __pyx_v_evtype = EV_WRITE;
4108
4089
 
4109
 
  /* "/home/denis/work/gevent/gevent/core.pyx":359
 
4090
  /* "gevent/core.pyx":316
4110
4091
 *     def __init__(self, int handle, callback, timeout=None, arg=None, persist=False):
4111
4092
 *         cdef short evtype = EV_WRITE
4112
4093
 *         if persist:             # <<<<<<<<<<<<<<
4113
4094
 *             evtype = evtype | EV_PERSIST
4114
4095
 *         event.__init__(self, evtype, handle, callback, arg)
4115
4096
 */
4116
 
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_persist); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4097
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_persist); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4117
4098
  if (__pyx_t_1) {
4118
4099
 
4119
 
    /* "/home/denis/work/gevent/gevent/core.pyx":360
 
4100
    /* "gevent/core.pyx":317
4120
4101
 *         cdef short evtype = EV_WRITE
4121
4102
 *         if persist:
4122
4103
 *             evtype = evtype | EV_PERSIST             # <<<<<<<<<<<<<<
4128
4109
  }
4129
4110
  __pyx_L6:;
4130
4111
 
4131
 
  /* "/home/denis/work/gevent/gevent/core.pyx":361
 
4112
  /* "gevent/core.pyx":318
4132
4113
 *         if persist:
4133
4114
 *             evtype = evtype | EV_PERSIST
4134
4115
 *         event.__init__(self, evtype, handle, callback, arg)             # <<<<<<<<<<<<<<
4135
4116
 *         self.add(timeout)
4136
4117
 * 
4137
4118
 */
4138
 
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_event)), __pyx_n_s____init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4119
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_event)), __pyx_n_s____init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4139
4120
  __Pyx_GOTREF(__pyx_t_2);
4140
 
  __pyx_t_3 = PyInt_FromLong(__pyx_v_evtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4121
  __pyx_t_3 = PyInt_FromLong(__pyx_v_evtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4141
4122
  __Pyx_GOTREF(__pyx_t_3);
4142
 
  __pyx_t_4 = PyInt_FromLong(__pyx_v_handle); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4123
  __pyx_t_4 = PyInt_FromLong(__pyx_v_handle); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4143
4124
  __Pyx_GOTREF(__pyx_t_4);
4144
 
  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4145
 
  __Pyx_GOTREF(__pyx_t_5);
 
4125
  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4126
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
4146
4127
  __Pyx_INCREF(__pyx_v_self);
4147
4128
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self);
4148
4129
  __Pyx_GIVEREF(__pyx_v_self);
4158
4139
  __Pyx_GIVEREF(__pyx_v_arg);
4159
4140
  __pyx_t_3 = 0;
4160
4141
  __pyx_t_4 = 0;
4161
 
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4142
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4162
4143
  __Pyx_GOTREF(__pyx_t_4);
4163
4144
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4164
 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
4145
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
4165
4146
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4166
4147
 
4167
 
  /* "/home/denis/work/gevent/gevent/core.pyx":362
 
4148
  /* "gevent/core.pyx":319
4168
4149
 *             evtype = evtype | EV_PERSIST
4169
4150
 *         event.__init__(self, evtype, handle, callback, arg)
4170
4151
 *         self.add(timeout)             # <<<<<<<<<<<<<<
4171
4152
 * 
4172
4153
 * 
4173
4154
 */
4174
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__add); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4155
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__add); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4175
4156
  __Pyx_GOTREF(__pyx_t_4);
4176
 
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4177
 
  __Pyx_GOTREF(__pyx_t_5);
 
4157
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4158
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
4178
4159
  __Pyx_INCREF(__pyx_v_timeout);
4179
4160
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_timeout);
4180
4161
  __Pyx_GIVEREF(__pyx_v_timeout);
4181
 
  __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4162
  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4182
4163
  __Pyx_GOTREF(__pyx_t_2);
4183
4164
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4184
 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
4165
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
4185
4166
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4186
4167
 
4187
4168
  __pyx_r = 0;
4194
4175
  __Pyx_AddTraceback("gevent.core.write_event.__init__");
4195
4176
  __pyx_r = -1;
4196
4177
  __pyx_L0:;
4197
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
4198
 
  __Pyx_DECREF(__pyx_v_callback);
4199
 
  __Pyx_DECREF(__pyx_v_timeout);
4200
 
  __Pyx_DECREF(__pyx_v_arg);
4201
 
  __Pyx_DECREF(__pyx_v_persist);
4202
4178
  __Pyx_RefNannyFinishContext();
4203
4179
  return __pyx_r;
4204
4180
}
4205
4181
 
4206
 
/* "/home/denis/work/gevent/gevent/core.pyx":368
 
4182
/* "gevent/core.pyx":325
4207
4183
 *     """Create a new scheduled event with evtype=EV_READ|EV_WRITE"""
4208
4184
 * 
4209
4185
 *     def __init__(self, int handle, callback, timeout=None, arg=None, persist=False):             # <<<<<<<<<<<<<<
4255
4231
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__handle);
4256
4232
      if (likely(values[1])) kw_args--;
4257
4233
      else {
4258
 
        __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4234
        __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4259
4235
      }
4260
4236
      case  2:
4261
4237
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__callback);
4262
4238
      if (likely(values[2])) kw_args--;
4263
4239
      else {
4264
 
        __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4240
        __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4265
4241
      }
4266
4242
      case  3:
4267
4243
      if (kw_args > 0) {
4268
4244
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__timeout);
4269
 
        if (unlikely(value)) { values[3] = value; kw_args--; }
 
4245
        if (value) { values[3] = value; kw_args--; }
4270
4246
      }
4271
4247
      case  4:
4272
4248
      if (kw_args > 0) {
4273
4249
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arg);
4274
 
        if (unlikely(value)) { values[4] = value; kw_args--; }
 
4250
        if (value) { values[4] = value; kw_args--; }
4275
4251
      }
4276
4252
      case  5:
4277
4253
      if (kw_args > 0) {
4278
4254
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__persist);
4279
 
        if (unlikely(value)) { values[5] = value; kw_args--; }
 
4255
        if (value) { values[5] = value; kw_args--; }
4280
4256
      }
4281
4257
    }
4282
4258
    if (unlikely(kw_args > 0)) {
4283
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4259
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4284
4260
    }
4285
4261
    __pyx_v_self = values[0];
4286
 
    __pyx_v_handle = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4262
    __pyx_v_handle = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4287
4263
    __pyx_v_callback = values[2];
4288
4264
    __pyx_v_timeout = values[3];
4289
4265
    __pyx_v_arg = values[4];
4301
4277
      __pyx_v_timeout = PyTuple_GET_ITEM(__pyx_args, 3);
4302
4278
      case  3:
4303
4279
      __pyx_v_callback = PyTuple_GET_ITEM(__pyx_args, 2);
4304
 
      __pyx_v_handle = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4280
      __pyx_v_handle = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_handle == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4305
4281
      __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
4306
4282
      break;
4307
4283
      default: goto __pyx_L5_argtuple_error;
4309
4285
  }
4310
4286
  goto __pyx_L4_argument_unpacking_done;
4311
4287
  __pyx_L5_argtuple_error:;
4312
 
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4288
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4313
4289
  __pyx_L3_error:;
4314
4290
  __Pyx_AddTraceback("gevent.core.readwrite_event.__init__");
 
4291
  __Pyx_RefNannyFinishContext();
4315
4292
  return NULL;
4316
4293
  __pyx_L4_argument_unpacking_done:;
4317
 
  __Pyx_INCREF(__pyx_v_self);
4318
 
  __Pyx_INCREF(__pyx_v_callback);
4319
 
  __Pyx_INCREF(__pyx_v_timeout);
4320
 
  __Pyx_INCREF(__pyx_v_arg);
4321
 
  __Pyx_INCREF(__pyx_v_persist);
4322
4294
 
4323
 
  /* "/home/denis/work/gevent/gevent/core.pyx":369
 
4295
  /* "gevent/core.pyx":326
4324
4296
 * 
4325
4297
 *     def __init__(self, int handle, callback, timeout=None, arg=None, persist=False):
4326
4298
 *         cdef short evtype = EV_READ|EV_WRITE             # <<<<<<<<<<<<<<
4329
4301
 */
4330
4302
  __pyx_v_evtype = (EV_READ | EV_WRITE);
4331
4303
 
4332
 
  /* "/home/denis/work/gevent/gevent/core.pyx":370
 
4304
  /* "gevent/core.pyx":327
4333
4305
 *     def __init__(self, int handle, callback, timeout=None, arg=None, persist=False):
4334
4306
 *         cdef short evtype = EV_READ|EV_WRITE
4335
4307
 *         if persist:             # <<<<<<<<<<<<<<
4336
4308
 *             evtype = evtype | EV_PERSIST
4337
4309
 *         event.__init__(self, evtype, handle, callback, arg)
4338
4310
 */
4339
 
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_persist); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4311
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_persist); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4340
4312
  if (__pyx_t_1) {
4341
4313
 
4342
 
    /* "/home/denis/work/gevent/gevent/core.pyx":371
 
4314
    /* "gevent/core.pyx":328
4343
4315
 *         cdef short evtype = EV_READ|EV_WRITE
4344
4316
 *         if persist:
4345
4317
 *             evtype = evtype | EV_PERSIST             # <<<<<<<<<<<<<<
4351
4323
  }
4352
4324
  __pyx_L6:;
4353
4325
 
4354
 
  /* "/home/denis/work/gevent/gevent/core.pyx":372
 
4326
  /* "gevent/core.pyx":329
4355
4327
 *         if persist:
4356
4328
 *             evtype = evtype | EV_PERSIST
4357
4329
 *         event.__init__(self, evtype, handle, callback, arg)             # <<<<<<<<<<<<<<
4358
4330
 *         self.add(timeout)
4359
4331
 * 
4360
4332
 */
4361
 
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_event)), __pyx_n_s____init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4333
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_event)), __pyx_n_s____init__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4362
4334
  __Pyx_GOTREF(__pyx_t_2);
4363
 
  __pyx_t_3 = PyInt_FromLong(__pyx_v_evtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4335
  __pyx_t_3 = PyInt_FromLong(__pyx_v_evtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4364
4336
  __Pyx_GOTREF(__pyx_t_3);
4365
 
  __pyx_t_4 = PyInt_FromLong(__pyx_v_handle); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4337
  __pyx_t_4 = PyInt_FromLong(__pyx_v_handle); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4366
4338
  __Pyx_GOTREF(__pyx_t_4);
4367
 
  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4368
 
  __Pyx_GOTREF(__pyx_t_5);
 
4339
  __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4340
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
4369
4341
  __Pyx_INCREF(__pyx_v_self);
4370
4342
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self);
4371
4343
  __Pyx_GIVEREF(__pyx_v_self);
4381
4353
  __Pyx_GIVEREF(__pyx_v_arg);
4382
4354
  __pyx_t_3 = 0;
4383
4355
  __pyx_t_4 = 0;
4384
 
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4356
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4385
4357
  __Pyx_GOTREF(__pyx_t_4);
4386
4358
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4387
 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
4359
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
4388
4360
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4389
4361
 
4390
 
  /* "/home/denis/work/gevent/gevent/core.pyx":373
 
4362
  /* "gevent/core.pyx":330
4391
4363
 *             evtype = evtype | EV_PERSIST
4392
4364
 *         event.__init__(self, evtype, handle, callback, arg)
4393
4365
 *         self.add(timeout)             # <<<<<<<<<<<<<<
4394
4366
 * 
4395
4367
 * 
4396
4368
 */
4397
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__add); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4369
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__add); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4398
4370
  __Pyx_GOTREF(__pyx_t_4);
4399
 
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4400
 
  __Pyx_GOTREF(__pyx_t_5);
 
4371
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4372
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
4401
4373
  __Pyx_INCREF(__pyx_v_timeout);
4402
4374
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_timeout);
4403
4375
  __Pyx_GIVEREF(__pyx_v_timeout);
4404
 
  __pyx_t_2 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4376
  __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4405
4377
  __Pyx_GOTREF(__pyx_t_2);
4406
4378
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4407
 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
4379
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
4408
4380
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4409
4381
 
4410
4382
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4417
4389
  __Pyx_AddTraceback("gevent.core.readwrite_event.__init__");
4418
4390
  __pyx_r = NULL;
4419
4391
  __pyx_L0:;
4420
 
  __Pyx_DECREF(__pyx_v_self);
4421
 
  __Pyx_DECREF(__pyx_v_callback);
4422
 
  __Pyx_DECREF(__pyx_v_timeout);
4423
 
  __Pyx_DECREF(__pyx_v_arg);
4424
 
  __Pyx_DECREF(__pyx_v_persist);
4425
4392
  __Pyx_XGIVEREF(__pyx_r);
4426
4393
  __Pyx_RefNannyFinishContext();
4427
4394
  return __pyx_r;
4428
4395
}
4429
4396
 
4430
 
/* "/home/denis/work/gevent/gevent/core.pyx":376
 
4397
/* "gevent/core.pyx":333
4431
4398
 * 
4432
4399
 * 
4433
4400
 * cdef void __simple_handler(int fd, short evtype, void *arg) with gil:             # <<<<<<<<<<<<<<
4448
4415
  PyObject *__pyx_t_7 = NULL;
4449
4416
  PyObject *__pyx_t_8 = NULL;
4450
4417
  int __pyx_t_9;
 
4418
  #ifdef WITH_THREAD
4451
4419
  PyGILState_STATE _save = PyGILState_Ensure();
 
4420
  #endif
4452
4421
  __Pyx_RefNannySetupContext("__simple_handler");
4453
4422
  __pyx_v_args = Py_None; __Pyx_INCREF(Py_None);
4454
4423
  __pyx_v_kwargs = Py_None; __Pyx_INCREF(Py_None);
4455
4424
 
4456
 
  /* "/home/denis/work/gevent/gevent/core.pyx":377
 
4425
  /* "gevent/core.pyx":334
4457
4426
 * 
4458
4427
 * cdef void __simple_handler(int fd, short evtype, void *arg) with gil:
4459
4428
 *     cdef event self = <event>arg             # <<<<<<<<<<<<<<
4460
4429
 *     try:
4461
 
 *         args, kwargs = self._arg
 
4430
 *         args, kwargs = self.arg
4462
4431
 */
4463
4432
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6gevent_4core_event *)__pyx_v_arg)));
4464
4433
  __pyx_v_self = ((struct __pyx_obj_6gevent_4core_event *)__pyx_v_arg);
4465
4434
 
4466
 
  /* "/home/denis/work/gevent/gevent/core.pyx":378
 
4435
  /* "gevent/core.pyx":335
4467
4436
 * cdef void __simple_handler(int fd, short evtype, void *arg) with gil:
4468
4437
 *     cdef event self = <event>arg
4469
4438
 *     try:             # <<<<<<<<<<<<<<
4470
 
 *         args, kwargs = self._arg
4471
 
 *         self._callback(*args, **kwargs)
 
4439
 *         args, kwargs = self.arg
 
4440
 *         self.callback(*args, **kwargs)
4472
4441
 */
4473
4442
  /*try:*/ {
4474
4443
    {
4479
4448
      __Pyx_XGOTREF(__pyx_save_exc_tb);
4480
4449
      /*try:*/ {
4481
4450
 
4482
 
        /* "/home/denis/work/gevent/gevent/core.pyx":379
 
4451
        /* "gevent/core.pyx":336
4483
4452
 *     cdef event self = <event>arg
4484
4453
 *     try:
4485
 
 *         args, kwargs = self._arg             # <<<<<<<<<<<<<<
4486
 
 *         self._callback(*args, **kwargs)
 
4454
 *         args, kwargs = self.arg             # <<<<<<<<<<<<<<
 
4455
 *         self.callback(*args, **kwargs)
4487
4456
 *     except:
4488
4457
 */
4489
 
        if (PyTuple_CheckExact(__pyx_v_self->_arg) && likely(PyTuple_GET_SIZE(__pyx_v_self->_arg) == 2)) {
4490
 
          PyObject* tuple = __pyx_v_self->_arg;
 
4458
        if (PyTuple_CheckExact(__pyx_v_self->arg) && likely(PyTuple_GET_SIZE(__pyx_v_self->arg) == 2)) {
 
4459
          PyObject* tuple = __pyx_v_self->arg;
4491
4460
          __pyx_t_1 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_1);
4492
4461
          __pyx_t_2 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_2);
4493
4462
          __Pyx_DECREF(__pyx_v_args);
4497
4466
          __pyx_v_kwargs = __pyx_t_2;
4498
4467
          __pyx_t_2 = 0;
4499
4468
        } else {
4500
 
          __pyx_t_3 = PyObject_GetIter(__pyx_v_self->_arg); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
 
4469
          __pyx_t_3 = PyObject_GetIter(__pyx_v_self->arg); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
4501
4470
          __Pyx_GOTREF(__pyx_t_3);
4502
 
          __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_3, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
 
4471
          __pyx_t_1 = __Pyx_UnpackItem(__pyx_t_3, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
4503
4472
          __Pyx_GOTREF(__pyx_t_1);
4504
 
          __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_3, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
 
4473
          __pyx_t_2 = __Pyx_UnpackItem(__pyx_t_3, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
4505
4474
          __Pyx_GOTREF(__pyx_t_2);
4506
 
          if (__Pyx_EndUnpack(__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
 
4475
          if (__Pyx_EndUnpack(__pyx_t_3, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
4507
4476
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4508
4477
          __Pyx_DECREF(__pyx_v_args);
4509
4478
          __pyx_v_args = __pyx_t_1;
4513
4482
          __pyx_t_2 = 0;
4514
4483
        }
4515
4484
 
4516
 
        /* "/home/denis/work/gevent/gevent/core.pyx":380
 
4485
        /* "gevent/core.pyx":337
4517
4486
 *     try:
4518
 
 *         args, kwargs = self._arg
4519
 
 *         self._callback(*args, **kwargs)             # <<<<<<<<<<<<<<
 
4487
 *         args, kwargs = self.arg
 
4488
 *         self.callback(*args, **kwargs)             # <<<<<<<<<<<<<<
4520
4489
 *     except:
4521
4490
 *         traceback.print_exc()
4522
4491
 */
4523
 
        __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
 
4492
        __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
4524
4493
        __Pyx_GOTREF(((PyObject *)__pyx_t_2));
4525
 
        __pyx_t_1 = __Pyx_PyEval_CallObjectWithKeywords(__pyx_v_self->_callback, ((PyObject *)__pyx_t_2), __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
 
4494
        __pyx_t_1 = __Pyx_PyEval_CallObjectWithKeywords(__pyx_v_self->callback, ((PyObject *)__pyx_t_2), __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
4526
4495
        __Pyx_GOTREF(__pyx_t_1);
4527
4496
        __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
4528
4497
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4536
4505
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
4537
4506
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
4538
4507
 
4539
 
      /* "/home/denis/work/gevent/gevent/core.pyx":381
4540
 
 *         args, kwargs = self._arg
4541
 
 *         self._callback(*args, **kwargs)
 
4508
      /* "gevent/core.pyx":338
 
4509
 *         args, kwargs = self.arg
 
4510
 *         self.callback(*args, **kwargs)
4542
4511
 *     except:             # <<<<<<<<<<<<<<
4543
4512
 *         traceback.print_exc()
4544
4513
 *         try:
4545
4514
 */
4546
4515
      /*except:*/ {
4547
4516
        __Pyx_AddTraceback("gevent.core.__simple_handler");
4548
 
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
 
4517
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
4549
4518
        __Pyx_GOTREF(__pyx_t_1);
4550
4519
        __Pyx_GOTREF(__pyx_t_2);
4551
4520
        __Pyx_GOTREF(__pyx_t_3);
4552
4521
 
4553
 
        /* "/home/denis/work/gevent/gevent/core.pyx":382
4554
 
 *         self._callback(*args, **kwargs)
 
4522
        /* "gevent/core.pyx":339
 
4523
 *         self.callback(*args, **kwargs)
4555
4524
 *     except:
4556
4525
 *         traceback.print_exc()             # <<<<<<<<<<<<<<
4557
4526
 *         try:
4558
4527
 *             sys.stderr.write('Failed to execute callback for %s\n\n' % (self, ))
4559
4528
 */
4560
 
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
 
4529
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
4561
4530
        __Pyx_GOTREF(__pyx_t_4);
4562
 
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
 
4531
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
4563
4532
        __Pyx_GOTREF(__pyx_t_5);
4564
4533
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4565
 
        __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
 
4534
        __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
4566
4535
        __Pyx_GOTREF(__pyx_t_4);
4567
4536
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4568
4537
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4569
4538
 
4570
 
        /* "/home/denis/work/gevent/gevent/core.pyx":383
 
4539
        /* "gevent/core.pyx":340
4571
4540
 *     except:
4572
4541
 *         traceback.print_exc()
4573
4542
 *         try:             # <<<<<<<<<<<<<<
4582
4551
          __Pyx_XGOTREF(__pyx_save_exc_tb);
4583
4552
          /*try:*/ {
4584
4553
 
4585
 
            /* "/home/denis/work/gevent/gevent/core.pyx":384
 
4554
            /* "gevent/core.pyx":341
4586
4555
 *         traceback.print_exc()
4587
4556
 *         try:
4588
4557
 *             sys.stderr.write('Failed to execute callback for %s\n\n' % (self, ))             # <<<<<<<<<<<<<<
4589
4558
 *         except:
4590
4559
 *             traceback.print_exc()
4591
4560
 */
4592
 
            __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
 
4561
            __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
4593
4562
            __Pyx_GOTREF(__pyx_t_4);
4594
 
            __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__stderr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
 
4563
            __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__stderr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
4595
4564
            __Pyx_GOTREF(__pyx_t_5);
4596
4565
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4597
 
            __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
 
4566
            __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__write); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
4598
4567
            __Pyx_GOTREF(__pyx_t_4);
4599
4568
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4600
 
            __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
4601
 
            __Pyx_GOTREF(__pyx_t_5);
 
4569
            __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
 
4570
            __Pyx_GOTREF(((PyObject *)__pyx_t_5));
4602
4571
            __Pyx_INCREF(((PyObject *)__pyx_v_self));
4603
4572
            PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_self));
4604
4573
            __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
4605
 
            __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
4606
 
            __Pyx_GOTREF(__pyx_t_6);
4607
 
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4608
 
            __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
4609
 
            __Pyx_GOTREF(__pyx_t_5);
4610
 
            PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
4611
 
            __Pyx_GIVEREF(__pyx_t_6);
 
4574
            __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
 
4575
            __Pyx_GOTREF(((PyObject *)__pyx_t_6));
 
4576
            __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
 
4577
            __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
 
4578
            __Pyx_GOTREF(((PyObject *)__pyx_t_5));
 
4579
            PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_6));
 
4580
            __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
4612
4581
            __pyx_t_6 = 0;
4613
 
            __pyx_t_6 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
 
4582
            __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L16_error;}
4614
4583
            __Pyx_GOTREF(__pyx_t_6);
4615
4584
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4616
 
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
4585
            __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
4617
4586
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4618
4587
          }
4619
4588
          __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
4625
4594
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4626
4595
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4627
4596
 
4628
 
          /* "/home/denis/work/gevent/gevent/core.pyx":385
 
4597
          /* "gevent/core.pyx":342
4629
4598
 *         try:
4630
4599
 *             sys.stderr.write('Failed to execute callback for %s\n\n' % (self, ))
4631
4600
 *         except:             # <<<<<<<<<<<<<<
4634
4603
 */
4635
4604
          /*except:*/ {
4636
4605
            __Pyx_AddTraceback("gevent.core.__simple_handler");
4637
 
            if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
 
4606
            if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
4638
4607
            __Pyx_GOTREF(__pyx_t_6);
4639
4608
            __Pyx_GOTREF(__pyx_t_5);
4640
4609
            __Pyx_GOTREF(__pyx_t_4);
4641
4610
 
4642
 
            /* "/home/denis/work/gevent/gevent/core.pyx":386
 
4611
            /* "gevent/core.pyx":343
4643
4612
 *             sys.stderr.write('Failed to execute callback for %s\n\n' % (self, ))
4644
4613
 *         except:
4645
4614
 *             traceback.print_exc()             # <<<<<<<<<<<<<<
4646
4615
 *         sys.exc_clear()
4647
4616
 *     finally:
4648
4617
 */
4649
 
            __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
 
4618
            __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
4650
4619
            __Pyx_GOTREF(__pyx_t_7);
4651
 
            __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
 
4620
            __pyx_t_8 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
4652
4621
            __Pyx_GOTREF(__pyx_t_8);
4653
4622
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4654
 
            __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
 
4623
            __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L18_except_error;}
4655
4624
            __Pyx_GOTREF(__pyx_t_7);
4656
4625
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4657
4626
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4674
4643
          __pyx_L23_try_end:;
4675
4644
        }
4676
4645
 
4677
 
        /* "/home/denis/work/gevent/gevent/core.pyx":387
 
4646
        /* "gevent/core.pyx":344
4678
4647
 *         except:
4679
4648
 *             traceback.print_exc()
4680
4649
 *         sys.exc_clear()             # <<<<<<<<<<<<<<
4681
4650
 *     finally:
4682
4651
 *         if not event_pending(&self.ev, EV_READ|EV_WRITE|EV_SIGNAL|EV_TIMEOUT, NULL):
4683
4652
 */
4684
 
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
 
4653
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
4685
4654
        __Pyx_GOTREF(__pyx_t_4);
4686
 
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__exc_clear); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
 
4655
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__exc_clear); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
4687
4656
        __Pyx_GOTREF(__pyx_t_5);
4688
4657
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4689
 
        __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
 
4658
        __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
4690
4659
        __Pyx_GOTREF(__pyx_t_4);
4691
4660
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4692
4661
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4709
4678
      __pyx_L13_try_end:;
4710
4679
    }
4711
4680
  }
 
4681
 
 
4682
  /* "gevent/core.pyx":346
 
4683
 *         sys.exc_clear()
 
4684
 *     finally:
 
4685
 *         if not event_pending(&self.ev, EV_READ|EV_WRITE|EV_SIGNAL|EV_TIMEOUT, NULL):             # <<<<<<<<<<<<<<
 
4686
 *             self._delref()
 
4687
 * 
 
4688
 */
4712
4689
  /*finally:*/ {
4713
4690
    int __pyx_why;
4714
4691
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
4730
4707
      goto __pyx_L5;
4731
4708
    }
4732
4709
    __pyx_L5:;
4733
 
 
4734
 
    /* "/home/denis/work/gevent/gevent/core.pyx":389
4735
 
 *         sys.exc_clear()
4736
 
 *     finally:
4737
 
 *         if not event_pending(&self.ev, EV_READ|EV_WRITE|EV_SIGNAL|EV_TIMEOUT, NULL):             # <<<<<<<<<<<<<<
4738
 
 *             self._delref()
4739
 
 * 
4740
 
 */
4741
4710
    __pyx_t_9 = (!event_pending((&__pyx_v_self->ev), (((EV_READ | EV_WRITE) | EV_SIGNAL) | EV_TIMEOUT), NULL));
4742
4711
    if (__pyx_t_9) {
4743
4712
 
4744
 
      /* "/home/denis/work/gevent/gevent/core.pyx":390
 
4713
      /* "gevent/core.pyx":347
4745
4714
 *     finally:
4746
4715
 *         if not event_pending(&self.ev, EV_READ|EV_WRITE|EV_SIGNAL|EV_TIMEOUT, NULL):
4747
4716
 *             self._delref()             # <<<<<<<<<<<<<<
4748
4717
 * 
4749
4718
 * 
4750
4719
 */
4751
 
      __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_4core_event *)__pyx_v_self->__pyx_vtab)->_delref(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
 
4720
      __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_4core_event *)__pyx_v_self->__pyx_vtab)->_delref(__pyx_v_self); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
4752
4721
      __Pyx_GOTREF(__pyx_t_3);
4753
4722
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4754
4723
      goto __pyx_L27;
4791
4760
  __Pyx_DECREF(__pyx_v_args);
4792
4761
  __Pyx_DECREF(__pyx_v_kwargs);
4793
4762
  __Pyx_RefNannyFinishContext();
 
4763
  #ifdef WITH_THREAD
4794
4764
  PyGILState_Release(_save);
 
4765
  #endif
4795
4766
}
4796
4767
 
4797
 
/* "/home/denis/work/gevent/gevent/core.pyx":396
 
4768
/* "gevent/core.pyx":353
4798
4769
 *     """Create a new scheduled timer"""
4799
4770
 * 
4800
4771
 *     def __init__(self, float seconds, callback, *args, **kwargs):             # <<<<<<<<<<<<<<
4801
 
 *         self._callback = callback
4802
 
 *         self._arg = (args, kwargs)
 
4772
 *         self.callback = callback
 
4773
 *         self.arg = (args, kwargs)
4803
4774
 */
4804
4775
 
4805
4776
static int __pyx_pf_6gevent_4core_5timer___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4844
4815
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__callback);
4845
4816
      if (likely(values[1])) kw_args--;
4846
4817
      else {
4847
 
        __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4818
        __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4848
4819
      }
4849
4820
    }
4850
4821
    if (unlikely(kw_args > 0)) {
4851
4822
      const Py_ssize_t used_pos_args = (PyTuple_GET_SIZE(__pyx_args) < 2) ? PyTuple_GET_SIZE(__pyx_args) : 2;
4852
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4823
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4853
4824
    }
4854
 
    __pyx_v_seconds = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_seconds == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4825
    __pyx_v_seconds = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_seconds == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4855
4826
    __pyx_v_callback = values[1];
4856
4827
  } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
4857
4828
    goto __pyx_L5_argtuple_error;
4858
4829
  } else {
4859
 
    __pyx_v_seconds = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_seconds == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4830
    __pyx_v_seconds = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_seconds == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4860
4831
    __pyx_v_callback = PyTuple_GET_ITEM(__pyx_args, 1);
4861
4832
  }
4862
4833
  goto __pyx_L4_argument_unpacking_done;
4863
4834
  __pyx_L5_argtuple_error:;
4864
 
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4835
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4865
4836
  __pyx_L3_error:;
4866
4837
  __Pyx_DECREF(__pyx_v_args);
4867
4838
  __Pyx_DECREF(__pyx_v_kwargs);
4868
4839
  __Pyx_AddTraceback("gevent.core.timer.__init__");
 
4840
  __Pyx_RefNannyFinishContext();
4869
4841
  return -1;
4870
4842
  __pyx_L4_argument_unpacking_done:;
4871
4843
 
4872
 
  /* "/home/denis/work/gevent/gevent/core.pyx":397
 
4844
  /* "gevent/core.pyx":354
4873
4845
 * 
4874
4846
 *     def __init__(self, float seconds, callback, *args, **kwargs):
4875
 
 *         self._callback = callback             # <<<<<<<<<<<<<<
4876
 
 *         self._arg = (args, kwargs)
 
4847
 *         self.callback = callback             # <<<<<<<<<<<<<<
 
4848
 *         self.arg = (args, kwargs)
4877
4849
 *         evtimer_set(&self.ev, __simple_handler, <void*>self)
4878
4850
 */
4879
4851
  __Pyx_INCREF(__pyx_v_callback);
4880
4852
  __Pyx_GIVEREF(__pyx_v_callback);
4881
 
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_timer *)__pyx_v_self)->__pyx_base._callback);
4882
 
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_timer *)__pyx_v_self)->__pyx_base._callback);
4883
 
  ((struct __pyx_obj_6gevent_4core_timer *)__pyx_v_self)->__pyx_base._callback = __pyx_v_callback;
 
4853
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_timer *)__pyx_v_self)->__pyx_base.callback);
 
4854
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_timer *)__pyx_v_self)->__pyx_base.callback);
 
4855
  ((struct __pyx_obj_6gevent_4core_timer *)__pyx_v_self)->__pyx_base.callback = __pyx_v_callback;
4884
4856
 
4885
 
  /* "/home/denis/work/gevent/gevent/core.pyx":398
 
4857
  /* "gevent/core.pyx":355
4886
4858
 *     def __init__(self, float seconds, callback, *args, **kwargs):
4887
 
 *         self._callback = callback
4888
 
 *         self._arg = (args, kwargs)             # <<<<<<<<<<<<<<
 
4859
 *         self.callback = callback
 
4860
 *         self.arg = (args, kwargs)             # <<<<<<<<<<<<<<
4889
4861
 *         evtimer_set(&self.ev, __simple_handler, <void*>self)
4890
4862
 *         self.add(seconds)
4891
4863
 */
4892
 
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4893
 
  __Pyx_GOTREF(__pyx_t_1);
4894
 
  __Pyx_INCREF(__pyx_v_args);
4895
 
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_args);
4896
 
  __Pyx_GIVEREF(__pyx_v_args);
4897
 
  __Pyx_INCREF(__pyx_v_kwargs);
4898
 
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_kwargs);
4899
 
  __Pyx_GIVEREF(__pyx_v_kwargs);
4900
 
  __Pyx_GIVEREF(__pyx_t_1);
4901
 
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_timer *)__pyx_v_self)->__pyx_base._arg);
4902
 
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_timer *)__pyx_v_self)->__pyx_base._arg);
4903
 
  ((struct __pyx_obj_6gevent_4core_timer *)__pyx_v_self)->__pyx_base._arg = __pyx_t_1;
 
4864
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4865
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
4866
  __Pyx_INCREF(((PyObject *)__pyx_v_args));
 
4867
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_args));
 
4868
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
 
4869
  __Pyx_INCREF(((PyObject *)__pyx_v_kwargs));
 
4870
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_kwargs));
 
4871
  __Pyx_GIVEREF(((PyObject *)__pyx_v_kwargs));
 
4872
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
 
4873
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_timer *)__pyx_v_self)->__pyx_base.arg);
 
4874
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_timer *)__pyx_v_self)->__pyx_base.arg);
 
4875
  ((struct __pyx_obj_6gevent_4core_timer *)__pyx_v_self)->__pyx_base.arg = ((PyObject *)__pyx_t_1);
4904
4876
  __pyx_t_1 = 0;
4905
4877
 
4906
 
  /* "/home/denis/work/gevent/gevent/core.pyx":399
4907
 
 *         self._callback = callback
4908
 
 *         self._arg = (args, kwargs)
 
4878
  /* "gevent/core.pyx":356
 
4879
 *         self.callback = callback
 
4880
 *         self.arg = (args, kwargs)
4909
4881
 *         evtimer_set(&self.ev, __simple_handler, <void*>self)             # <<<<<<<<<<<<<<
4910
4882
 *         self.add(seconds)
4911
4883
 * 
4912
4884
 */
4913
4885
  evtimer_set((&((struct __pyx_obj_6gevent_4core_timer *)__pyx_v_self)->__pyx_base.ev), __pyx_f_6gevent_4core___simple_handler, ((void *)__pyx_v_self));
4914
4886
 
4915
 
  /* "/home/denis/work/gevent/gevent/core.pyx":400
4916
 
 *         self._arg = (args, kwargs)
 
4887
  /* "gevent/core.pyx":357
 
4888
 *         self.arg = (args, kwargs)
4917
4889
 *         evtimer_set(&self.ev, __simple_handler, <void*>self)
4918
4890
 *         self.add(seconds)             # <<<<<<<<<<<<<<
4919
4891
 * 
4920
4892
 * 
4921
4893
 */
4922
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4894
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4923
4895
  __Pyx_GOTREF(__pyx_t_1);
4924
 
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_seconds); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4896
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_seconds); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4925
4897
  __Pyx_GOTREF(__pyx_t_2);
4926
 
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4927
 
  __Pyx_GOTREF(__pyx_t_3);
 
4898
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4899
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
4928
4900
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
4929
4901
  __Pyx_GIVEREF(__pyx_t_2);
4930
4902
  __pyx_t_2 = 0;
4931
 
  __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
4903
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4932
4904
  __Pyx_GOTREF(__pyx_t_2);
4933
4905
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4934
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
4906
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
4935
4907
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4936
4908
 
4937
4909
  __pyx_r = 0;
4949
4921
  return __pyx_r;
4950
4922
}
4951
4923
 
4952
 
/* "/home/denis/work/gevent/gevent/core.pyx":406
 
4924
/* "gevent/core.pyx":363
4953
4925
 *     """Create a new persistent signal event"""
4954
4926
 * 
4955
4927
 *     def __init__(self, int signalnum, callback, *args, **kwargs):             # <<<<<<<<<<<<<<
4956
 
 *         self._callback = callback
4957
 
 *         self._arg = (args, kwargs)
 
4928
 *         self.callback = callback
 
4929
 *         self.arg = (args, kwargs)
4958
4930
 */
4959
4931
 
4960
4932
static int __pyx_pf_6gevent_4core_6signal___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4998
4970
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__callback);
4999
4971
      if (likely(values[1])) kw_args--;
5000
4972
      else {
5001
 
        __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4973
        __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5002
4974
      }
5003
4975
    }
5004
4976
    if (unlikely(kw_args > 0)) {
5005
4977
      const Py_ssize_t used_pos_args = (PyTuple_GET_SIZE(__pyx_args) < 2) ? PyTuple_GET_SIZE(__pyx_args) : 2;
5006
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4978
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5007
4979
    }
5008
 
    __pyx_v_signalnum = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4980
    __pyx_v_signalnum = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5009
4981
    __pyx_v_callback = values[1];
5010
4982
  } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
5011
4983
    goto __pyx_L5_argtuple_error;
5012
4984
  } else {
5013
 
    __pyx_v_signalnum = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4985
    __pyx_v_signalnum = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5014
4986
    __pyx_v_callback = PyTuple_GET_ITEM(__pyx_args, 1);
5015
4987
  }
5016
4988
  goto __pyx_L4_argument_unpacking_done;
5017
4989
  __pyx_L5_argtuple_error:;
5018
 
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
4990
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5019
4991
  __pyx_L3_error:;
5020
4992
  __Pyx_DECREF(__pyx_v_args);
5021
4993
  __Pyx_DECREF(__pyx_v_kwargs);
5022
4994
  __Pyx_AddTraceback("gevent.core.signal.__init__");
 
4995
  __Pyx_RefNannyFinishContext();
5023
4996
  return -1;
5024
4997
  __pyx_L4_argument_unpacking_done:;
5025
4998
 
5026
 
  /* "/home/denis/work/gevent/gevent/core.pyx":407
 
4999
  /* "gevent/core.pyx":364
5027
5000
 * 
5028
5001
 *     def __init__(self, int signalnum, callback, *args, **kwargs):
5029
 
 *         self._callback = callback             # <<<<<<<<<<<<<<
5030
 
 *         self._arg = (args, kwargs)
 
5002
 *         self.callback = callback             # <<<<<<<<<<<<<<
 
5003
 *         self.arg = (args, kwargs)
5031
5004
 *         event_set(&self.ev, signalnum, EV_SIGNAL|EV_PERSIST, __simple_handler, <void*>self)
5032
5005
 */
5033
5006
  __Pyx_INCREF(__pyx_v_callback);
5034
5007
  __Pyx_GIVEREF(__pyx_v_callback);
5035
 
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_signal *)__pyx_v_self)->__pyx_base._callback);
5036
 
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_signal *)__pyx_v_self)->__pyx_base._callback);
5037
 
  ((struct __pyx_obj_6gevent_4core_signal *)__pyx_v_self)->__pyx_base._callback = __pyx_v_callback;
 
5008
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_signal *)__pyx_v_self)->__pyx_base.callback);
 
5009
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_signal *)__pyx_v_self)->__pyx_base.callback);
 
5010
  ((struct __pyx_obj_6gevent_4core_signal *)__pyx_v_self)->__pyx_base.callback = __pyx_v_callback;
5038
5011
 
5039
 
  /* "/home/denis/work/gevent/gevent/core.pyx":408
 
5012
  /* "gevent/core.pyx":365
5040
5013
 *     def __init__(self, int signalnum, callback, *args, **kwargs):
5041
 
 *         self._callback = callback
5042
 
 *         self._arg = (args, kwargs)             # <<<<<<<<<<<<<<
 
5014
 *         self.callback = callback
 
5015
 *         self.arg = (args, kwargs)             # <<<<<<<<<<<<<<
5043
5016
 *         event_set(&self.ev, signalnum, EV_SIGNAL|EV_PERSIST, __simple_handler, <void*>self)
5044
5017
 *         self.add()
5045
5018
 */
5046
 
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5047
 
  __Pyx_GOTREF(__pyx_t_1);
5048
 
  __Pyx_INCREF(__pyx_v_args);
5049
 
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_args);
5050
 
  __Pyx_GIVEREF(__pyx_v_args);
5051
 
  __Pyx_INCREF(__pyx_v_kwargs);
5052
 
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_kwargs);
5053
 
  __Pyx_GIVEREF(__pyx_v_kwargs);
5054
 
  __Pyx_GIVEREF(__pyx_t_1);
5055
 
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_signal *)__pyx_v_self)->__pyx_base._arg);
5056
 
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_signal *)__pyx_v_self)->__pyx_base._arg);
5057
 
  ((struct __pyx_obj_6gevent_4core_signal *)__pyx_v_self)->__pyx_base._arg = __pyx_t_1;
 
5019
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5020
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
5021
  __Pyx_INCREF(((PyObject *)__pyx_v_args));
 
5022
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_args));
 
5023
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
 
5024
  __Pyx_INCREF(((PyObject *)__pyx_v_kwargs));
 
5025
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_kwargs));
 
5026
  __Pyx_GIVEREF(((PyObject *)__pyx_v_kwargs));
 
5027
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
 
5028
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_signal *)__pyx_v_self)->__pyx_base.arg);
 
5029
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_signal *)__pyx_v_self)->__pyx_base.arg);
 
5030
  ((struct __pyx_obj_6gevent_4core_signal *)__pyx_v_self)->__pyx_base.arg = ((PyObject *)__pyx_t_1);
5058
5031
  __pyx_t_1 = 0;
5059
5032
 
5060
 
  /* "/home/denis/work/gevent/gevent/core.pyx":409
5061
 
 *         self._callback = callback
5062
 
 *         self._arg = (args, kwargs)
 
5033
  /* "gevent/core.pyx":366
 
5034
 *         self.callback = callback
 
5035
 *         self.arg = (args, kwargs)
5063
5036
 *         event_set(&self.ev, signalnum, EV_SIGNAL|EV_PERSIST, __simple_handler, <void*>self)             # <<<<<<<<<<<<<<
5064
5037
 *         self.add()
5065
5038
 * 
5066
5039
 */
5067
5040
  event_set((&((struct __pyx_obj_6gevent_4core_signal *)__pyx_v_self)->__pyx_base.ev), __pyx_v_signalnum, (EV_SIGNAL | EV_PERSIST), __pyx_f_6gevent_4core___simple_handler, ((void *)__pyx_v_self));
5068
5041
 
5069
 
  /* "/home/denis/work/gevent/gevent/core.pyx":410
5070
 
 *         self._arg = (args, kwargs)
 
5042
  /* "gevent/core.pyx":367
 
5043
 *         self.arg = (args, kwargs)
5071
5044
 *         event_set(&self.ev, signalnum, EV_SIGNAL|EV_PERSIST, __simple_handler, <void*>self)
5072
5045
 *         self.add()             # <<<<<<<<<<<<<<
5073
5046
 * 
5074
5047
 * 
5075
5048
 */
5076
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5049
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5077
5050
  __Pyx_GOTREF(__pyx_t_1);
5078
 
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5051
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5079
5052
  __Pyx_GOTREF(__pyx_t_2);
5080
5053
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5081
5054
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5094
5067
  return __pyx_r;
5095
5068
}
5096
5069
 
5097
 
/* "/home/denis/work/gevent/gevent/core.pyx":416
 
5070
/* "gevent/core.pyx":373
5098
5071
 *     """An event that is scheduled to run in the current loop iteration"""
5099
5072
 * 
5100
5073
 *     def __init__(self, callback, *args, **kwargs):             # <<<<<<<<<<<<<<
5101
 
 *         self._callback = callback
5102
 
 *         self._arg = (args, kwargs)
 
5074
 *         self.callback = callback
 
5075
 *         self.arg = (args, kwargs)
5103
5076
 */
5104
5077
 
5105
5078
static int __pyx_pf_6gevent_4core_12active_event___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5139
5112
    }
5140
5113
    if (unlikely(kw_args > 0)) {
5141
5114
      const Py_ssize_t used_pos_args = (PyTuple_GET_SIZE(__pyx_args) < 1) ? PyTuple_GET_SIZE(__pyx_args) : 1;
5142
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
5115
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5143
5116
    }
5144
5117
    __pyx_v_callback = values[0];
5145
5118
  } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
5149
5122
  }
5150
5123
  goto __pyx_L4_argument_unpacking_done;
5151
5124
  __pyx_L5_argtuple_error:;
5152
 
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
5125
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5153
5126
  __pyx_L3_error:;
5154
5127
  __Pyx_DECREF(__pyx_v_args);
5155
5128
  __Pyx_DECREF(__pyx_v_kwargs);
5156
5129
  __Pyx_AddTraceback("gevent.core.active_event.__init__");
 
5130
  __Pyx_RefNannyFinishContext();
5157
5131
  return -1;
5158
5132
  __pyx_L4_argument_unpacking_done:;
5159
5133
 
5160
 
  /* "/home/denis/work/gevent/gevent/core.pyx":417
 
5134
  /* "gevent/core.pyx":374
5161
5135
 * 
5162
5136
 *     def __init__(self, callback, *args, **kwargs):
5163
 
 *         self._callback = callback             # <<<<<<<<<<<<<<
5164
 
 *         self._arg = (args, kwargs)
 
5137
 *         self.callback = callback             # <<<<<<<<<<<<<<
 
5138
 *         self.arg = (args, kwargs)
5165
5139
 *         evtimer_set(&self.ev, __simple_handler, <void*>self)
5166
5140
 */
5167
5141
  __Pyx_INCREF(__pyx_v_callback);
5168
5142
  __Pyx_GIVEREF(__pyx_v_callback);
5169
 
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_active_event *)__pyx_v_self)->__pyx_base._callback);
5170
 
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_active_event *)__pyx_v_self)->__pyx_base._callback);
5171
 
  ((struct __pyx_obj_6gevent_4core_active_event *)__pyx_v_self)->__pyx_base._callback = __pyx_v_callback;
 
5143
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_active_event *)__pyx_v_self)->__pyx_base.callback);
 
5144
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_active_event *)__pyx_v_self)->__pyx_base.callback);
 
5145
  ((struct __pyx_obj_6gevent_4core_active_event *)__pyx_v_self)->__pyx_base.callback = __pyx_v_callback;
5172
5146
 
5173
 
  /* "/home/denis/work/gevent/gevent/core.pyx":418
 
5147
  /* "gevent/core.pyx":375
5174
5148
 *     def __init__(self, callback, *args, **kwargs):
5175
 
 *         self._callback = callback
5176
 
 *         self._arg = (args, kwargs)             # <<<<<<<<<<<<<<
 
5149
 *         self.callback = callback
 
5150
 *         self.arg = (args, kwargs)             # <<<<<<<<<<<<<<
5177
5151
 *         evtimer_set(&self.ev, __simple_handler, <void*>self)
5178
5152
 *         self._addref()
5179
5153
 */
5180
 
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5181
 
  __Pyx_GOTREF(__pyx_t_1);
5182
 
  __Pyx_INCREF(__pyx_v_args);
5183
 
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_args);
5184
 
  __Pyx_GIVEREF(__pyx_v_args);
5185
 
  __Pyx_INCREF(__pyx_v_kwargs);
5186
 
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_kwargs);
5187
 
  __Pyx_GIVEREF(__pyx_v_kwargs);
5188
 
  __Pyx_GIVEREF(__pyx_t_1);
5189
 
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_active_event *)__pyx_v_self)->__pyx_base._arg);
5190
 
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_active_event *)__pyx_v_self)->__pyx_base._arg);
5191
 
  ((struct __pyx_obj_6gevent_4core_active_event *)__pyx_v_self)->__pyx_base._arg = __pyx_t_1;
 
5154
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5155
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
5156
  __Pyx_INCREF(((PyObject *)__pyx_v_args));
 
5157
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_args));
 
5158
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
 
5159
  __Pyx_INCREF(((PyObject *)__pyx_v_kwargs));
 
5160
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_kwargs));
 
5161
  __Pyx_GIVEREF(((PyObject *)__pyx_v_kwargs));
 
5162
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
 
5163
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_active_event *)__pyx_v_self)->__pyx_base.arg);
 
5164
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_active_event *)__pyx_v_self)->__pyx_base.arg);
 
5165
  ((struct __pyx_obj_6gevent_4core_active_event *)__pyx_v_self)->__pyx_base.arg = ((PyObject *)__pyx_t_1);
5192
5166
  __pyx_t_1 = 0;
5193
5167
 
5194
 
  /* "/home/denis/work/gevent/gevent/core.pyx":419
5195
 
 *         self._callback = callback
5196
 
 *         self._arg = (args, kwargs)
 
5168
  /* "gevent/core.pyx":376
 
5169
 *         self.callback = callback
 
5170
 *         self.arg = (args, kwargs)
5197
5171
 *         evtimer_set(&self.ev, __simple_handler, <void*>self)             # <<<<<<<<<<<<<<
5198
5172
 *         self._addref()
5199
5173
 *         event_active(&self.ev, EV_TIMEOUT, 1)
5200
5174
 */
5201
5175
  evtimer_set((&((struct __pyx_obj_6gevent_4core_active_event *)__pyx_v_self)->__pyx_base.ev), __pyx_f_6gevent_4core___simple_handler, ((void *)__pyx_v_self));
5202
5176
 
5203
 
  /* "/home/denis/work/gevent/gevent/core.pyx":420
5204
 
 *         self._arg = (args, kwargs)
 
5177
  /* "gevent/core.pyx":377
 
5178
 *         self.arg = (args, kwargs)
5205
5179
 *         evtimer_set(&self.ev, __simple_handler, <void*>self)
5206
5180
 *         self._addref()             # <<<<<<<<<<<<<<
5207
5181
 *         event_active(&self.ev, EV_TIMEOUT, 1)
5208
5182
 * 
5209
5183
 */
5210
 
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_4core_active_event *)((struct __pyx_obj_6gevent_4core_active_event *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._addref(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5184
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_4core_active_event *)((struct __pyx_obj_6gevent_4core_active_event *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._addref(((struct __pyx_obj_6gevent_4core_event *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5211
5185
  __Pyx_GOTREF(__pyx_t_1);
5212
5186
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5213
5187
 
5214
 
  /* "/home/denis/work/gevent/gevent/core.pyx":421
 
5188
  /* "gevent/core.pyx":378
5215
5189
 *         evtimer_set(&self.ev, __simple_handler, <void*>self)
5216
5190
 *         self._addref()
5217
5191
 *         event_active(&self.ev, EV_TIMEOUT, 1)             # <<<<<<<<<<<<<<
5233
5207
  return __pyx_r;
5234
5208
}
5235
5209
 
5236
 
/* "/home/denis/work/gevent/gevent/core.pyx":423
 
5210
/* "gevent/core.pyx":380
5237
5211
 *         event_active(&self.ev, EV_TIMEOUT, 1)
5238
5212
 * 
5239
5213
 *     def add(self, timeout=None):             # <<<<<<<<<<<<<<
5241
5215
 * 
5242
5216
 */
5243
5217
 
5244
 
static PyObject *__pyx_pf_6gevent_4core_12active_event_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5245
 
static PyObject *__pyx_pf_6gevent_4core_12active_event_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
5218
static PyObject *__pyx_pf_6gevent_4core_12active_event_1add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
5219
static PyObject *__pyx_pf_6gevent_4core_12active_event_1add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5246
5220
  PyObject *__pyx_v_timeout = 0;
5247
5221
  PyObject *__pyx_r = NULL;
5248
5222
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__timeout,0};
5258
5232
    }
5259
5233
    switch (PyTuple_GET_SIZE(__pyx_args)) {
5260
5234
      case  0:
5261
 
      if (kw_args > 1) {
 
5235
      if (kw_args > 0) {
5262
5236
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__timeout);
5263
 
        if (unlikely(value)) { values[0] = value; kw_args--; }
 
5237
        if (value) { values[0] = value; kw_args--; }
5264
5238
      }
5265
5239
    }
5266
5240
    if (unlikely(kw_args > 0)) {
5267
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
5241
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5268
5242
    }
5269
5243
    __pyx_v_timeout = values[0];
5270
5244
  } else {
5277
5251
  }
5278
5252
  goto __pyx_L4_argument_unpacking_done;
5279
5253
  __pyx_L5_argtuple_error:;
5280
 
  __Pyx_RaiseArgtupleInvalid("add", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
5254
  __Pyx_RaiseArgtupleInvalid("add", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5281
5255
  __pyx_L3_error:;
5282
5256
  __Pyx_AddTraceback("gevent.core.active_event.add");
 
5257
  __Pyx_RefNannyFinishContext();
5283
5258
  return NULL;
5284
5259
  __pyx_L4_argument_unpacking_done:;
5285
5260
 
5286
 
  /* "/home/denis/work/gevent/gevent/core.pyx":424
 
5261
  /* "gevent/core.pyx":381
5287
5262
 * 
5288
5263
 *     def add(self, timeout=None):
5289
5264
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
5291
5266
 * 
5292
5267
 */
5293
5268
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0);
5294
 
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5269
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5295
5270
 
5296
5271
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5297
5272
  goto __pyx_L0;
5304
5279
  return __pyx_r;
5305
5280
}
5306
5281
 
5307
 
/* "/home/denis/work/gevent/gevent/core.pyx":427
 
5282
/* "gevent/core.pyx":384
5308
5283
 * 
5309
5284
 * 
5310
5285
 * def init():             # <<<<<<<<<<<<<<
5312
5287
 *     event_init()
5313
5288
 */
5314
5289
 
5315
 
static PyObject *__pyx_pf_6gevent_4core_init(PyObject *__pyx_self, PyObject *unused); /*proto*/
 
5290
static PyObject *__pyx_pf_6gevent_4core_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5316
5291
static char __pyx_doc_6gevent_4core_init[] = "Initialize event queue.";
5317
 
static PyObject *__pyx_pf_6gevent_4core_init(PyObject *__pyx_self, PyObject *unused) {
 
5292
static PyMethodDef __pyx_mdef_6gevent_4core_init = {__Pyx_NAMESTR("init"), (PyCFunction)__pyx_pf_6gevent_4core_init, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_init)};
 
5293
static PyObject *__pyx_pf_6gevent_4core_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5318
5294
  PyObject *__pyx_r = NULL;
5319
5295
  __Pyx_RefNannySetupContext("init");
5320
5296
  __pyx_self = __pyx_self;
5321
5297
 
5322
 
  /* "/home/denis/work/gevent/gevent/core.pyx":429
 
5298
  /* "gevent/core.pyx":386
5323
5299
 * def init():
5324
5300
 *     """Initialize event queue."""
5325
5301
 *     event_init()             # <<<<<<<<<<<<<<
5334
5310
  return __pyx_r;
5335
5311
}
5336
5312
 
5337
 
/* "/home/denis/work/gevent/gevent/core.pyx":432
 
5313
/* "gevent/core.pyx":389
5338
5314
 * 
5339
5315
 * 
5340
5316
 * def dispatch():             # <<<<<<<<<<<<<<
5342
5318
 *     Returns 0 on success, and 1 if no events are registered.
5343
5319
 */
5344
5320
 
5345
 
static PyObject *__pyx_pf_6gevent_4core_dispatch(PyObject *__pyx_self, PyObject *unused); /*proto*/
5346
 
static char __pyx_doc_6gevent_4core_dispatch[] = "Dispatch all events on the event queue.\n    Returns 0 on success, and 1 if no events are registered.\n    May raise IOError.\n    ";
5347
 
static PyObject *__pyx_pf_6gevent_4core_dispatch(PyObject *__pyx_self, PyObject *unused) {
 
5321
static PyObject *__pyx_pf_6gevent_4core_1dispatch(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
5322
static char __pyx_doc_6gevent_4core_1dispatch[] = "Dispatch all events on the event queue.\n    Returns 0 on success, and 1 if no events are registered.\n    May raise IOError.\n    ";
 
5323
static PyMethodDef __pyx_mdef_6gevent_4core_1dispatch = {__Pyx_NAMESTR("dispatch"), (PyCFunction)__pyx_pf_6gevent_4core_1dispatch, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_1dispatch)};
 
5324
static PyObject *__pyx_pf_6gevent_4core_1dispatch(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5348
5325
  int __pyx_v_ret;
5349
5326
  PyObject *__pyx_r = NULL;
5350
5327
  int __pyx_t_1;
5354
5331
  __Pyx_RefNannySetupContext("dispatch");
5355
5332
  __pyx_self = __pyx_self;
5356
5333
 
5357
 
  /* "/home/denis/work/gevent/gevent/core.pyx":438
 
5334
  /* "gevent/core.pyx":395
5358
5335
 *     """
5359
5336
 *     cdef int ret
5360
5337
 *     with nogil:             # <<<<<<<<<<<<<<
5361
5338
 *         ret = event_dispatch()
5362
5339
 *     if ret < 0:
5363
5340
 */
5364
 
  { PyThreadState *_save;
 
5341
  {
 
5342
    #ifdef WITH_THREAD
 
5343
    PyThreadState *_save;
 
5344
    #endif
5365
5345
    Py_UNBLOCK_THREADS
5366
5346
    /*try:*/ {
5367
5347
 
5368
 
      /* "/home/denis/work/gevent/gevent/core.pyx":439
 
5348
      /* "gevent/core.pyx":396
5369
5349
 *     cdef int ret
5370
5350
 *     with nogil:
5371
5351
 *         ret = event_dispatch()             # <<<<<<<<<<<<<<
5374
5354
 */
5375
5355
      __pyx_v_ret = event_dispatch();
5376
5356
    }
5377
 
    /*finally:*/ {
5378
5357
 
5379
 
      /* "/home/denis/work/gevent/gevent/core.pyx":438
 
5358
    /* "gevent/core.pyx":395
5380
5359
 *     """
5381
5360
 *     cdef int ret
5382
5361
 *     with nogil:             # <<<<<<<<<<<<<<
5383
5362
 *         ret = event_dispatch()
5384
5363
 *     if ret < 0:
5385
5364
 */
 
5365
    /*finally:*/ {
5386
5366
      Py_BLOCK_THREADS
5387
5367
    }
5388
5368
  }
5389
5369
 
5390
 
  /* "/home/denis/work/gevent/gevent/core.pyx":440
 
5370
  /* "gevent/core.pyx":397
5391
5371
 *     with nogil:
5392
5372
 *         ret = event_dispatch()
5393
5373
 *     if ret < 0:             # <<<<<<<<<<<<<<
5397
5377
  __pyx_t_1 = (__pyx_v_ret < 0);
5398
5378
  if (__pyx_t_1) {
5399
5379
 
5400
 
    /* "/home/denis/work/gevent/gevent/core.pyx":441
 
5380
    /* "gevent/core.pyx":398
5401
5381
 *         ret = event_dispatch()
5402
5382
 *     if ret < 0:
5403
5383
 *         raise IOError(errno, strerror(errno))             # <<<<<<<<<<<<<<
5404
5384
 *     return ret
5405
5385
 * 
5406
5386
 */
5407
 
    __pyx_t_2 = PyInt_FromLong(errno); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5387
    __pyx_t_2 = PyInt_FromLong(errno); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5408
5388
    __Pyx_GOTREF(__pyx_t_2);
5409
 
    __pyx_t_3 = __Pyx_PyBytes_FromString(strerror(errno)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5389
    __pyx_t_3 = PyBytes_FromString(strerror(errno)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5410
5390
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
5411
 
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5412
 
    __Pyx_GOTREF(__pyx_t_4);
 
5391
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5392
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
5413
5393
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
5414
5394
    __Pyx_GIVEREF(__pyx_t_2);
5415
5395
    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_t_3));
5416
5396
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
5417
5397
    __pyx_t_2 = 0;
5418
5398
    __pyx_t_3 = 0;
5419
 
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5399
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5420
5400
    __Pyx_GOTREF(__pyx_t_3);
5421
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
5401
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
5422
5402
    __Pyx_Raise(__pyx_t_3, 0, 0);
5423
5403
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5424
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5404
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5425
5405
    goto __pyx_L8;
5426
5406
  }
5427
5407
  __pyx_L8:;
5428
5408
 
5429
 
  /* "/home/denis/work/gevent/gevent/core.pyx":442
 
5409
  /* "gevent/core.pyx":399
5430
5410
 *     if ret < 0:
5431
5411
 *         raise IOError(errno, strerror(errno))
5432
5412
 *     return ret             # <<<<<<<<<<<<<<
5434
5414
 * 
5435
5415
 */
5436
5416
  __Pyx_XDECREF(__pyx_r);
5437
 
  __pyx_t_3 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5417
  __pyx_t_3 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5438
5418
  __Pyx_GOTREF(__pyx_t_3);
5439
5419
  __pyx_r = __pyx_t_3;
5440
5420
  __pyx_t_3 = 0;
5454
5434
  return __pyx_r;
5455
5435
}
5456
5436
 
5457
 
/* "/home/denis/work/gevent/gevent/core.pyx":445
 
5437
/* "gevent/core.pyx":402
5458
5438
 * 
5459
5439
 * 
5460
5440
 * def loop(nonblock=False):             # <<<<<<<<<<<<<<
5462
5442
 *     Returns 0 on success, and 1 if no events are registered.
5463
5443
 */
5464
5444
 
5465
 
static PyObject *__pyx_pf_6gevent_4core_loop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5466
 
static char __pyx_doc_6gevent_4core_loop[] = "Dispatch all pending events on queue in a single pass.\n    Returns 0 on success, and 1 if no events are registered.\n    May raise IOError.\n    ";
5467
 
static PyObject *__pyx_pf_6gevent_4core_loop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
5445
static PyObject *__pyx_pf_6gevent_4core_2loop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
5446
static char __pyx_doc_6gevent_4core_2loop[] = "Dispatch all pending events on queue in a single pass.\n    Returns 0 on success, and 1 if no events are registered.\n    May raise IOError.\n    ";
 
5447
static PyMethodDef __pyx_mdef_6gevent_4core_2loop = {__Pyx_NAMESTR("loop"), (PyCFunction)__pyx_pf_6gevent_4core_2loop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_2loop)};
 
5448
static PyObject *__pyx_pf_6gevent_4core_2loop(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5468
5449
  PyObject *__pyx_v_nonblock = 0;
5469
5450
  int __pyx_v_flags;
5470
5451
  int __pyx_v_ret;
5489
5470
      case  0:
5490
5471
      if (kw_args > 0) {
5491
5472
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nonblock);
5492
 
        if (unlikely(value)) { values[0] = value; kw_args--; }
 
5473
        if (value) { values[0] = value; kw_args--; }
5493
5474
      }
5494
5475
    }
5495
5476
    if (unlikely(kw_args > 0)) {
5496
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "loop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
5477
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "loop") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5497
5478
    }
5498
5479
    __pyx_v_nonblock = values[0];
5499
5480
  } else {
5506
5487
  }
5507
5488
  goto __pyx_L4_argument_unpacking_done;
5508
5489
  __pyx_L5_argtuple_error:;
5509
 
  __Pyx_RaiseArgtupleInvalid("loop", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
5490
  __Pyx_RaiseArgtupleInvalid("loop", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5510
5491
  __pyx_L3_error:;
5511
5492
  __Pyx_AddTraceback("gevent.core.loop");
 
5493
  __Pyx_RefNannyFinishContext();
5512
5494
  return NULL;
5513
5495
  __pyx_L4_argument_unpacking_done:;
5514
 
  __Pyx_INCREF(__pyx_v_nonblock);
5515
5496
 
5516
 
  /* "/home/denis/work/gevent/gevent/core.pyx":451
 
5497
  /* "gevent/core.pyx":408
5517
5498
 *     """
5518
5499
 *     cdef int flags, ret
5519
5500
 *     flags = EVLOOP_ONCE             # <<<<<<<<<<<<<<
5522
5503
 */
5523
5504
  __pyx_v_flags = EVLOOP_ONCE;
5524
5505
 
5525
 
  /* "/home/denis/work/gevent/gevent/core.pyx":452
 
5506
  /* "gevent/core.pyx":409
5526
5507
 *     cdef int flags, ret
5527
5508
 *     flags = EVLOOP_ONCE
5528
5509
 *     if nonblock:             # <<<<<<<<<<<<<<
5529
5510
 *         flags = EVLOOP_ONCE|EVLOOP_NONBLOCK
5530
5511
 *     with nogil:
5531
5512
 */
5532
 
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_nonblock); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5513
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_nonblock); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5533
5514
  if (__pyx_t_1) {
5534
5515
 
5535
 
    /* "/home/denis/work/gevent/gevent/core.pyx":453
 
5516
    /* "gevent/core.pyx":410
5536
5517
 *     flags = EVLOOP_ONCE
5537
5518
 *     if nonblock:
5538
5519
 *         flags = EVLOOP_ONCE|EVLOOP_NONBLOCK             # <<<<<<<<<<<<<<
5544
5525
  }
5545
5526
  __pyx_L6:;
5546
5527
 
5547
 
  /* "/home/denis/work/gevent/gevent/core.pyx":454
 
5528
  /* "gevent/core.pyx":411
5548
5529
 *     if nonblock:
5549
5530
 *         flags = EVLOOP_ONCE|EVLOOP_NONBLOCK
5550
5531
 *     with nogil:             # <<<<<<<<<<<<<<
5551
5532
 *         ret = event_loop(flags)
5552
5533
 *     if ret < 0:
5553
5534
 */
5554
 
  { PyThreadState *_save;
 
5535
  {
 
5536
    #ifdef WITH_THREAD
 
5537
    PyThreadState *_save;
 
5538
    #endif
5555
5539
    Py_UNBLOCK_THREADS
5556
5540
    /*try:*/ {
5557
5541
 
5558
 
      /* "/home/denis/work/gevent/gevent/core.pyx":455
 
5542
      /* "gevent/core.pyx":412
5559
5543
 *         flags = EVLOOP_ONCE|EVLOOP_NONBLOCK
5560
5544
 *     with nogil:
5561
5545
 *         ret = event_loop(flags)             # <<<<<<<<<<<<<<
5564
5548
 */
5565
5549
      __pyx_v_ret = event_loop(__pyx_v_flags);
5566
5550
    }
5567
 
    /*finally:*/ {
5568
5551
 
5569
 
      /* "/home/denis/work/gevent/gevent/core.pyx":454
 
5552
    /* "gevent/core.pyx":411
5570
5553
 *     if nonblock:
5571
5554
 *         flags = EVLOOP_ONCE|EVLOOP_NONBLOCK
5572
5555
 *     with nogil:             # <<<<<<<<<<<<<<
5573
5556
 *         ret = event_loop(flags)
5574
5557
 *     if ret < 0:
5575
5558
 */
 
5559
    /*finally:*/ {
5576
5560
      Py_BLOCK_THREADS
5577
5561
    }
5578
5562
  }
5579
5563
 
5580
 
  /* "/home/denis/work/gevent/gevent/core.pyx":456
 
5564
  /* "gevent/core.pyx":413
5581
5565
 *     with nogil:
5582
5566
 *         ret = event_loop(flags)
5583
5567
 *     if ret < 0:             # <<<<<<<<<<<<<<
5587
5571
  __pyx_t_1 = (__pyx_v_ret < 0);
5588
5572
  if (__pyx_t_1) {
5589
5573
 
5590
 
    /* "/home/denis/work/gevent/gevent/core.pyx":457
 
5574
    /* "gevent/core.pyx":414
5591
5575
 *         ret = event_loop(flags)
5592
5576
 *     if ret < 0:
5593
5577
 *         raise IOError(errno, strerror(errno))             # <<<<<<<<<<<<<<
5594
5578
 *     return ret
5595
5579
 * 
5596
5580
 */
5597
 
    __pyx_t_2 = PyInt_FromLong(errno); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5581
    __pyx_t_2 = PyInt_FromLong(errno); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5598
5582
    __Pyx_GOTREF(__pyx_t_2);
5599
 
    __pyx_t_3 = __Pyx_PyBytes_FromString(strerror(errno)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5583
    __pyx_t_3 = PyBytes_FromString(strerror(errno)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5600
5584
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
5601
 
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5602
 
    __Pyx_GOTREF(__pyx_t_4);
 
5585
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5586
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
5603
5587
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
5604
5588
    __Pyx_GIVEREF(__pyx_t_2);
5605
5589
    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_t_3));
5606
5590
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
5607
5591
    __pyx_t_2 = 0;
5608
5592
    __pyx_t_3 = 0;
5609
 
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5593
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5610
5594
    __Pyx_GOTREF(__pyx_t_3);
5611
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
5595
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
5612
5596
    __Pyx_Raise(__pyx_t_3, 0, 0);
5613
5597
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5614
 
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5598
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5615
5599
    goto __pyx_L10;
5616
5600
  }
5617
5601
  __pyx_L10:;
5618
5602
 
5619
 
  /* "/home/denis/work/gevent/gevent/core.pyx":458
 
5603
  /* "gevent/core.pyx":415
5620
5604
 *     if ret < 0:
5621
5605
 *         raise IOError(errno, strerror(errno))
5622
5606
 *     return ret             # <<<<<<<<<<<<<<
5624
5608
 * 
5625
5609
 */
5626
5610
  __Pyx_XDECREF(__pyx_r);
5627
 
  __pyx_t_3 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5611
  __pyx_t_3 = PyInt_FromLong(__pyx_v_ret); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5628
5612
  __Pyx_GOTREF(__pyx_t_3);
5629
5613
  __pyx_r = __pyx_t_3;
5630
5614
  __pyx_t_3 = 0;
5639
5623
  __Pyx_AddTraceback("gevent.core.loop");
5640
5624
  __pyx_r = NULL;
5641
5625
  __pyx_L0:;
5642
 
  __Pyx_DECREF(__pyx_v_nonblock);
5643
5626
  __Pyx_XGIVEREF(__pyx_r);
5644
5627
  __Pyx_RefNannyFinishContext();
5645
5628
  return __pyx_r;
5646
5629
}
5647
5630
 
5648
 
/* "/home/denis/work/gevent/gevent/core.pyx":461
 
5631
/* "gevent/core.pyx":418
5649
5632
 * 
5650
5633
 * 
5651
5634
 * def get_version():             # <<<<<<<<<<<<<<
5653
5636
 *     return event_get_version()
5654
5637
 */
5655
5638
 
5656
 
static PyObject *__pyx_pf_6gevent_4core_get_version(PyObject *__pyx_self, PyObject *unused); /*proto*/
5657
 
static char __pyx_doc_6gevent_4core_get_version[] = "Wrapper for :meth:`event_get_version`";
5658
 
static PyObject *__pyx_pf_6gevent_4core_get_version(PyObject *__pyx_self, PyObject *unused) {
 
5639
static PyObject *__pyx_pf_6gevent_4core_3get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
5640
static char __pyx_doc_6gevent_4core_3get_version[] = "Wrapper for :meth:`event_get_version`";
 
5641
static PyMethodDef __pyx_mdef_6gevent_4core_3get_version = {__Pyx_NAMESTR("get_version"), (PyCFunction)__pyx_pf_6gevent_4core_3get_version, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_3get_version)};
 
5642
static PyObject *__pyx_pf_6gevent_4core_3get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5659
5643
  PyObject *__pyx_r = NULL;
5660
5644
  PyObject *__pyx_t_1 = NULL;
5661
5645
  __Pyx_RefNannySetupContext("get_version");
5662
5646
  __pyx_self = __pyx_self;
5663
5647
 
5664
 
  /* "/home/denis/work/gevent/gevent/core.pyx":463
 
5648
  /* "gevent/core.pyx":420
5665
5649
 * def get_version():
5666
5650
 *     """Wrapper for :meth:`event_get_version`"""
5667
5651
 *     return event_get_version()             # <<<<<<<<<<<<<<
5669
5653
 * 
5670
5654
 */
5671
5655
  __Pyx_XDECREF(__pyx_r);
5672
 
  __pyx_t_1 = __Pyx_PyBytes_FromString(event_get_version()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5656
  __pyx_t_1 = PyBytes_FromString(event_get_version()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5673
5657
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
5674
5658
  __pyx_r = ((PyObject *)__pyx_t_1);
5675
5659
  __pyx_t_1 = 0;
5687
5671
  return __pyx_r;
5688
5672
}
5689
5673
 
5690
 
/* "/home/denis/work/gevent/gevent/core.pyx":466
 
5674
/* "gevent/core.pyx":423
5691
5675
 * 
5692
5676
 * 
5693
5677
 * def get_method():             # <<<<<<<<<<<<<<
5695
5679
 *     return event_get_method()
5696
5680
 */
5697
5681
 
5698
 
static PyObject *__pyx_pf_6gevent_4core_get_method(PyObject *__pyx_self, PyObject *unused); /*proto*/
5699
 
static char __pyx_doc_6gevent_4core_get_method[] = "Wrapper for :meth:`event_get_method`";
5700
 
static PyObject *__pyx_pf_6gevent_4core_get_method(PyObject *__pyx_self, PyObject *unused) {
 
5682
static PyObject *__pyx_pf_6gevent_4core_4get_method(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
5683
static char __pyx_doc_6gevent_4core_4get_method[] = "Wrapper for :meth:`event_get_method`";
 
5684
static PyMethodDef __pyx_mdef_6gevent_4core_4get_method = {__Pyx_NAMESTR("get_method"), (PyCFunction)__pyx_pf_6gevent_4core_4get_method, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_4get_method)};
 
5685
static PyObject *__pyx_pf_6gevent_4core_4get_method(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5701
5686
  PyObject *__pyx_r = NULL;
5702
5687
  PyObject *__pyx_t_1 = NULL;
5703
5688
  __Pyx_RefNannySetupContext("get_method");
5704
5689
  __pyx_self = __pyx_self;
5705
5690
 
5706
 
  /* "/home/denis/work/gevent/gevent/core.pyx":468
 
5691
  /* "gevent/core.pyx":425
5707
5692
 * def get_method():
5708
5693
 *     """Wrapper for :meth:`event_get_method`"""
5709
5694
 *     return event_get_method()             # <<<<<<<<<<<<<<
5711
5696
 * 
5712
5697
 */
5713
5698
  __Pyx_XDECREF(__pyx_r);
5714
 
  __pyx_t_1 = __Pyx_PyBytes_FromString(event_get_method()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5699
  __pyx_t_1 = PyBytes_FromString(event_get_method()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5715
5700
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
5716
5701
  __pyx_r = ((PyObject *)__pyx_t_1);
5717
5702
  __pyx_t_1 = 0;
5729
5714
  return __pyx_r;
5730
5715
}
5731
5716
 
5732
 
/* "/home/denis/work/gevent/gevent/core.pyx":479
 
5717
/* "gevent/core.pyx":436
5733
5718
 * # _EVENT_VERSION is available since libevent 1.4.0-beta
5734
5719
 * 
5735
5720
 * def get_header_version():             # <<<<<<<<<<<<<<
5737
5722
 *     emit_ifdef()
5738
5723
 */
5739
5724
 
5740
 
static PyObject *__pyx_pf_6gevent_4core_get_header_version(PyObject *__pyx_self, PyObject *unused); /*proto*/
5741
 
static char __pyx_doc_6gevent_4core_get_header_version[] = "Return _EVENT_VERSION";
5742
 
static PyObject *__pyx_pf_6gevent_4core_get_header_version(PyObject *__pyx_self, PyObject *unused) {
 
5725
static PyObject *__pyx_pf_6gevent_4core_5get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
5726
static char __pyx_doc_6gevent_4core_5get_header_version[] = "Return _EVENT_VERSION";
 
5727
static PyMethodDef __pyx_mdef_6gevent_4core_5get_header_version = {__Pyx_NAMESTR("get_header_version"), (PyCFunction)__pyx_pf_6gevent_4core_5get_header_version, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_5get_header_version)};
 
5728
static PyObject *__pyx_pf_6gevent_4core_5get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5743
5729
  PyObject *__pyx_r = NULL;
5744
5730
  PyObject *__pyx_t_1 = NULL;
5745
5731
  __Pyx_RefNannySetupContext("get_header_version");
5746
5732
  __pyx_self = __pyx_self;
5747
5733
 
5748
 
  /* "/home/denis/work/gevent/gevent/core.pyx":481
 
5734
  /* "gevent/core.pyx":438
5749
5735
 * def get_header_version():
5750
5736
 *     """Return _EVENT_VERSION"""
5751
5737
 *     emit_ifdef()             # <<<<<<<<<<<<<<
5754
5740
 */
5755
5741
  #if defined(_EVENT_VERSION) //();
5756
5742
 
5757
 
  /* "/home/denis/work/gevent/gevent/core.pyx":482
 
5743
  /* "gevent/core.pyx":439
5758
5744
 *     """Return _EVENT_VERSION"""
5759
5745
 *     emit_ifdef()
5760
5746
 *     return _EVENT_VERSION             # <<<<<<<<<<<<<<
5762
5748
 * 
5763
5749
 */
5764
5750
  __Pyx_XDECREF(__pyx_r);
5765
 
  __pyx_t_1 = __Pyx_PyBytes_FromString(_EVENT_VERSION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5751
  __pyx_t_1 = PyBytes_FromString(_EVENT_VERSION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5766
5752
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
5767
5753
  __pyx_r = ((PyObject *)__pyx_t_1);
5768
5754
  __pyx_t_1 = 0;
5769
5755
  goto __pyx_L0;
5770
5756
 
5771
 
  /* "/home/denis/work/gevent/gevent/core.pyx":483
 
5757
  /* "gevent/core.pyx":440
5772
5758
 *     emit_ifdef()
5773
5759
 *     return _EVENT_VERSION
5774
5760
 *     emit_endif()             # <<<<<<<<<<<<<<
5789
5775
  return __pyx_r;
5790
5776
}
5791
5777
 
5792
 
/* "/home/denis/work/gevent/gevent/core.pyx":490
 
5778
/* "gevent/core.pyx":447
5793
5779
 * # which will work in every version other than 1.4.0-beta
5794
5780
 * 
5795
5781
 * def reinit():             # <<<<<<<<<<<<<<
5797
5783
 *     emit_ifdef()
5798
5784
 */
5799
5785
 
5800
 
static PyObject *__pyx_pf_6gevent_4core_reinit(PyObject *__pyx_self, PyObject *unused); /*proto*/
5801
 
static char __pyx_doc_6gevent_4core_reinit[] = "Wrapper for :meth:`event_reinit`.";
5802
 
static PyObject *__pyx_pf_6gevent_4core_reinit(PyObject *__pyx_self, PyObject *unused) {
 
5786
static PyObject *__pyx_pf_6gevent_4core_6reinit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
5787
static char __pyx_doc_6gevent_4core_6reinit[] = "Wrapper for :meth:`event_reinit`.";
 
5788
static PyMethodDef __pyx_mdef_6gevent_4core_6reinit = {__Pyx_NAMESTR("reinit"), (PyCFunction)__pyx_pf_6gevent_4core_6reinit, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_6reinit)};
 
5789
static PyObject *__pyx_pf_6gevent_4core_6reinit(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5803
5790
  PyObject *__pyx_r = NULL;
5804
5791
  PyObject *__pyx_t_1 = NULL;
5805
5792
  __Pyx_RefNannySetupContext("reinit");
5806
5793
  __pyx_self = __pyx_self;
5807
5794
 
5808
 
  /* "/home/denis/work/gevent/gevent/core.pyx":492
 
5795
  /* "gevent/core.pyx":449
5809
5796
 * def reinit():
5810
5797
 *     """Wrapper for :meth:`event_reinit`."""
5811
5798
 *     emit_ifdef()             # <<<<<<<<<<<<<<
5814
5801
 */
5815
5802
  #if defined(_EVENT_VERSION) //();
5816
5803
 
5817
 
  /* "/home/denis/work/gevent/gevent/core.pyx":493
 
5804
  /* "gevent/core.pyx":450
5818
5805
 *     """Wrapper for :meth:`event_reinit`."""
5819
5806
 *     emit_ifdef()
5820
5807
 *     return event_reinit(current_base)             # <<<<<<<<<<<<<<
5822
5809
 * 
5823
5810
 */
5824
5811
  __Pyx_XDECREF(__pyx_r);
5825
 
  __pyx_t_1 = PyInt_FromLong(event_reinit(current_base)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5812
  __pyx_t_1 = PyInt_FromLong(event_reinit(current_base)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5826
5813
  __Pyx_GOTREF(__pyx_t_1);
5827
5814
  __pyx_r = __pyx_t_1;
5828
5815
  __pyx_t_1 = 0;
5829
5816
  goto __pyx_L0;
5830
5817
 
5831
 
  /* "/home/denis/work/gevent/gevent/core.pyx":494
 
5818
  /* "gevent/core.pyx":451
5832
5819
 *     emit_ifdef()
5833
5820
 *     return event_reinit(current_base)
5834
5821
 *     emit_endif()             # <<<<<<<<<<<<<<
5849
5836
  return __pyx_r;
5850
5837
}
5851
5838
 
5852
 
/* "/home/denis/work/gevent/gevent/evdns.pxi":40
 
5839
/* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":40
5853
5840
 * 
5854
5841
 * 
5855
5842
 * def dns_init():             # <<<<<<<<<<<<<<
5857
5844
 *     evdns_init()
5858
5845
 */
5859
5846
 
5860
 
static PyObject *__pyx_pf_6gevent_4core_dns_init(PyObject *__pyx_self, PyObject *unused); /*proto*/
5861
 
static char __pyx_doc_6gevent_4core_dns_init[] = "Initialize async DNS resolver.";
5862
 
static PyObject *__pyx_pf_6gevent_4core_dns_init(PyObject *__pyx_self, PyObject *unused) {
 
5847
static PyObject *__pyx_pf_6gevent_4core_7dns_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
5848
static char __pyx_doc_6gevent_4core_7dns_init[] = "Initialize async DNS resolver.";
 
5849
static PyMethodDef __pyx_mdef_6gevent_4core_7dns_init = {__Pyx_NAMESTR("dns_init"), (PyCFunction)__pyx_pf_6gevent_4core_7dns_init, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_7dns_init)};
 
5850
static PyObject *__pyx_pf_6gevent_4core_7dns_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5863
5851
  PyObject *__pyx_r = NULL;
5864
5852
  __Pyx_RefNannySetupContext("dns_init");
5865
5853
  __pyx_self = __pyx_self;
5866
5854
 
5867
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":42
 
5855
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":42
5868
5856
 * def dns_init():
5869
5857
 *     """Initialize async DNS resolver."""
5870
5858
 *     evdns_init()             # <<<<<<<<<<<<<<
5879
5867
  return __pyx_r;
5880
5868
}
5881
5869
 
5882
 
/* "/home/denis/work/gevent/gevent/evdns.pxi":45
 
5870
/* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":45
5883
5871
 * 
5884
5872
 * 
5885
5873
 * def dns_shutdown(int fail_requests=0):             # <<<<<<<<<<<<<<
5887
5875
 *     evdns_shutdown(fail_requests)
5888
5876
 */
5889
5877
 
5890
 
static PyObject *__pyx_pf_6gevent_4core_dns_shutdown(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5891
 
static char __pyx_doc_6gevent_4core_dns_shutdown[] = "Shutdown the async DNS resolver and terminate all active requests.";
5892
 
static PyObject *__pyx_pf_6gevent_4core_dns_shutdown(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
5878
static PyObject *__pyx_pf_6gevent_4core_8dns_shutdown(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
5879
static char __pyx_doc_6gevent_4core_8dns_shutdown[] = "Shutdown the async DNS resolver and terminate all active requests.";
 
5880
static PyMethodDef __pyx_mdef_6gevent_4core_8dns_shutdown = {__Pyx_NAMESTR("dns_shutdown"), (PyCFunction)__pyx_pf_6gevent_4core_8dns_shutdown, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_8dns_shutdown)};
 
5881
static PyObject *__pyx_pf_6gevent_4core_8dns_shutdown(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5893
5882
  int __pyx_v_fail_requests;
5894
5883
  PyObject *__pyx_r = NULL;
5895
5884
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fail_requests,0};
5907
5896
      case  0:
5908
5897
      if (kw_args > 0) {
5909
5898
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fail_requests);
5910
 
        if (unlikely(value)) { values[0] = value; kw_args--; }
 
5899
        if (value) { values[0] = value; kw_args--; }
5911
5900
      }
5912
5901
    }
5913
5902
    if (unlikely(kw_args > 0)) {
5931
5920
  __Pyx_RaiseArgtupleInvalid("dns_shutdown", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5932
5921
  __pyx_L3_error:;
5933
5922
  __Pyx_AddTraceback("gevent.core.dns_shutdown");
 
5923
  __Pyx_RefNannyFinishContext();
5934
5924
  return NULL;
5935
5925
  __pyx_L4_argument_unpacking_done:;
5936
5926
 
5937
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":47
 
5927
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":47
5938
5928
 * def dns_shutdown(int fail_requests=0):
5939
5929
 *     """Shutdown the async DNS resolver and terminate all active requests."""
5940
5930
 *     evdns_shutdown(fail_requests)             # <<<<<<<<<<<<<<
5949
5939
  return __pyx_r;
5950
5940
}
5951
5941
 
5952
 
/* "/home/denis/work/gevent/gevent/evdns.pxi":50
 
5942
/* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":50
5953
5943
 * 
5954
5944
 * 
5955
5945
 * def dns_err_to_string(int err):             # <<<<<<<<<<<<<<
5957
5947
 *     if result:
5958
5948
 */
5959
5949
 
5960
 
static PyObject *__pyx_pf_6gevent_4core_dns_err_to_string(PyObject *__pyx_self, PyObject *__pyx_arg_err); /*proto*/
5961
 
static PyObject *__pyx_pf_6gevent_4core_dns_err_to_string(PyObject *__pyx_self, PyObject *__pyx_arg_err) {
 
5950
static PyObject *__pyx_pf_6gevent_4core_9dns_err_to_string(PyObject *__pyx_self, PyObject *__pyx_arg_err); /*proto*/
 
5951
static PyMethodDef __pyx_mdef_6gevent_4core_9dns_err_to_string = {__Pyx_NAMESTR("dns_err_to_string"), (PyCFunction)__pyx_pf_6gevent_4core_9dns_err_to_string, METH_O, __Pyx_DOCSTR(0)};
 
5952
static PyObject *__pyx_pf_6gevent_4core_9dns_err_to_string(PyObject *__pyx_self, PyObject *__pyx_arg_err) {
5962
5953
  int __pyx_v_err;
5963
5954
  const char* __pyx_v_result;
5964
5955
  PyObject *__pyx_r = NULL;
5972
5963
  goto __pyx_L4_argument_unpacking_done;
5973
5964
  __pyx_L3_error:;
5974
5965
  __Pyx_AddTraceback("gevent.core.dns_err_to_string");
 
5966
  __Pyx_RefNannyFinishContext();
5975
5967
  return NULL;
5976
5968
  __pyx_L4_argument_unpacking_done:;
5977
5969
 
5978
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":51
 
5970
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":51
5979
5971
 * 
5980
5972
 * def dns_err_to_string(int err):
5981
5973
 *     cdef const_char_ptr result = evdns_err_to_string(err)             # <<<<<<<<<<<<<<
5984
5976
 */
5985
5977
  __pyx_v_result = evdns_err_to_string(__pyx_v_err);
5986
5978
 
5987
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":52
 
5979
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":52
5988
5980
 * def dns_err_to_string(int err):
5989
5981
 *     cdef const_char_ptr result = evdns_err_to_string(err)
5990
5982
 *     if result:             # <<<<<<<<<<<<<<
5994
5986
  __pyx_t_1 = (__pyx_v_result != 0);
5995
5987
  if (__pyx_t_1) {
5996
5988
 
5997
 
    /* "/home/denis/work/gevent/gevent/evdns.pxi":53
 
5989
    /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":53
5998
5990
 *     cdef const_char_ptr result = evdns_err_to_string(err)
5999
5991
 *     if result:
6000
5992
 *         return result             # <<<<<<<<<<<<<<
6002
5994
 * 
6003
5995
 */
6004
5996
    __Pyx_XDECREF(__pyx_r);
6005
 
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
5997
    __pyx_t_2 = PyBytes_FromString(__pyx_v_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6006
5998
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
6007
5999
    __pyx_r = ((PyObject *)__pyx_t_2);
6008
6000
    __pyx_t_2 = 0;
6023
6015
  return __pyx_r;
6024
6016
}
6025
6017
 
6026
 
/* "/home/denis/work/gevent/gevent/evdns.pxi":56
 
6018
/* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":56
6027
6019
 * 
6028
6020
 * 
6029
6021
 * cdef void __evdns_callback(int code, char type, int count, int ttl, void *addrs, void *arg) with gil:             # <<<<<<<<<<<<<<
6045
6037
  int __pyx_t_7;
6046
6038
  PyObject *__pyx_t_8 = NULL;
6047
6039
  PyObject *__pyx_t_9 = NULL;
 
6040
  #ifdef WITH_THREAD
6048
6041
  PyGILState_STATE _save = PyGILState_Ensure();
 
6042
  #endif
6049
6043
  __Pyx_RefNannySetupContext("__evdns_callback");
6050
6044
  __pyx_v_addr = Py_None; __Pyx_INCREF(Py_None);
6051
6045
  __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
6052
6046
 
6053
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":58
 
6047
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":58
6054
6048
 * cdef void __evdns_callback(int code, char type, int count, int ttl, void *addrs, void *arg) with gil:
6055
6049
 *     cdef int i
6056
6050
 *     cdef object callback = <object>arg             # <<<<<<<<<<<<<<
6057
 
 *     Py_DECREF(callback)
 
6051
 *     Py_DECREF(<PyObjectPtr>callback)
6058
6052
 *     cdef object addr
6059
6053
 */
6060
6054
  __Pyx_INCREF(((PyObject *)__pyx_v_arg));
6061
6055
  __pyx_v_callback = ((PyObject *)__pyx_v_arg);
6062
6056
 
6063
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":59
 
6057
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":59
6064
6058
 *     cdef int i
6065
6059
 *     cdef object callback = <object>arg
6066
 
 *     Py_DECREF(callback)             # <<<<<<<<<<<<<<
 
6060
 *     Py_DECREF(<PyObjectPtr>callback)             # <<<<<<<<<<<<<<
6067
6061
 *     cdef object addr
6068
6062
 *     cdef object result
6069
6063
 */
6070
 
  Py_DECREF(__pyx_v_callback);
 
6064
  Py_DECREF(((PyObject*)__pyx_v_callback));
6071
6065
 
6072
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":63
 
6066
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":63
6073
6067
 *     cdef object result
6074
6068
 * 
6075
6069
 *     if type == DNS_IPv4_A:             # <<<<<<<<<<<<<<
6088
6082
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6089
6083
  if (__pyx_t_4) {
6090
6084
 
6091
 
    /* "/home/denis/work/gevent/gevent/evdns.pxi":64
 
6085
    /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":64
6092
6086
 * 
6093
6087
 *     if type == DNS_IPv4_A:
6094
6088
 *         result = []             # <<<<<<<<<<<<<<
6101
6095
    __pyx_v_result = ((PyObject *)__pyx_t_3);
6102
6096
    __pyx_t_3 = 0;
6103
6097
 
6104
 
    /* "/home/denis/work/gevent/gevent/evdns.pxi":65
 
6098
    /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":65
6105
6099
 *     if type == DNS_IPv4_A:
6106
6100
 *         result = []
6107
6101
 *         for i from 0 <= i < count:             # <<<<<<<<<<<<<<
6111
6105
    __pyx_t_5 = __pyx_v_count;
6112
6106
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
6113
6107
 
6114
 
      /* "/home/denis/work/gevent/gevent/evdns.pxi":66
 
6108
      /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":66
6115
6109
 *         result = []
6116
6110
 *         for i from 0 <= i < count:
6117
6111
 *             addr = PyString_FromStringAndSize(&(<char *>addrs)[i*4], 4)             # <<<<<<<<<<<<<<
6124
6118
      __pyx_v_addr = __pyx_t_3;
6125
6119
      __pyx_t_3 = 0;
6126
6120
 
6127
 
      /* "/home/denis/work/gevent/gevent/evdns.pxi":67
 
6121
      /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":67
6128
6122
 *         for i from 0 <= i < count:
6129
6123
 *             addr = PyString_FromStringAndSize(&(<char *>addrs)[i*4], 4)
6130
6124
 *             result.append(addr)             # <<<<<<<<<<<<<<
6138
6132
    goto __pyx_L3;
6139
6133
  }
6140
6134
 
6141
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":68
 
6135
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":68
6142
6136
 *             addr = PyString_FromStringAndSize(&(<char *>addrs)[i*4], 4)
6143
6137
 *             result.append(addr)
6144
6138
 *     elif type == DNS_IPv6_AAAA:             # <<<<<<<<<<<<<<
6157
6151
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6158
6152
  if (__pyx_t_4) {
6159
6153
 
6160
 
    /* "/home/denis/work/gevent/gevent/evdns.pxi":69
 
6154
    /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":69
6161
6155
 *             result.append(addr)
6162
6156
 *     elif type == DNS_IPv6_AAAA:
6163
6157
 *         result = []             # <<<<<<<<<<<<<<
6170
6164
    __pyx_v_result = ((PyObject *)__pyx_t_1);
6171
6165
    __pyx_t_1 = 0;
6172
6166
 
6173
 
    /* "/home/denis/work/gevent/gevent/evdns.pxi":70
 
6167
    /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":70
6174
6168
 *     elif type == DNS_IPv6_AAAA:
6175
6169
 *         result = []
6176
6170
 *         for i from 0 <= i < count:             # <<<<<<<<<<<<<<
6180
6174
    __pyx_t_5 = __pyx_v_count;
6181
6175
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
6182
6176
 
6183
 
      /* "/home/denis/work/gevent/gevent/evdns.pxi":71
 
6177
      /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":71
6184
6178
 *         result = []
6185
6179
 *         for i from 0 <= i < count:
6186
6180
 *             addr = PyString_FromStringAndSize(&(<char *>addrs)[i*16], 16)             # <<<<<<<<<<<<<<
6193
6187
      __pyx_v_addr = __pyx_t_1;
6194
6188
      __pyx_t_1 = 0;
6195
6189
 
6196
 
      /* "/home/denis/work/gevent/gevent/evdns.pxi":72
 
6190
      /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":72
6197
6191
 *         for i from 0 <= i < count:
6198
6192
 *             addr = PyString_FromStringAndSize(&(<char *>addrs)[i*16], 16)
6199
6193
 *             result.append(addr)             # <<<<<<<<<<<<<<
6207
6201
    goto __pyx_L3;
6208
6202
  }
6209
6203
 
6210
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":73
 
6204
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":73
6211
6205
 *             addr = PyString_FromStringAndSize(&(<char *>addrs)[i*16], 16)
6212
6206
 *             result.append(addr)
6213
6207
 *     elif type == DNS_PTR and count == 1: # only 1 PTR possible             # <<<<<<<<<<<<<<
6232
6226
  }
6233
6227
  if (__pyx_t_7) {
6234
6228
 
6235
 
    /* "/home/denis/work/gevent/gevent/evdns.pxi":74
 
6229
    /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":74
6236
6230
 *             result.append(addr)
6237
6231
 *     elif type == DNS_PTR and count == 1: # only 1 PTR possible
6238
6232
 *         result = PyString_FromString((<char **>addrs)[0])             # <<<<<<<<<<<<<<
6248
6242
  }
6249
6243
  /*else*/ {
6250
6244
 
6251
 
    /* "/home/denis/work/gevent/gevent/evdns.pxi":76
 
6245
    /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":76
6252
6246
 *         result = PyString_FromString((<char **>addrs)[0])
6253
6247
 *     else:
6254
6248
 *         result = None             # <<<<<<<<<<<<<<
6261
6255
  }
6262
6256
  __pyx_L3:;
6263
6257
 
6264
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":77
 
6258
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":77
6265
6259
 *     else:
6266
6260
 *         result = None
6267
6261
 *     try:             # <<<<<<<<<<<<<<
6276
6270
    __Pyx_XGOTREF(__pyx_save_exc_tb);
6277
6271
    /*try:*/ {
6278
6272
 
6279
 
      /* "/home/denis/work/gevent/gevent/evdns.pxi":78
 
6273
      /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":78
6280
6274
 *         result = None
6281
6275
 *     try:
6282
6276
 *         callback(code, type, ttl, result)             # <<<<<<<<<<<<<<
6290
6284
      __pyx_t_1 = PyInt_FromLong(__pyx_v_ttl); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
6291
6285
      __Pyx_GOTREF(__pyx_t_1);
6292
6286
      __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
6293
 
      __Pyx_GOTREF(__pyx_t_8);
 
6287
      __Pyx_GOTREF(((PyObject *)__pyx_t_8));
6294
6288
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
6295
6289
      __Pyx_GIVEREF(__pyx_t_3);
6296
6290
      PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
6303
6297
      __pyx_t_3 = 0;
6304
6298
      __pyx_t_2 = 0;
6305
6299
      __pyx_t_1 = 0;
6306
 
      __pyx_t_1 = PyObject_Call(__pyx_v_callback, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
 
6300
      __pyx_t_1 = PyObject_Call(__pyx_v_callback, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
6307
6301
      __Pyx_GOTREF(__pyx_t_1);
6308
 
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
6302
      __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
6309
6303
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6310
6304
    }
6311
6305
    __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
6318
6312
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6319
6313
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
6320
6314
 
6321
 
    /* "/home/denis/work/gevent/gevent/evdns.pxi":79
 
6315
    /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":79
6322
6316
 *     try:
6323
6317
 *         callback(code, type, ttl, result)
6324
6318
 *     except:             # <<<<<<<<<<<<<<
6332
6326
      __Pyx_GOTREF(__pyx_t_8);
6333
6327
      __Pyx_GOTREF(__pyx_t_2);
6334
6328
 
6335
 
      /* "/home/denis/work/gevent/gevent/evdns.pxi":80
 
6329
      /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":80
6336
6330
 *         callback(code, type, ttl, result)
6337
6331
 *     except:
6338
6332
 *         traceback.print_exc()             # <<<<<<<<<<<<<<
6349
6343
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6350
6344
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6351
6345
 
6352
 
      /* "/home/denis/work/gevent/gevent/evdns.pxi":81
 
6346
      /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":81
6353
6347
 *     except:
6354
6348
 *         traceback.print_exc()
6355
6349
 *         sys.exc_clear()             # <<<<<<<<<<<<<<
6397
6391
  __Pyx_DECREF(__pyx_v_addr);
6398
6392
  __Pyx_DECREF(__pyx_v_result);
6399
6393
  __Pyx_RefNannyFinishContext();
 
6394
  #ifdef WITH_THREAD
6400
6395
  PyGILState_Release(_save);
 
6396
  #endif
6401
6397
}
6402
6398
 
6403
 
/* "/home/denis/work/gevent/gevent/evdns.pxi":84
 
6399
/* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":84
6404
6400
 * 
6405
6401
 * 
6406
6402
 * def dns_resolve_ipv4(char *name, int flags, object callback):             # <<<<<<<<<<<<<<
6408
6404
 * 
6409
6405
 */
6410
6406
 
6411
 
static PyObject *__pyx_pf_6gevent_4core_dns_resolve_ipv4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6412
 
static char __pyx_doc_6gevent_4core_dns_resolve_ipv4[] = "Lookup an A record for a given name.\n\n    - *name*     -- DNS hostname\n    - *flags*    -- either 0 or DNS_QUERY_NO_SEARCH\n    - *callback* -- callback with ``(result, type, ttl, addrs)`` prototype\n    ";
6413
 
static PyObject *__pyx_pf_6gevent_4core_dns_resolve_ipv4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
6407
static PyObject *__pyx_pf_6gevent_4core_10dns_resolve_ipv4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
6408
static char __pyx_doc_6gevent_4core_10dns_resolve_ipv4[] = "Lookup an A record for a given name.\n\n    - *name*     -- DNS hostname\n    - *flags*    -- either 0 or DNS_QUERY_NO_SEARCH\n    - *callback* -- callback with ``(result, type, ttl, addrs)`` prototype\n    ";
 
6409
static PyMethodDef __pyx_mdef_6gevent_4core_10dns_resolve_ipv4 = {__Pyx_NAMESTR("dns_resolve_ipv4"), (PyCFunction)__pyx_pf_6gevent_4core_10dns_resolve_ipv4, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_10dns_resolve_ipv4)};
 
6410
static PyObject *__pyx_pf_6gevent_4core_10dns_resolve_ipv4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6414
6411
  char *__pyx_v_name;
6415
6412
  int __pyx_v_flags;
6416
6413
  PyObject *__pyx_v_callback = 0;
6417
6414
  int __pyx_v_result;
6418
6415
  PyObject *__pyx_r = NULL;
6419
 
  int __pyx_t_1;
 
6416
  PyObject *__pyx_t_1 = NULL;
6420
6417
  PyObject *__pyx_t_2 = NULL;
6421
6418
  PyObject *__pyx_t_3 = NULL;
6422
6419
  PyObject *__pyx_t_4 = NULL;
6423
 
  PyObject *__pyx_t_5 = NULL;
6424
6420
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__flags,&__pyx_n_s__callback,0};
6425
6421
  __Pyx_RefNannySetupContext("dns_resolve_ipv4");
6426
6422
  __pyx_self = __pyx_self;
6455
6451
    if (unlikely(kw_args > 0)) {
6456
6452
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "dns_resolve_ipv4") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6457
6453
    }
6458
 
    __pyx_v_name = __Pyx_PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
6454
    __pyx_v_name = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6459
6455
    __pyx_v_flags = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6460
6456
    __pyx_v_callback = values[2];
6461
6457
  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6462
6458
    goto __pyx_L5_argtuple_error;
6463
6459
  } else {
6464
 
    __pyx_v_name = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
6460
    __pyx_v_name = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6465
6461
    __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6466
6462
    __pyx_v_callback = PyTuple_GET_ITEM(__pyx_args, 2);
6467
6463
  }
6470
6466
  __Pyx_RaiseArgtupleInvalid("dns_resolve_ipv4", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6471
6467
  __pyx_L3_error:;
6472
6468
  __Pyx_AddTraceback("gevent.core.dns_resolve_ipv4");
 
6469
  __Pyx_RefNannyFinishContext();
6473
6470
  return NULL;
6474
6471
  __pyx_L4_argument_unpacking_done:;
6475
 
  __Pyx_INCREF(__pyx_v_callback);
6476
6472
 
6477
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":91
 
6473
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":91
6478
6474
 *     - *callback* -- callback with ``(result, type, ttl, addrs)`` prototype
6479
6475
 *     """
6480
6476
 *     cdef int result = evdns_resolve_ipv4(name, flags, __evdns_callback, <void *>callback)             # <<<<<<<<<<<<<<
6483
6479
 */
6484
6480
  __pyx_v_result = evdns_resolve_ipv4(__pyx_v_name, __pyx_v_flags, __pyx_f_6gevent_4core___evdns_callback, ((void *)__pyx_v_callback));
6485
6481
 
6486
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":92
 
6482
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":92
6487
6483
 *     """
6488
6484
 *     cdef int result = evdns_resolve_ipv4(name, flags, __evdns_callback, <void *>callback)
6489
6485
 *     if result:             # <<<<<<<<<<<<<<
6490
6486
 *         raise IOError('evdns_resolve_ipv4(%r, %r) returned %s' % (name, flags, result, ))
6491
 
 *     Py_INCREF(callback)
 
6487
 *     Py_INCREF(<PyObjectPtr>callback)
6492
6488
 */
6493
 
  __pyx_t_1 = __pyx_v_result;
6494
 
  if (__pyx_t_1) {
 
6489
  if (__pyx_v_result) {
6495
6490
 
6496
 
    /* "/home/denis/work/gevent/gevent/evdns.pxi":93
 
6491
    /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":93
6497
6492
 *     cdef int result = evdns_resolve_ipv4(name, flags, __evdns_callback, <void *>callback)
6498
6493
 *     if result:
6499
6494
 *         raise IOError('evdns_resolve_ipv4(%r, %r) returned %s' % (name, flags, result, ))             # <<<<<<<<<<<<<<
6500
 
 *     Py_INCREF(callback)
 
6495
 *     Py_INCREF(<PyObjectPtr>callback)
6501
6496
 * 
6502
6497
 */
6503
 
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6504
 
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
6505
 
    __pyx_t_3 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6498
    __pyx_t_1 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6499
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
6500
    __pyx_t_2 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6501
    __Pyx_GOTREF(__pyx_t_2);
 
6502
    __pyx_t_3 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6506
6503
    __Pyx_GOTREF(__pyx_t_3);
6507
 
    __pyx_t_4 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6508
 
    __Pyx_GOTREF(__pyx_t_4);
6509
 
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6510
 
    __Pyx_GOTREF(__pyx_t_5);
6511
 
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
6512
 
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
6513
 
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
 
6504
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6505
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
 
6506
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
 
6507
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
 
6508
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
 
6509
    __Pyx_GIVEREF(__pyx_t_2);
 
6510
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
6514
6511
    __Pyx_GIVEREF(__pyx_t_3);
6515
 
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
6516
 
    __Pyx_GIVEREF(__pyx_t_4);
 
6512
    __pyx_t_1 = 0;
6517
6513
    __pyx_t_2 = 0;
6518
6514
    __pyx_t_3 = 0;
6519
 
    __pyx_t_4 = 0;
6520
 
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_16), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6521
 
    __Pyx_GOTREF(__pyx_t_4);
6522
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6523
 
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6524
 
    __Pyx_GOTREF(__pyx_t_5);
6525
 
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
6526
 
    __Pyx_GIVEREF(__pyx_t_4);
6527
 
    __pyx_t_4 = 0;
6528
 
    __pyx_t_4 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6529
 
    __Pyx_GOTREF(__pyx_t_4);
6530
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6531
 
    __Pyx_Raise(__pyx_t_4, 0, 0);
6532
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
6515
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_16), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6516
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
6517
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
 
6518
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6519
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
 
6520
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
 
6521
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
 
6522
    __pyx_t_3 = 0;
 
6523
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6524
    __Pyx_GOTREF(__pyx_t_3);
 
6525
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
 
6526
    __Pyx_Raise(__pyx_t_3, 0, 0);
 
6527
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6533
6528
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6534
6529
    goto __pyx_L6;
6535
6530
  }
6536
6531
  __pyx_L6:;
6537
6532
 
6538
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":94
 
6533
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":94
6539
6534
 *     if result:
6540
6535
 *         raise IOError('evdns_resolve_ipv4(%r, %r) returned %s' % (name, flags, result, ))
6541
 
 *     Py_INCREF(callback)             # <<<<<<<<<<<<<<
 
6536
 *     Py_INCREF(<PyObjectPtr>callback)             # <<<<<<<<<<<<<<
6542
6537
 * 
6543
6538
 * 
6544
6539
 */
6545
 
  Py_INCREF(__pyx_v_callback);
 
6540
  Py_INCREF(((PyObject*)__pyx_v_callback));
6546
6541
 
6547
6542
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6548
6543
  goto __pyx_L0;
6549
6544
  __pyx_L1_error:;
 
6545
  __Pyx_XDECREF(__pyx_t_1);
6550
6546
  __Pyx_XDECREF(__pyx_t_2);
6551
6547
  __Pyx_XDECREF(__pyx_t_3);
6552
6548
  __Pyx_XDECREF(__pyx_t_4);
6553
 
  __Pyx_XDECREF(__pyx_t_5);
6554
6549
  __Pyx_AddTraceback("gevent.core.dns_resolve_ipv4");
6555
6550
  __pyx_r = NULL;
6556
6551
  __pyx_L0:;
6557
 
  __Pyx_DECREF(__pyx_v_callback);
6558
6552
  __Pyx_XGIVEREF(__pyx_r);
6559
6553
  __Pyx_RefNannyFinishContext();
6560
6554
  return __pyx_r;
6561
6555
}
6562
6556
 
6563
 
/* "/home/denis/work/gevent/gevent/evdns.pxi":97
 
6557
/* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":97
6564
6558
 * 
6565
6559
 * 
6566
6560
 * def dns_resolve_ipv6(char *name, int flags, object callback):             # <<<<<<<<<<<<<<
6568
6562
 * 
6569
6563
 */
6570
6564
 
6571
 
static PyObject *__pyx_pf_6gevent_4core_dns_resolve_ipv6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6572
 
static char __pyx_doc_6gevent_4core_dns_resolve_ipv6[] = "Lookup an AAAA record for a given name.\n\n    - *name*     -- DNS hostname\n    - *flags*    -- either 0 or DNS_QUERY_NO_SEARCH\n    - *callback* -- callback with ``(result, type, ttl, addrs)`` prototype\n    ";
6573
 
static PyObject *__pyx_pf_6gevent_4core_dns_resolve_ipv6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
6565
static PyObject *__pyx_pf_6gevent_4core_11dns_resolve_ipv6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
6566
static char __pyx_doc_6gevent_4core_11dns_resolve_ipv6[] = "Lookup an AAAA record for a given name.\n\n    - *name*     -- DNS hostname\n    - *flags*    -- either 0 or DNS_QUERY_NO_SEARCH\n    - *callback* -- callback with ``(result, type, ttl, addrs)`` prototype\n    ";
 
6567
static PyMethodDef __pyx_mdef_6gevent_4core_11dns_resolve_ipv6 = {__Pyx_NAMESTR("dns_resolve_ipv6"), (PyCFunction)__pyx_pf_6gevent_4core_11dns_resolve_ipv6, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_11dns_resolve_ipv6)};
 
6568
static PyObject *__pyx_pf_6gevent_4core_11dns_resolve_ipv6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6574
6569
  char *__pyx_v_name;
6575
6570
  int __pyx_v_flags;
6576
6571
  PyObject *__pyx_v_callback = 0;
6577
6572
  int __pyx_v_result;
6578
6573
  PyObject *__pyx_r = NULL;
6579
 
  int __pyx_t_1;
 
6574
  PyObject *__pyx_t_1 = NULL;
6580
6575
  PyObject *__pyx_t_2 = NULL;
6581
6576
  PyObject *__pyx_t_3 = NULL;
6582
6577
  PyObject *__pyx_t_4 = NULL;
6583
 
  PyObject *__pyx_t_5 = NULL;
6584
6578
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,&__pyx_n_s__flags,&__pyx_n_s__callback,0};
6585
6579
  __Pyx_RefNannySetupContext("dns_resolve_ipv6");
6586
6580
  __pyx_self = __pyx_self;
6615
6609
    if (unlikely(kw_args > 0)) {
6616
6610
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "dns_resolve_ipv6") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6617
6611
    }
6618
 
    __pyx_v_name = __Pyx_PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
6612
    __pyx_v_name = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6619
6613
    __pyx_v_flags = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6620
6614
    __pyx_v_callback = values[2];
6621
6615
  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6622
6616
    goto __pyx_L5_argtuple_error;
6623
6617
  } else {
6624
 
    __pyx_v_name = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
6618
    __pyx_v_name = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6625
6619
    __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6626
6620
    __pyx_v_callback = PyTuple_GET_ITEM(__pyx_args, 2);
6627
6621
  }
6630
6624
  __Pyx_RaiseArgtupleInvalid("dns_resolve_ipv6", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6631
6625
  __pyx_L3_error:;
6632
6626
  __Pyx_AddTraceback("gevent.core.dns_resolve_ipv6");
 
6627
  __Pyx_RefNannyFinishContext();
6633
6628
  return NULL;
6634
6629
  __pyx_L4_argument_unpacking_done:;
6635
 
  __Pyx_INCREF(__pyx_v_callback);
6636
6630
 
6637
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":104
 
6631
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":104
6638
6632
 *     - *callback* -- callback with ``(result, type, ttl, addrs)`` prototype
6639
6633
 *     """
6640
6634
 *     cdef int result = evdns_resolve_ipv6(name, flags, __evdns_callback, <void *>callback)             # <<<<<<<<<<<<<<
6643
6637
 */
6644
6638
  __pyx_v_result = evdns_resolve_ipv6(__pyx_v_name, __pyx_v_flags, __pyx_f_6gevent_4core___evdns_callback, ((void *)__pyx_v_callback));
6645
6639
 
6646
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":105
 
6640
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":105
6647
6641
 *     """
6648
6642
 *     cdef int result = evdns_resolve_ipv6(name, flags, __evdns_callback, <void *>callback)
6649
6643
 *     if result:             # <<<<<<<<<<<<<<
6650
6644
 *         raise IOError('evdns_resolve_ip6(%r, %r) returned %s' % (name, flags, result, ))
6651
 
 *     Py_INCREF(callback)
 
6645
 *     Py_INCREF(<PyObjectPtr>callback)
6652
6646
 */
6653
 
  __pyx_t_1 = __pyx_v_result;
6654
 
  if (__pyx_t_1) {
 
6647
  if (__pyx_v_result) {
6655
6648
 
6656
 
    /* "/home/denis/work/gevent/gevent/evdns.pxi":106
 
6649
    /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":106
6657
6650
 *     cdef int result = evdns_resolve_ipv6(name, flags, __evdns_callback, <void *>callback)
6658
6651
 *     if result:
6659
6652
 *         raise IOError('evdns_resolve_ip6(%r, %r) returned %s' % (name, flags, result, ))             # <<<<<<<<<<<<<<
6660
 
 *     Py_INCREF(callback)
 
6653
 *     Py_INCREF(<PyObjectPtr>callback)
6661
6654
 * 
6662
6655
 */
6663
 
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6664
 
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
6665
 
    __pyx_t_3 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6656
    __pyx_t_1 = PyBytes_FromString(__pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6657
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
6658
    __pyx_t_2 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6659
    __Pyx_GOTREF(__pyx_t_2);
 
6660
    __pyx_t_3 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6666
6661
    __Pyx_GOTREF(__pyx_t_3);
6667
 
    __pyx_t_4 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6668
 
    __Pyx_GOTREF(__pyx_t_4);
6669
 
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6670
 
    __Pyx_GOTREF(__pyx_t_5);
6671
 
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
6672
 
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
6673
 
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
 
6662
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6663
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
 
6664
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
 
6665
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
 
6666
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
 
6667
    __Pyx_GIVEREF(__pyx_t_2);
 
6668
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
6674
6669
    __Pyx_GIVEREF(__pyx_t_3);
6675
 
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
6676
 
    __Pyx_GIVEREF(__pyx_t_4);
 
6670
    __pyx_t_1 = 0;
6677
6671
    __pyx_t_2 = 0;
6678
6672
    __pyx_t_3 = 0;
6679
 
    __pyx_t_4 = 0;
6680
 
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_17), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6681
 
    __Pyx_GOTREF(__pyx_t_4);
6682
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6683
 
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6684
 
    __Pyx_GOTREF(__pyx_t_5);
6685
 
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
6686
 
    __Pyx_GIVEREF(__pyx_t_4);
6687
 
    __pyx_t_4 = 0;
6688
 
    __pyx_t_4 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6689
 
    __Pyx_GOTREF(__pyx_t_4);
6690
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6691
 
    __Pyx_Raise(__pyx_t_4, 0, 0);
6692
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
6673
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_17), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6674
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
6675
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
 
6676
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6677
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
 
6678
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
 
6679
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
 
6680
    __pyx_t_3 = 0;
 
6681
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6682
    __Pyx_GOTREF(__pyx_t_3);
 
6683
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
 
6684
    __Pyx_Raise(__pyx_t_3, 0, 0);
 
6685
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6693
6686
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6694
6687
    goto __pyx_L6;
6695
6688
  }
6696
6689
  __pyx_L6:;
6697
6690
 
6698
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":107
 
6691
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":107
6699
6692
 *     if result:
6700
6693
 *         raise IOError('evdns_resolve_ip6(%r, %r) returned %s' % (name, flags, result, ))
6701
 
 *     Py_INCREF(callback)             # <<<<<<<<<<<<<<
 
6694
 *     Py_INCREF(<PyObjectPtr>callback)             # <<<<<<<<<<<<<<
6702
6695
 * 
6703
6696
 * 
6704
6697
 */
6705
 
  Py_INCREF(__pyx_v_callback);
 
6698
  Py_INCREF(((PyObject*)__pyx_v_callback));
6706
6699
 
6707
6700
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6708
6701
  goto __pyx_L0;
6709
6702
  __pyx_L1_error:;
 
6703
  __Pyx_XDECREF(__pyx_t_1);
6710
6704
  __Pyx_XDECREF(__pyx_t_2);
6711
6705
  __Pyx_XDECREF(__pyx_t_3);
6712
6706
  __Pyx_XDECREF(__pyx_t_4);
6713
 
  __Pyx_XDECREF(__pyx_t_5);
6714
6707
  __Pyx_AddTraceback("gevent.core.dns_resolve_ipv6");
6715
6708
  __pyx_r = NULL;
6716
6709
  __pyx_L0:;
6717
 
  __Pyx_DECREF(__pyx_v_callback);
6718
6710
  __Pyx_XGIVEREF(__pyx_r);
6719
6711
  __Pyx_RefNannyFinishContext();
6720
6712
  return __pyx_r;
6721
6713
}
6722
6714
 
6723
 
/* "/home/denis/work/gevent/gevent/evdns.pxi":110
 
6715
/* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":110
6724
6716
 * 
6725
6717
 * 
6726
6718
 * def dns_resolve_reverse(char* packed_ip, int flags, object callback):             # <<<<<<<<<<<<<<
6728
6720
 * 
6729
6721
 */
6730
6722
 
6731
 
static PyObject *__pyx_pf_6gevent_4core_dns_resolve_reverse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6732
 
static char __pyx_doc_6gevent_4core_dns_resolve_reverse[] = "Lookup a PTR record for a given IPv4 address.\n\n    - *packed_ip* -- IPv4 address (as 4-byte binary string)\n    - *flags*     -- either 0 or DNS_QUERY_NO_SEARCH\n    - *callback*  -- callback with ``(result, type, ttl, addrs)`` prototype\n    ";
6733
 
static PyObject *__pyx_pf_6gevent_4core_dns_resolve_reverse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
6723
static PyObject *__pyx_pf_6gevent_4core_12dns_resolve_reverse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
6724
static char __pyx_doc_6gevent_4core_12dns_resolve_reverse[] = "Lookup a PTR record for a given IPv4 address.\n\n    - *packed_ip* -- IPv4 address (as 4-byte binary string)\n    - *flags*     -- either 0 or DNS_QUERY_NO_SEARCH\n    - *callback*  -- callback with ``(result, type, ttl, addrs)`` prototype\n    ";
 
6725
static PyMethodDef __pyx_mdef_6gevent_4core_12dns_resolve_reverse = {__Pyx_NAMESTR("dns_resolve_reverse"), (PyCFunction)__pyx_pf_6gevent_4core_12dns_resolve_reverse, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_12dns_resolve_reverse)};
 
6726
static PyObject *__pyx_pf_6gevent_4core_12dns_resolve_reverse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6734
6727
  char *__pyx_v_packed_ip;
6735
6728
  int __pyx_v_flags;
6736
6729
  PyObject *__pyx_v_callback = 0;
6737
6730
  int __pyx_v_result;
6738
6731
  PyObject *__pyx_r = NULL;
6739
 
  int __pyx_t_1;
 
6732
  PyObject *__pyx_t_1 = NULL;
6740
6733
  PyObject *__pyx_t_2 = NULL;
6741
6734
  PyObject *__pyx_t_3 = NULL;
6742
6735
  PyObject *__pyx_t_4 = NULL;
6743
 
  PyObject *__pyx_t_5 = NULL;
6744
6736
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__packed_ip,&__pyx_n_s__flags,&__pyx_n_s__callback,0};
6745
6737
  __Pyx_RefNannySetupContext("dns_resolve_reverse");
6746
6738
  __pyx_self = __pyx_self;
6775
6767
    if (unlikely(kw_args > 0)) {
6776
6768
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "dns_resolve_reverse") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6777
6769
    }
6778
 
    __pyx_v_packed_ip = __Pyx_PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_packed_ip) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
6770
    __pyx_v_packed_ip = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_packed_ip) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6779
6771
    __pyx_v_flags = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6780
6772
    __pyx_v_callback = values[2];
6781
6773
  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6782
6774
    goto __pyx_L5_argtuple_error;
6783
6775
  } else {
6784
 
    __pyx_v_packed_ip = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_packed_ip) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
6776
    __pyx_v_packed_ip = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_packed_ip) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6785
6777
    __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6786
6778
    __pyx_v_callback = PyTuple_GET_ITEM(__pyx_args, 2);
6787
6779
  }
6790
6782
  __Pyx_RaiseArgtupleInvalid("dns_resolve_reverse", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6791
6783
  __pyx_L3_error:;
6792
6784
  __Pyx_AddTraceback("gevent.core.dns_resolve_reverse");
 
6785
  __Pyx_RefNannyFinishContext();
6793
6786
  return NULL;
6794
6787
  __pyx_L4_argument_unpacking_done:;
6795
 
  __Pyx_INCREF(__pyx_v_callback);
6796
6788
 
6797
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":117
 
6789
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":117
6798
6790
 *     - *callback*  -- callback with ``(result, type, ttl, addrs)`` prototype
6799
6791
 *     """
6800
6792
 *     cdef int result = evdns_resolve_reverse(<void *>packed_ip, flags, __evdns_callback, <void *>callback)             # <<<<<<<<<<<<<<
6803
6795
 */
6804
6796
  __pyx_v_result = evdns_resolve_reverse(((void *)__pyx_v_packed_ip), __pyx_v_flags, __pyx_f_6gevent_4core___evdns_callback, ((void *)__pyx_v_callback));
6805
6797
 
6806
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":118
 
6798
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":118
6807
6799
 *     """
6808
6800
 *     cdef int result = evdns_resolve_reverse(<void *>packed_ip, flags, __evdns_callback, <void *>callback)
6809
6801
 *     if result:             # <<<<<<<<<<<<<<
6810
6802
 *         raise IOError('evdns_resolve_reverse(%r, %r) returned %s' % (packed_ip, flags, result, ))
6811
 
 *     Py_INCREF(callback)
 
6803
 *     Py_INCREF(<PyObjectPtr>callback)
6812
6804
 */
6813
 
  __pyx_t_1 = __pyx_v_result;
6814
 
  if (__pyx_t_1) {
 
6805
  if (__pyx_v_result) {
6815
6806
 
6816
 
    /* "/home/denis/work/gevent/gevent/evdns.pxi":119
 
6807
    /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":119
6817
6808
 *     cdef int result = evdns_resolve_reverse(<void *>packed_ip, flags, __evdns_callback, <void *>callback)
6818
6809
 *     if result:
6819
6810
 *         raise IOError('evdns_resolve_reverse(%r, %r) returned %s' % (packed_ip, flags, result, ))             # <<<<<<<<<<<<<<
6820
 
 *     Py_INCREF(callback)
 
6811
 *     Py_INCREF(<PyObjectPtr>callback)
6821
6812
 * 
6822
6813
 */
6823
 
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_packed_ip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6824
 
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
6825
 
    __pyx_t_3 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6814
    __pyx_t_1 = PyBytes_FromString(__pyx_v_packed_ip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6815
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
6816
    __pyx_t_2 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6817
    __Pyx_GOTREF(__pyx_t_2);
 
6818
    __pyx_t_3 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6826
6819
    __Pyx_GOTREF(__pyx_t_3);
6827
 
    __pyx_t_4 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6828
 
    __Pyx_GOTREF(__pyx_t_4);
6829
 
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6830
 
    __Pyx_GOTREF(__pyx_t_5);
6831
 
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
6832
 
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
6833
 
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
 
6820
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6821
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
 
6822
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
 
6823
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
 
6824
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
 
6825
    __Pyx_GIVEREF(__pyx_t_2);
 
6826
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
6834
6827
    __Pyx_GIVEREF(__pyx_t_3);
6835
 
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
6836
 
    __Pyx_GIVEREF(__pyx_t_4);
 
6828
    __pyx_t_1 = 0;
6837
6829
    __pyx_t_2 = 0;
6838
6830
    __pyx_t_3 = 0;
6839
 
    __pyx_t_4 = 0;
6840
 
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_18), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6841
 
    __Pyx_GOTREF(__pyx_t_4);
6842
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6843
 
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6844
 
    __Pyx_GOTREF(__pyx_t_5);
6845
 
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
6846
 
    __Pyx_GIVEREF(__pyx_t_4);
6847
 
    __pyx_t_4 = 0;
6848
 
    __pyx_t_4 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6849
 
    __Pyx_GOTREF(__pyx_t_4);
6850
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6851
 
    __Pyx_Raise(__pyx_t_4, 0, 0);
6852
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
6831
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_18), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6832
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
6833
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
 
6834
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6835
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
 
6836
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
 
6837
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
 
6838
    __pyx_t_3 = 0;
 
6839
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6840
    __Pyx_GOTREF(__pyx_t_3);
 
6841
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
 
6842
    __Pyx_Raise(__pyx_t_3, 0, 0);
 
6843
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6853
6844
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6854
6845
    goto __pyx_L6;
6855
6846
  }
6856
6847
  __pyx_L6:;
6857
6848
 
6858
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":120
 
6849
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":120
6859
6850
 *     if result:
6860
6851
 *         raise IOError('evdns_resolve_reverse(%r, %r) returned %s' % (packed_ip, flags, result, ))
6861
 
 *     Py_INCREF(callback)             # <<<<<<<<<<<<<<
 
6852
 *     Py_INCREF(<PyObjectPtr>callback)             # <<<<<<<<<<<<<<
6862
6853
 * 
6863
6854
 * 
6864
6855
 */
6865
 
  Py_INCREF(__pyx_v_callback);
 
6856
  Py_INCREF(((PyObject*)__pyx_v_callback));
6866
6857
 
6867
6858
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6868
6859
  goto __pyx_L0;
6869
6860
  __pyx_L1_error:;
 
6861
  __Pyx_XDECREF(__pyx_t_1);
6870
6862
  __Pyx_XDECREF(__pyx_t_2);
6871
6863
  __Pyx_XDECREF(__pyx_t_3);
6872
6864
  __Pyx_XDECREF(__pyx_t_4);
6873
 
  __Pyx_XDECREF(__pyx_t_5);
6874
6865
  __Pyx_AddTraceback("gevent.core.dns_resolve_reverse");
6875
6866
  __pyx_r = NULL;
6876
6867
  __pyx_L0:;
6877
 
  __Pyx_DECREF(__pyx_v_callback);
6878
6868
  __Pyx_XGIVEREF(__pyx_r);
6879
6869
  __Pyx_RefNannyFinishContext();
6880
6870
  return __pyx_r;
6881
6871
}
6882
6872
 
6883
 
/* "/home/denis/work/gevent/gevent/evdns.pxi":123
 
6873
/* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":123
6884
6874
 * 
6885
6875
 * 
6886
6876
 * def dns_resolve_reverse_ipv6(char* packed_ip, int flags, object callback):             # <<<<<<<<<<<<<<
6888
6878
 * 
6889
6879
 */
6890
6880
 
6891
 
static PyObject *__pyx_pf_6gevent_4core_dns_resolve_reverse_ipv6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6892
 
static char __pyx_doc_6gevent_4core_dns_resolve_reverse_ipv6[] = "Lookup a PTR record for a given IPv6 address.\n\n    - *packed_ip* -- IPv6 address (as 16-byte binary string)\n    - *flags*     -- either 0 or DNS_QUERY_NO_SEARCH\n    - *callback*  -- callback with ``(result, type, ttl, addrs)`` prototype\n    ";
6893
 
static PyObject *__pyx_pf_6gevent_4core_dns_resolve_reverse_ipv6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
6881
static PyObject *__pyx_pf_6gevent_4core_13dns_resolve_reverse_ipv6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
6882
static char __pyx_doc_6gevent_4core_13dns_resolve_reverse_ipv6[] = "Lookup a PTR record for a given IPv6 address.\n\n    - *packed_ip* -- IPv6 address (as 16-byte binary string)\n    - *flags*     -- either 0 or DNS_QUERY_NO_SEARCH\n    - *callback*  -- callback with ``(result, type, ttl, addrs)`` prototype\n    ";
 
6883
static PyMethodDef __pyx_mdef_6gevent_4core_13dns_resolve_reverse_ipv6 = {__Pyx_NAMESTR("dns_resolve_reverse_ipv6"), (PyCFunction)__pyx_pf_6gevent_4core_13dns_resolve_reverse_ipv6, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_13dns_resolve_reverse_ipv6)};
 
6884
static PyObject *__pyx_pf_6gevent_4core_13dns_resolve_reverse_ipv6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6894
6885
  char *__pyx_v_packed_ip;
6895
6886
  int __pyx_v_flags;
6896
6887
  PyObject *__pyx_v_callback = 0;
6897
6888
  int __pyx_v_result;
6898
6889
  PyObject *__pyx_r = NULL;
6899
 
  int __pyx_t_1;
 
6890
  PyObject *__pyx_t_1 = NULL;
6900
6891
  PyObject *__pyx_t_2 = NULL;
6901
6892
  PyObject *__pyx_t_3 = NULL;
6902
6893
  PyObject *__pyx_t_4 = NULL;
6903
 
  PyObject *__pyx_t_5 = NULL;
6904
6894
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__packed_ip,&__pyx_n_s__flags,&__pyx_n_s__callback,0};
6905
6895
  __Pyx_RefNannySetupContext("dns_resolve_reverse_ipv6");
6906
6896
  __pyx_self = __pyx_self;
6935
6925
    if (unlikely(kw_args > 0)) {
6936
6926
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "dns_resolve_reverse_ipv6") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6937
6927
    }
6938
 
    __pyx_v_packed_ip = __Pyx_PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_packed_ip) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
6928
    __pyx_v_packed_ip = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_packed_ip) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6939
6929
    __pyx_v_flags = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6940
6930
    __pyx_v_callback = values[2];
6941
6931
  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6942
6932
    goto __pyx_L5_argtuple_error;
6943
6933
  } else {
6944
 
    __pyx_v_packed_ip = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_packed_ip) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
6934
    __pyx_v_packed_ip = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_packed_ip) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6945
6935
    __pyx_v_flags = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6946
6936
    __pyx_v_callback = PyTuple_GET_ITEM(__pyx_args, 2);
6947
6937
  }
6950
6940
  __Pyx_RaiseArgtupleInvalid("dns_resolve_reverse_ipv6", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
6951
6941
  __pyx_L3_error:;
6952
6942
  __Pyx_AddTraceback("gevent.core.dns_resolve_reverse_ipv6");
 
6943
  __Pyx_RefNannyFinishContext();
6953
6944
  return NULL;
6954
6945
  __pyx_L4_argument_unpacking_done:;
6955
 
  __Pyx_INCREF(__pyx_v_callback);
6956
6946
 
6957
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":130
 
6947
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":130
6958
6948
 *     - *callback*  -- callback with ``(result, type, ttl, addrs)`` prototype
6959
6949
 *     """
6960
6950
 *     cdef int result = evdns_resolve_reverse_ipv6(<void *>packed_ip, flags, __evdns_callback, <void *>callback)             # <<<<<<<<<<<<<<
6963
6953
 */
6964
6954
  __pyx_v_result = evdns_resolve_reverse_ipv6(((void *)__pyx_v_packed_ip), __pyx_v_flags, __pyx_f_6gevent_4core___evdns_callback, ((void *)__pyx_v_callback));
6965
6955
 
6966
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":131
 
6956
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":131
6967
6957
 *     """
6968
6958
 *     cdef int result = evdns_resolve_reverse_ipv6(<void *>packed_ip, flags, __evdns_callback, <void *>callback)
6969
6959
 *     if result:             # <<<<<<<<<<<<<<
6970
6960
 *         raise IOError('evdns_resolve_reverse_ipv6(%r, %r) returned %s' % (packed_ip, flags, result, ))
6971
 
 *     Py_INCREF(callback)
 
6961
 *     Py_INCREF(<PyObjectPtr>callback)
6972
6962
 */
6973
 
  __pyx_t_1 = __pyx_v_result;
6974
 
  if (__pyx_t_1) {
 
6963
  if (__pyx_v_result) {
6975
6964
 
6976
 
    /* "/home/denis/work/gevent/gevent/evdns.pxi":132
 
6965
    /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":132
6977
6966
 *     cdef int result = evdns_resolve_reverse_ipv6(<void *>packed_ip, flags, __evdns_callback, <void *>callback)
6978
6967
 *     if result:
6979
6968
 *         raise IOError('evdns_resolve_reverse_ipv6(%r, %r) returned %s' % (packed_ip, flags, result, ))             # <<<<<<<<<<<<<<
6980
 
 *     Py_INCREF(callback)
6981
 
 * 
 
6969
 *     Py_INCREF(<PyObjectPtr>callback)
6982
6970
 */
6983
 
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_packed_ip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6984
 
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
6985
 
    __pyx_t_3 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6971
    __pyx_t_1 = PyBytes_FromString(__pyx_v_packed_ip); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6972
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
6973
    __pyx_t_2 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6974
    __Pyx_GOTREF(__pyx_t_2);
 
6975
    __pyx_t_3 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6986
6976
    __Pyx_GOTREF(__pyx_t_3);
6987
 
    __pyx_t_4 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6988
 
    __Pyx_GOTREF(__pyx_t_4);
6989
 
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6990
 
    __Pyx_GOTREF(__pyx_t_5);
6991
 
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
6992
 
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
6993
 
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
 
6977
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6978
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
 
6979
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
 
6980
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
 
6981
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
 
6982
    __Pyx_GIVEREF(__pyx_t_2);
 
6983
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
6994
6984
    __Pyx_GIVEREF(__pyx_t_3);
6995
 
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
6996
 
    __Pyx_GIVEREF(__pyx_t_4);
 
6985
    __pyx_t_1 = 0;
6997
6986
    __pyx_t_2 = 0;
6998
6987
    __pyx_t_3 = 0;
6999
 
    __pyx_t_4 = 0;
7000
 
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_19), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7001
 
    __Pyx_GOTREF(__pyx_t_4);
7002
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7003
 
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7004
 
    __Pyx_GOTREF(__pyx_t_5);
7005
 
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
7006
 
    __Pyx_GIVEREF(__pyx_t_4);
7007
 
    __pyx_t_4 = 0;
7008
 
    __pyx_t_4 = PyObject_Call(__pyx_builtin_IOError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7009
 
    __Pyx_GOTREF(__pyx_t_4);
7010
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7011
 
    __Pyx_Raise(__pyx_t_4, 0, 0);
7012
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
6988
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_19), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6989
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
6990
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
 
6991
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6992
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
 
6993
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
 
6994
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
 
6995
    __pyx_t_3 = 0;
 
6996
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
6997
    __Pyx_GOTREF(__pyx_t_3);
 
6998
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
 
6999
    __Pyx_Raise(__pyx_t_3, 0, 0);
 
7000
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7013
7001
    {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7014
7002
    goto __pyx_L6;
7015
7003
  }
7016
7004
  __pyx_L6:;
7017
7005
 
7018
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":133
 
7006
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":133
7019
7007
 *     if result:
7020
7008
 *         raise IOError('evdns_resolve_reverse_ipv6(%r, %r) returned %s' % (packed_ip, flags, result, ))
7021
 
 *     Py_INCREF(callback)             # <<<<<<<<<<<<<<
7022
 
 * 
 
7009
 *     Py_INCREF(<PyObjectPtr>callback)             # <<<<<<<<<<<<<<
7023
7010
 */
7024
 
  Py_INCREF(__pyx_v_callback);
 
7011
  Py_INCREF(((PyObject*)__pyx_v_callback));
7025
7012
 
7026
7013
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7027
7014
  goto __pyx_L0;
7028
7015
  __pyx_L1_error:;
 
7016
  __Pyx_XDECREF(__pyx_t_1);
7029
7017
  __Pyx_XDECREF(__pyx_t_2);
7030
7018
  __Pyx_XDECREF(__pyx_t_3);
7031
7019
  __Pyx_XDECREF(__pyx_t_4);
7032
 
  __Pyx_XDECREF(__pyx_t_5);
7033
7020
  __Pyx_AddTraceback("gevent.core.dns_resolve_reverse_ipv6");
7034
7021
  __pyx_r = NULL;
7035
7022
  __pyx_L0:;
7036
 
  __Pyx_DECREF(__pyx_v_callback);
7037
7023
  __Pyx_XGIVEREF(__pyx_r);
7038
7024
  __Pyx_RefNannyFinishContext();
7039
7025
  return __pyx_r;
7040
7026
}
7041
7027
 
7042
 
/* "/home/denis/work/gevent/gevent/evbuffer.pxi":27
 
7028
/* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":27
7043
7029
 *     cdef evbuffer* __obj
7044
7030
 * 
7045
7031
 *     def __init__(self, size_t _obj):             # <<<<<<<<<<<<<<
7081
7067
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7082
7068
  __pyx_L3_error:;
7083
7069
  __Pyx_AddTraceback("gevent.core.buffer.__init__");
 
7070
  __Pyx_RefNannyFinishContext();
7084
7071
  return -1;
7085
7072
  __pyx_L4_argument_unpacking_done:;
7086
7073
 
7087
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":28
 
7074
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":28
7088
7075
 * 
7089
7076
 *     def __init__(self, size_t _obj):
7090
7077
 *         self.__obj = <evbuffer*>_obj             # <<<<<<<<<<<<<<
7098
7085
  return __pyx_r;
7099
7086
}
7100
7087
 
7101
 
/* "/home/denis/work/gevent/gevent/evbuffer.pxi":32
 
7088
/* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":32
7102
7089
 *     property _obj:
7103
7090
 * 
7104
7091
 *         def __get__(self):             # <<<<<<<<<<<<<<
7112
7099
  PyObject *__pyx_t_1 = NULL;
7113
7100
  __Pyx_RefNannySetupContext("__get__");
7114
7101
 
7115
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":33
 
7102
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":33
7116
7103
 * 
7117
7104
 *         def __get__(self):
7118
7105
 *             return <size_t>(self.__obj)             # <<<<<<<<<<<<<<
7138
7125
  return __pyx_r;
7139
7126
}
7140
7127
 
7141
 
/* "/home/denis/work/gevent/gevent/evbuffer.pxi":35
 
7128
/* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":35
7142
7129
 *             return <size_t>(self.__obj)
7143
7130
 * 
7144
7131
 *     def __len__(self):             # <<<<<<<<<<<<<<
7146
7133
 *             return evbuffer_get_length(self.__obj)
7147
7134
 */
7148
7135
 
7149
 
static Py_ssize_t __pyx_pf_6gevent_4core_6buffer___len__(PyObject *__pyx_v_self); /*proto*/
7150
 
static Py_ssize_t __pyx_pf_6gevent_4core_6buffer___len__(PyObject *__pyx_v_self) {
 
7136
static Py_ssize_t __pyx_pf_6gevent_4core_6buffer_1__len__(PyObject *__pyx_v_self); /*proto*/
 
7137
static Py_ssize_t __pyx_pf_6gevent_4core_6buffer_1__len__(PyObject *__pyx_v_self) {
7151
7138
  Py_ssize_t __pyx_r;
7152
7139
  int __pyx_t_1;
7153
7140
  __Pyx_RefNannySetupContext("__len__");
7154
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
7155
7141
 
7156
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":36
 
7142
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":36
7157
7143
 * 
7158
7144
 *     def __len__(self):
7159
7145
 *         if self.__obj:             # <<<<<<<<<<<<<<
7163
7149
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_buffer *)__pyx_v_self)->__pyx___obj != 0);
7164
7150
  if (__pyx_t_1) {
7165
7151
 
7166
 
    /* "/home/denis/work/gevent/gevent/evbuffer.pxi":37
 
7152
    /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":37
7167
7153
 *     def __len__(self):
7168
7154
 *         if self.__obj:
7169
7155
 *             return evbuffer_get_length(self.__obj)             # <<<<<<<<<<<<<<
7176
7162
  }
7177
7163
  /*else*/ {
7178
7164
 
7179
 
    /* "/home/denis/work/gevent/gevent/evbuffer.pxi":39
 
7165
    /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":39
7180
7166
 *             return evbuffer_get_length(self.__obj)
7181
7167
 *         else:
7182
7168
 *             return 0             # <<<<<<<<<<<<<<
7190
7176
 
7191
7177
  __pyx_r = 0;
7192
7178
  __pyx_L0:;
7193
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
7194
7179
  __Pyx_RefNannyFinishContext();
7195
7180
  return __pyx_r;
7196
7181
}
7197
7182
 
7198
 
/* "/home/denis/work/gevent/gevent/evbuffer.pxi":41
 
7183
/* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":41
7199
7184
 *             return 0
7200
7185
 * 
7201
7186
 *     def __nonzero__(self):             # <<<<<<<<<<<<<<
7203
7188
 *             return evbuffer_get_length(self.__obj)
7204
7189
 */
7205
7190
 
7206
 
static int __pyx_pf_6gevent_4core_6buffer___nonzero__(PyObject *__pyx_v_self); /*proto*/
7207
 
static int __pyx_pf_6gevent_4core_6buffer___nonzero__(PyObject *__pyx_v_self) {
 
7191
static int __pyx_pf_6gevent_4core_6buffer_2__nonzero__(PyObject *__pyx_v_self); /*proto*/
 
7192
static int __pyx_pf_6gevent_4core_6buffer_2__nonzero__(PyObject *__pyx_v_self) {
7208
7193
  int __pyx_r;
7209
7194
  int __pyx_t_1;
7210
7195
  __Pyx_RefNannySetupContext("__nonzero__");
7211
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
7212
7196
 
7213
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":42
 
7197
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":42
7214
7198
 * 
7215
7199
 *     def __nonzero__(self):
7216
7200
 *         if self.__obj:             # <<<<<<<<<<<<<<
7220
7204
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_buffer *)__pyx_v_self)->__pyx___obj != 0);
7221
7205
  if (__pyx_t_1) {
7222
7206
 
7223
 
    /* "/home/denis/work/gevent/gevent/evbuffer.pxi":43
 
7207
    /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":43
7224
7208
 *     def __nonzero__(self):
7225
7209
 *         if self.__obj:
7226
7210
 *             return evbuffer_get_length(self.__obj)             # <<<<<<<<<<<<<<
7235
7219
 
7236
7220
  __pyx_r = 0;
7237
7221
  __pyx_L0:;
7238
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
7239
7222
  __Pyx_RefNannyFinishContext();
7240
7223
  return __pyx_r;
7241
7224
}
7242
7225
 
7243
 
/* "/home/denis/work/gevent/gevent/evbuffer.pxi":45
 
7226
/* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":45
7244
7227
 *             return evbuffer_get_length(self.__obj)
7245
7228
 * 
7246
7229
 *     def detach(self):             # <<<<<<<<<<<<<<
7248
7231
 * 
7249
7232
 */
7250
7233
 
7251
 
static PyObject *__pyx_pf_6gevent_4core_6buffer_detach(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
7252
 
static PyObject *__pyx_pf_6gevent_4core_6buffer_detach(PyObject *__pyx_v_self, PyObject *unused) {
 
7234
static PyObject *__pyx_pf_6gevent_4core_6buffer_3detach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
7235
static PyObject *__pyx_pf_6gevent_4core_6buffer_3detach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7253
7236
  PyObject *__pyx_r = NULL;
7254
7237
  __Pyx_RefNannySetupContext("detach");
7255
7238
 
7256
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":46
 
7239
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":46
7257
7240
 * 
7258
7241
 *     def detach(self):
7259
7242
 *         self.__obj = NULL             # <<<<<<<<<<<<<<
7268
7251
  return __pyx_r;
7269
7252
}
7270
7253
 
7271
 
/* "/home/denis/work/gevent/gevent/evbuffer.pxi":48
 
7254
/* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":48
7272
7255
 *         self.__obj = NULL
7273
7256
 * 
7274
7257
 *     def __iter__(self):             # <<<<<<<<<<<<<<
7276
7259
 * 
7277
7260
 */
7278
7261
 
7279
 
static PyObject *__pyx_pf_6gevent_4core_6buffer___iter__(PyObject *__pyx_v_self); /*proto*/
7280
 
static PyObject *__pyx_pf_6gevent_4core_6buffer___iter__(PyObject *__pyx_v_self) {
 
7262
static PyObject *__pyx_pf_6gevent_4core_6buffer_4__iter__(PyObject *__pyx_v_self); /*proto*/
 
7263
static PyObject *__pyx_pf_6gevent_4core_6buffer_4__iter__(PyObject *__pyx_v_self) {
7281
7264
  PyObject *__pyx_r = NULL;
7282
7265
  __Pyx_RefNannySetupContext("__iter__");
7283
7266
 
7284
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":49
 
7267
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":49
7285
7268
 * 
7286
7269
 *     def __iter__(self):
7287
7270
 *         return self             # <<<<<<<<<<<<<<
7300
7283
  return __pyx_r;
7301
7284
}
7302
7285
 
7303
 
/* "/home/denis/work/gevent/gevent/evbuffer.pxi":51
 
7286
/* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":51
7304
7287
 *         return self
7305
7288
 * 
7306
7289
 *     def __next__(self):             # <<<<<<<<<<<<<<
7308
7291
 *         if not line:
7309
7292
 */
7310
7293
 
7311
 
static PyObject *__pyx_pf_6gevent_4core_6buffer___next__(PyObject *__pyx_v_self); /*proto*/
7312
 
static PyObject *__pyx_pf_6gevent_4core_6buffer___next__(PyObject *__pyx_v_self) {
 
7294
static PyObject *__pyx_pf_6gevent_4core_6buffer_5__next__(PyObject *__pyx_v_self); /*proto*/
 
7295
static PyObject *__pyx_pf_6gevent_4core_6buffer_5__next__(PyObject *__pyx_v_self) {
7313
7296
  PyObject *__pyx_v_line;
7314
7297
  PyObject *__pyx_r = NULL;
7315
7298
  PyObject *__pyx_t_1 = NULL;
7317
7300
  int __pyx_t_3;
7318
7301
  int __pyx_t_4;
7319
7302
  __Pyx_RefNannySetupContext("__next__");
7320
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
7321
7303
  __pyx_v_line = Py_None; __Pyx_INCREF(Py_None);
7322
7304
 
7323
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":52
 
7305
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":52
7324
7306
 * 
7325
7307
 *     def __next__(self):
7326
7308
 *         line = self.readline()             # <<<<<<<<<<<<<<
7336
7318
  __pyx_v_line = __pyx_t_2;
7337
7319
  __pyx_t_2 = 0;
7338
7320
 
7339
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":53
 
7321
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":53
7340
7322
 *     def __next__(self):
7341
7323
 *         line = self.readline()
7342
7324
 *         if not line:             # <<<<<<<<<<<<<<
7347
7329
  __pyx_t_4 = (!__pyx_t_3);
7348
7330
  if (__pyx_t_4) {
7349
7331
 
7350
 
    /* "/home/denis/work/gevent/gevent/evbuffer.pxi":54
 
7332
    /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":54
7351
7333
 *         line = self.readline()
7352
7334
 *         if not line:
7353
7335
 *             raise StopIteration             # <<<<<<<<<<<<<<
7360
7342
  }
7361
7343
  __pyx_L5:;
7362
7344
 
7363
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":55
 
7345
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":55
7364
7346
 *         if not line:
7365
7347
 *             raise StopIteration
7366
7348
 *         return line             # <<<<<<<<<<<<<<
7381
7363
  __pyx_r = NULL;
7382
7364
  __pyx_L0:;
7383
7365
  __Pyx_DECREF(__pyx_v_line);
7384
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
7385
7366
  __Pyx_XGIVEREF(__pyx_r);
7386
7367
  __Pyx_RefNannyFinishContext();
7387
7368
  return __pyx_r;
7388
7369
}
7389
7370
 
7390
 
/* "/home/denis/work/gevent/gevent/evbuffer.pxi":57
 
7371
/* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":57
7391
7372
 *         return line
7392
7373
 * 
7393
7374
 *     def read(self, long size=-1):             # <<<<<<<<<<<<<<
7395
7376
 * 
7396
7377
 */
7397
7378
 
7398
 
static PyObject *__pyx_pf_6gevent_4core_6buffer_read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7399
 
static char __pyx_doc_6gevent_4core_6buffer_read[] = "Drain the first *size* bytes from the buffer (or what's left if there are less than *size* bytes).\n\n        If *size* is negative, drain the whole buffer.\n        ";
7400
 
static PyObject *__pyx_pf_6gevent_4core_6buffer_read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
7379
static PyObject *__pyx_pf_6gevent_4core_6buffer_6read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
7380
static char __pyx_doc_6gevent_4core_6buffer_6read[] = "Drain the first *size* bytes from the buffer (or what's left if there are less than *size* bytes).\n\n        If *size* is negative, drain the whole buffer.\n        ";
 
7381
static PyObject *__pyx_pf_6gevent_4core_6buffer_6read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7401
7382
  long __pyx_v_size;
7402
7383
  long __pyx_v_length;
7403
7384
  char *__pyx_v_data;
7405
7386
  int __pyx_v_res;
7406
7387
  PyObject *__pyx_r = NULL;
7407
7388
  int __pyx_t_1;
7408
 
  PyObject *__pyx_t_2 = NULL;
7409
 
  PyObject *__pyx_t_3 = NULL;
7410
 
  PyObject *__pyx_t_4 = NULL;
7411
 
  long __pyx_t_5;
7412
 
  int __pyx_t_6;
 
7389
  long __pyx_t_2;
 
7390
  long __pyx_t_3;
 
7391
  long __pyx_t_4;
 
7392
  PyObject *__pyx_t_5 = NULL;
 
7393
  PyObject *__pyx_t_6 = NULL;
7413
7394
  PyObject *__pyx_t_7 = NULL;
7414
7395
  PyObject *__pyx_t_8 = NULL;
 
7396
  PyObject *__pyx_t_9 = NULL;
7415
7397
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0};
7416
7398
  __Pyx_RefNannySetupContext("read");
7417
7399
  if (unlikely(__pyx_kwds)) {
7424
7406
    }
7425
7407
    switch (PyTuple_GET_SIZE(__pyx_args)) {
7426
7408
      case  0:
7427
 
      if (kw_args > 1) {
 
7409
      if (kw_args > 0) {
7428
7410
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
7429
 
        if (unlikely(value)) { values[0] = value; kw_args--; }
 
7411
        if (value) { values[0] = value; kw_args--; }
7430
7412
      }
7431
7413
    }
7432
7414
    if (unlikely(kw_args > 0)) {
7450
7432
  __Pyx_RaiseArgtupleInvalid("read", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7451
7433
  __pyx_L3_error:;
7452
7434
  __Pyx_AddTraceback("gevent.core.buffer.read");
 
7435
  __Pyx_RefNannyFinishContext();
7453
7436
  return NULL;
7454
7437
  __pyx_L4_argument_unpacking_done:;
7455
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
7456
7438
 
7457
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":62
 
7439
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":62
7458
7440
 *         If *size* is negative, drain the whole buffer.
7459
7441
 *         """
7460
7442
 *         if not self.__obj:             # <<<<<<<<<<<<<<
7464
7446
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_buffer *)__pyx_v_self)->__pyx___obj != 0));
7465
7447
  if (__pyx_t_1) {
7466
7448
 
7467
 
    /* "/home/denis/work/gevent/gevent/evbuffer.pxi":63
 
7449
    /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":63
7468
7450
 *         """
7469
7451
 *         if not self.__obj:
7470
7452
 *             return ''             # <<<<<<<<<<<<<<
7479
7461
  }
7480
7462
  __pyx_L6:;
7481
7463
 
7482
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":64
 
7464
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":64
7483
7465
 *         if not self.__obj:
7484
7466
 *             return ''
7485
7467
 *         cdef long length = evbuffer_get_length(self.__obj)             # <<<<<<<<<<<<<<
7488
7470
 */
7489
7471
  __pyx_v_length = evbuffer_get_length(((struct __pyx_obj_6gevent_4core_buffer *)__pyx_v_self)->__pyx___obj);
7490
7472
 
7491
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":65
 
7473
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":65
7492
7474
 *             return ''
7493
7475
 *         cdef long length = evbuffer_get_length(self.__obj)
7494
7476
 *         if size < 0:             # <<<<<<<<<<<<<<
7498
7480
  __pyx_t_1 = (__pyx_v_size < 0);
7499
7481
  if (__pyx_t_1) {
7500
7482
 
7501
 
    /* "/home/denis/work/gevent/gevent/evbuffer.pxi":66
 
7483
    /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":66
7502
7484
 *         cdef long length = evbuffer_get_length(self.__obj)
7503
7485
 *         if size < 0:
7504
7486
 *             size = length             # <<<<<<<<<<<<<<
7510
7492
  }
7511
7493
  /*else*/ {
7512
7494
 
7513
 
    /* "/home/denis/work/gevent/gevent/evbuffer.pxi":68
 
7495
    /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":68
7514
7496
 *             size = length
7515
7497
 *         else:
7516
7498
 *             size = min(size, length)             # <<<<<<<<<<<<<<
7517
7499
 *         if size <= 0:
7518
7500
 *             return ''
7519
7501
 */
7520
 
    __pyx_t_2 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7521
 
    __Pyx_GOTREF(__pyx_t_2);
7522
 
    __pyx_t_3 = PyInt_FromLong(__pyx_v_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7523
 
    __Pyx_GOTREF(__pyx_t_3);
7524
 
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7525
 
    __Pyx_GOTREF(__pyx_t_4);
7526
 
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
7527
 
    __Pyx_GIVEREF(__pyx_t_2);
7528
 
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
7529
 
    __Pyx_GIVEREF(__pyx_t_3);
7530
 
    __pyx_t_2 = 0;
7531
 
    __pyx_t_3 = 0;
7532
 
    __pyx_t_3 = PyObject_Call(__pyx_builtin_min, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7533
 
    __Pyx_GOTREF(__pyx_t_3);
7534
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7535
 
    __pyx_t_5 = __Pyx_PyInt_AsLong(__pyx_t_3); if (unlikely((__pyx_t_5 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7536
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7537
 
    __pyx_v_size = __pyx_t_5;
 
7502
    __pyx_t_2 = __pyx_v_length;
 
7503
    __pyx_t_3 = __pyx_v_size;
 
7504
    if ((__pyx_t_2 < __pyx_t_3)) {
 
7505
      __pyx_t_4 = __pyx_t_2;
 
7506
    } else {
 
7507
      __pyx_t_4 = __pyx_t_3;
 
7508
    }
 
7509
    __pyx_v_size = __pyx_t_4;
7538
7510
  }
7539
7511
  __pyx_L7:;
7540
7512
 
7541
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":69
 
7513
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":69
7542
7514
 *         else:
7543
7515
 *             size = min(size, length)
7544
7516
 *         if size <= 0:             # <<<<<<<<<<<<<<
7548
7520
  __pyx_t_1 = (__pyx_v_size <= 0);
7549
7521
  if (__pyx_t_1) {
7550
7522
 
7551
 
    /* "/home/denis/work/gevent/gevent/evbuffer.pxi":70
 
7523
    /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":70
7552
7524
 *             size = min(size, length)
7553
7525
 *         if size <= 0:
7554
7526
 *             return ''             # <<<<<<<<<<<<<<
7563
7535
  }
7564
7536
  __pyx_L8:;
7565
7537
 
7566
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":71
 
7538
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":71
7567
7539
 *         if size <= 0:
7568
7540
 *             return ''
7569
7541
 *         cdef char* data = <char*>EVBUFFER_PULLUP(self.__obj, size)             # <<<<<<<<<<<<<<
7572
7544
 */
7573
7545
  __pyx_v_data = ((char *)EVBUFFER_PULLUP(((struct __pyx_obj_6gevent_4core_buffer *)__pyx_v_self)->__pyx___obj, __pyx_v_size));
7574
7546
 
7575
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":72
 
7547
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":72
7576
7548
 *             return ''
7577
7549
 *         cdef char* data = <char*>EVBUFFER_PULLUP(self.__obj, size)
7578
7550
 *         if not data:             # <<<<<<<<<<<<<<
7582
7554
  __pyx_t_1 = (!(__pyx_v_data != 0));
7583
7555
  if (__pyx_t_1) {
7584
7556
 
7585
 
    /* "/home/denis/work/gevent/gevent/evbuffer.pxi":73
 
7557
    /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":73
7586
7558
 *         cdef char* data = <char*>EVBUFFER_PULLUP(self.__obj, size)
7587
7559
 *         if not data:
7588
7560
 *             return ''             # <<<<<<<<<<<<<<
7597
7569
  }
7598
7570
  __pyx_L9:;
7599
7571
 
7600
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":74
 
7572
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":74
7601
7573
 *         if not data:
7602
7574
 *             return ''
7603
7575
 *         cdef object result = PyString_FromStringAndSize(data, size)             # <<<<<<<<<<<<<<
7604
7576
 *         cdef int res = EVBUFFER_DRAIN(self.__obj, size)
7605
7577
 *         if res:
7606
7578
 */
7607
 
  __pyx_t_3 = PyString_FromStringAndSize(__pyx_v_data, __pyx_v_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
7608
 
  __Pyx_GOTREF(__pyx_t_3);
7609
 
  __pyx_v_result = __pyx_t_3;
7610
 
  __pyx_t_3 = 0;
 
7579
  __pyx_t_5 = PyString_FromStringAndSize(__pyx_v_data, __pyx_v_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
7580
  __Pyx_GOTREF(__pyx_t_5);
 
7581
  __pyx_v_result = __pyx_t_5;
 
7582
  __pyx_t_5 = 0;
7611
7583
 
7612
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":75
 
7584
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":75
7613
7585
 *             return ''
7614
7586
 *         cdef object result = PyString_FromStringAndSize(data, size)
7615
7587
 *         cdef int res = EVBUFFER_DRAIN(self.__obj, size)             # <<<<<<<<<<<<<<
7618
7590
 */
7619
7591
  __pyx_v_res = EVBUFFER_DRAIN(((struct __pyx_obj_6gevent_4core_buffer *)__pyx_v_self)->__pyx___obj, __pyx_v_size);
7620
7592
 
7621
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":76
 
7593
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":76
7622
7594
 *         cdef object result = PyString_FromStringAndSize(data, size)
7623
7595
 *         cdef int res = EVBUFFER_DRAIN(self.__obj, size)
7624
7596
 *         if res:             # <<<<<<<<<<<<<<
7625
7597
 *             try:
7626
7598
 *                 sys.stderr.write('evbuffer_drain(0x%x, %s) returned %s\n' % (self._obj, size, res))
7627
7599
 */
7628
 
  __pyx_t_6 = __pyx_v_res;
7629
 
  if (__pyx_t_6) {
 
7600
  if (__pyx_v_res) {
7630
7601
 
7631
 
    /* "/home/denis/work/gevent/gevent/evbuffer.pxi":77
 
7602
    /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":77
7632
7603
 *         cdef int res = EVBUFFER_DRAIN(self.__obj, size)
7633
7604
 *         if res:
7634
7605
 *             try:             # <<<<<<<<<<<<<<
7643
7614
      __Pyx_XGOTREF(__pyx_save_exc_tb);
7644
7615
      /*try:*/ {
7645
7616
 
7646
 
        /* "/home/denis/work/gevent/gevent/evbuffer.pxi":78
 
7617
        /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":78
7647
7618
 *         if res:
7648
7619
 *             try:
7649
7620
 *                 sys.stderr.write('evbuffer_drain(0x%x, %s) returned %s\n' % (self._obj, size, res))             # <<<<<<<<<<<<<<
7650
7621
 *             except:
7651
7622
 *                 traceback.print_exc()
7652
7623
 */
7653
 
        __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
7654
 
        __Pyx_GOTREF(__pyx_t_3);
7655
 
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__stderr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
7656
 
        __Pyx_GOTREF(__pyx_t_4);
7657
 
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7658
 
        __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__write); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
7659
 
        __Pyx_GOTREF(__pyx_t_3);
7660
 
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7661
 
        __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___obj); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
7662
 
        __Pyx_GOTREF(__pyx_t_4);
7663
 
        __pyx_t_2 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
7664
 
        __Pyx_GOTREF(__pyx_t_2);
7665
 
        __pyx_t_7 = PyInt_FromLong(__pyx_v_res); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
7666
 
        __Pyx_GOTREF(__pyx_t_7);
7667
 
        __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
7668
 
        __Pyx_GOTREF(__pyx_t_8);
7669
 
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4);
7670
 
        __Pyx_GIVEREF(__pyx_t_4);
7671
 
        PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
7672
 
        __Pyx_GIVEREF(__pyx_t_2);
7673
 
        PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
7674
 
        __Pyx_GIVEREF(__pyx_t_7);
7675
 
        __pyx_t_4 = 0;
7676
 
        __pyx_t_2 = 0;
7677
 
        __pyx_t_7 = 0;
7678
 
        __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_20), __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
7679
 
        __Pyx_GOTREF(__pyx_t_7);
7680
 
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7681
 
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
7682
 
        __Pyx_GOTREF(__pyx_t_8);
7683
 
        PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
7684
 
        __Pyx_GIVEREF(__pyx_t_7);
7685
 
        __pyx_t_7 = 0;
7686
 
        __pyx_t_7 = PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
7687
 
        __Pyx_GOTREF(__pyx_t_7);
7688
 
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7689
 
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7690
 
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
7624
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
 
7625
        __Pyx_GOTREF(__pyx_t_5);
 
7626
        __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__stderr); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
 
7627
        __Pyx_GOTREF(__pyx_t_6);
 
7628
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
7629
        __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
 
7630
        __Pyx_GOTREF(__pyx_t_5);
 
7631
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
7632
        __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___obj); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
 
7633
        __Pyx_GOTREF(__pyx_t_6);
 
7634
        __pyx_t_7 = PyInt_FromLong(__pyx_v_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
 
7635
        __Pyx_GOTREF(__pyx_t_7);
 
7636
        __pyx_t_8 = PyInt_FromLong(__pyx_v_res); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
 
7637
        __Pyx_GOTREF(__pyx_t_8);
 
7638
        __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
 
7639
        __Pyx_GOTREF(((PyObject *)__pyx_t_9));
 
7640
        PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6);
 
7641
        __Pyx_GIVEREF(__pyx_t_6);
 
7642
        PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7);
 
7643
        __Pyx_GIVEREF(__pyx_t_7);
 
7644
        PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_8);
 
7645
        __Pyx_GIVEREF(__pyx_t_8);
 
7646
        __pyx_t_6 = 0;
 
7647
        __pyx_t_7 = 0;
 
7648
        __pyx_t_8 = 0;
 
7649
        __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_20), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
 
7650
        __Pyx_GOTREF(((PyObject *)__pyx_t_8));
 
7651
        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
 
7652
        __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
 
7653
        __Pyx_GOTREF(((PyObject *)__pyx_t_9));
 
7654
        PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_8));
 
7655
        __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
 
7656
        __pyx_t_8 = 0;
 
7657
        __pyx_t_8 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
 
7658
        __Pyx_GOTREF(__pyx_t_8);
 
7659
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
7660
        __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
 
7661
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7691
7662
      }
7692
7663
      __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
7693
7664
      __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
7694
7665
      __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
7695
7666
      goto __pyx_L18_try_end;
7696
7667
      __pyx_L11_error:;
7697
 
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7698
 
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7699
 
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
7668
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
 
7669
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
 
7670
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
7671
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
7700
7672
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7701
 
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7702
7673
 
7703
 
      /* "/home/denis/work/gevent/gevent/evbuffer.pxi":79
 
7674
      /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":79
7704
7675
 *             try:
7705
7676
 *                 sys.stderr.write('evbuffer_drain(0x%x, %s) returned %s\n' % (self._obj, size, res))
7706
7677
 *             except:             # <<<<<<<<<<<<<<
7709
7680
 */
7710
7681
      /*except:*/ {
7711
7682
        __Pyx_AddTraceback("gevent.core.buffer.read");
7712
 
        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
7713
 
        __Pyx_GOTREF(__pyx_t_7);
 
7683
        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
7714
7684
        __Pyx_GOTREF(__pyx_t_8);
7715
 
        __Pyx_GOTREF(__pyx_t_3);
 
7685
        __Pyx_GOTREF(__pyx_t_9);
 
7686
        __Pyx_GOTREF(__pyx_t_5);
7716
7687
 
7717
 
        /* "/home/denis/work/gevent/gevent/evbuffer.pxi":80
 
7688
        /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":80
7718
7689
 *                 sys.stderr.write('evbuffer_drain(0x%x, %s) returned %s\n' % (self._obj, size, res))
7719
7690
 *             except:
7720
7691
 *                 traceback.print_exc()             # <<<<<<<<<<<<<<
7721
7692
 *         return result
7722
7693
 * 
7723
7694
 */
7724
 
        __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
7725
 
        __Pyx_GOTREF(__pyx_t_2);
7726
 
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
7727
 
        __Pyx_GOTREF(__pyx_t_4);
7728
 
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7729
 
        __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
7730
 
        __Pyx_GOTREF(__pyx_t_2);
7731
 
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7732
 
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
7695
        __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
 
7696
        __Pyx_GOTREF(__pyx_t_7);
 
7697
        __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
 
7698
        __Pyx_GOTREF(__pyx_t_6);
 
7699
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
7700
        __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L13_except_error;}
 
7701
        __Pyx_GOTREF(__pyx_t_7);
 
7702
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7733
7703
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7734
7704
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7735
 
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
7705
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
7706
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7736
7707
        goto __pyx_L12_exception_handled;
7737
7708
      }
7738
7709
      __pyx_L13_except_error:;
7752
7723
  }
7753
7724
  __pyx_L10:;
7754
7725
 
7755
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":81
 
7726
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":81
7756
7727
 *             except:
7757
7728
 *                 traceback.print_exc()
7758
7729
 *         return result             # <<<<<<<<<<<<<<
7767
7738
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7768
7739
  goto __pyx_L0;
7769
7740
  __pyx_L1_error:;
7770
 
  __Pyx_XDECREF(__pyx_t_2);
7771
 
  __Pyx_XDECREF(__pyx_t_3);
7772
 
  __Pyx_XDECREF(__pyx_t_4);
 
7741
  __Pyx_XDECREF(__pyx_t_5);
 
7742
  __Pyx_XDECREF(__pyx_t_6);
7773
7743
  __Pyx_XDECREF(__pyx_t_7);
7774
7744
  __Pyx_XDECREF(__pyx_t_8);
 
7745
  __Pyx_XDECREF(__pyx_t_9);
7775
7746
  __Pyx_AddTraceback("gevent.core.buffer.read");
7776
7747
  __pyx_r = NULL;
7777
7748
  __pyx_L0:;
7778
7749
  __Pyx_XDECREF(__pyx_v_result);
7779
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
7780
7750
  __Pyx_XGIVEREF(__pyx_r);
7781
7751
  __Pyx_RefNannyFinishContext();
7782
7752
  return __pyx_r;
7783
7753
}
7784
7754
 
7785
 
/* "/home/denis/work/gevent/gevent/evbuffer.pxi":83
 
7755
/* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":83
7786
7756
 *         return result
7787
7757
 * 
7788
7758
 *     def readline(self, size=None):             # <<<<<<<<<<<<<<
7790
7760
 *             return ''
7791
7761
 */
7792
7762
 
7793
 
static PyObject *__pyx_pf_6gevent_4core_6buffer_readline(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7794
 
static PyObject *__pyx_pf_6gevent_4core_6buffer_readline(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
7763
static PyObject *__pyx_pf_6gevent_4core_6buffer_7readline(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
7764
static PyObject *__pyx_pf_6gevent_4core_6buffer_7readline(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7795
7765
  PyObject *__pyx_v_size = 0;
7796
7766
  char *__pyx_v_data;
7797
7767
  long __pyx_v_length;
7801
7771
  PyObject *__pyx_r = NULL;
7802
7772
  int __pyx_t_1;
7803
7773
  PyObject *__pyx_t_2 = NULL;
7804
 
  int __pyx_t_3;
 
7774
  PyObject *__pyx_t_3 = NULL;
7805
7775
  PyObject *__pyx_t_4 = NULL;
7806
7776
  PyObject *__pyx_t_5 = NULL;
7807
7777
  PyObject *__pyx_t_6 = NULL;
7808
 
  PyObject *__pyx_t_7 = NULL;
7809
7778
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0};
7810
7779
  __Pyx_RefNannySetupContext("readline");
7811
7780
  if (unlikely(__pyx_kwds)) {
7819
7788
    }
7820
7789
    switch (PyTuple_GET_SIZE(__pyx_args)) {
7821
7790
      case  0:
7822
 
      if (kw_args > 1) {
 
7791
      if (kw_args > 0) {
7823
7792
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
7824
 
        if (unlikely(value)) { values[0] = value; kw_args--; }
 
7793
        if (value) { values[0] = value; kw_args--; }
7825
7794
      }
7826
7795
    }
7827
7796
    if (unlikely(kw_args > 0)) {
7841
7810
  __Pyx_RaiseArgtupleInvalid("readline", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
7842
7811
  __pyx_L3_error:;
7843
7812
  __Pyx_AddTraceback("gevent.core.buffer.readline");
 
7813
  __Pyx_RefNannyFinishContext();
7844
7814
  return NULL;
7845
7815
  __pyx_L4_argument_unpacking_done:;
7846
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
7847
 
  __Pyx_INCREF(__pyx_v_size);
7848
7816
 
7849
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":84
 
7817
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":84
7850
7818
 * 
7851
7819
 *     def readline(self, size=None):
7852
7820
 *         if not self.__obj:             # <<<<<<<<<<<<<<
7856
7824
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_buffer *)__pyx_v_self)->__pyx___obj != 0));
7857
7825
  if (__pyx_t_1) {
7858
7826
 
7859
 
    /* "/home/denis/work/gevent/gevent/evbuffer.pxi":85
 
7827
    /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":85
7860
7828
 *     def readline(self, size=None):
7861
7829
 *         if not self.__obj:
7862
7830
 *             return ''             # <<<<<<<<<<<<<<
7871
7839
  }
7872
7840
  __pyx_L6:;
7873
7841
 
7874
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":86
 
7842
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":86
7875
7843
 *         if not self.__obj:
7876
7844
 *             return ''
7877
7845
 *         cdef char* data = <char*>EVBUFFER_PULLUP(self.__obj, -1)             # <<<<<<<<<<<<<<
7880
7848
 */
7881
7849
  __pyx_v_data = ((char *)EVBUFFER_PULLUP(((struct __pyx_obj_6gevent_4core_buffer *)__pyx_v_self)->__pyx___obj, -1));
7882
7850
 
7883
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":87
 
7851
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":87
7884
7852
 *             return ''
7885
7853
 *         cdef char* data = <char*>EVBUFFER_PULLUP(self.__obj, -1)
7886
7854
 *         if not data:             # <<<<<<<<<<<<<<
7890
7858
  __pyx_t_1 = (!(__pyx_v_data != 0));
7891
7859
  if (__pyx_t_1) {
7892
7860
 
7893
 
    /* "/home/denis/work/gevent/gevent/evbuffer.pxi":88
 
7861
    /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":88
7894
7862
 *         cdef char* data = <char*>EVBUFFER_PULLUP(self.__obj, -1)
7895
7863
 *         if not data:
7896
7864
 *             return ''             # <<<<<<<<<<<<<<
7905
7873
  }
7906
7874
  __pyx_L7:;
7907
7875
 
7908
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":90
 
7876
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":90
7909
7877
 *             return ''
7910
7878
 * 
7911
7879
 *         cdef long length = evbuffer_get_length(self.__obj)             # <<<<<<<<<<<<<<
7912
 
 *         cdef char *nl = <char*> memchr(<void*>data, 10, length) # search for "\n"
 
7880
 *         cdef char *nl = <char*> memchr(<void*>data, 10, length)  # search for "\n"
7913
7881
 * 
7914
7882
 */
7915
7883
  __pyx_v_length = evbuffer_get_length(((struct __pyx_obj_6gevent_4core_buffer *)__pyx_v_self)->__pyx___obj);
7916
7884
 
7917
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":91
 
7885
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":91
7918
7886
 * 
7919
7887
 *         cdef long length = evbuffer_get_length(self.__obj)
7920
 
 *         cdef char *nl = <char*> memchr(<void*>data, 10, length) # search for "\n"             # <<<<<<<<<<<<<<
 
7888
 *         cdef char *nl = <char*> memchr(<void*>data, 10, length)  # search for "\n"             # <<<<<<<<<<<<<<
7921
7889
 * 
7922
7890
 *         if nl:
7923
7891
 */
7924
7892
  __pyx_v_nl = ((char *)memchr(((void *)__pyx_v_data), 10, __pyx_v_length));
7925
7893
 
7926
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":93
7927
 
 *         cdef char *nl = <char*> memchr(<void*>data, 10, length) # search for "\n"
 
7894
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":93
 
7895
 *         cdef char *nl = <char*> memchr(<void*>data, 10, length)  # search for "\n"
7928
7896
 * 
7929
7897
 *         if nl:             # <<<<<<<<<<<<<<
7930
7898
 *             length = nl - data + 1
7933
7901
  __pyx_t_1 = (__pyx_v_nl != 0);
7934
7902
  if (__pyx_t_1) {
7935
7903
 
7936
 
    /* "/home/denis/work/gevent/gevent/evbuffer.pxi":94
 
7904
    /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":94
7937
7905
 * 
7938
7906
 *         if nl:
7939
7907
 *             length = nl - data + 1             # <<<<<<<<<<<<<<
7945
7913
  }
7946
7914
  __pyx_L8:;
7947
7915
 
7948
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":96
 
7916
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":96
7949
7917
 *             length = nl - data + 1
7950
7918
 * 
7951
7919
 *         cdef object result = PyString_FromStringAndSize(data, length)             # <<<<<<<<<<<<<<
7957
7925
  __pyx_v_result = __pyx_t_2;
7958
7926
  __pyx_t_2 = 0;
7959
7927
 
7960
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":97
 
7928
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":97
7961
7929
 * 
7962
7930
 *         cdef object result = PyString_FromStringAndSize(data, length)
7963
7931
 *         cdef int res = EVBUFFER_DRAIN(self.__obj, length)             # <<<<<<<<<<<<<<
7966
7934
 */
7967
7935
  __pyx_v_res = EVBUFFER_DRAIN(((struct __pyx_obj_6gevent_4core_buffer *)__pyx_v_self)->__pyx___obj, __pyx_v_length);
7968
7936
 
7969
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":98
 
7937
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":98
7970
7938
 *         cdef object result = PyString_FromStringAndSize(data, length)
7971
7939
 *         cdef int res = EVBUFFER_DRAIN(self.__obj, length)
7972
7940
 *         if res:             # <<<<<<<<<<<<<<
7973
7941
 *             try:
7974
7942
 *                 sys.stderr.write('evbuffer_drain(0x%x, %s) returned %s\n' % (self._obj, length, res))
7975
7943
 */
7976
 
  __pyx_t_3 = __pyx_v_res;
7977
 
  if (__pyx_t_3) {
 
7944
  if (__pyx_v_res) {
7978
7945
 
7979
 
    /* "/home/denis/work/gevent/gevent/evbuffer.pxi":99
 
7946
    /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":99
7980
7947
 *         cdef int res = EVBUFFER_DRAIN(self.__obj, length)
7981
7948
 *         if res:
7982
7949
 *             try:             # <<<<<<<<<<<<<<
7991
7958
      __Pyx_XGOTREF(__pyx_save_exc_tb);
7992
7959
      /*try:*/ {
7993
7960
 
7994
 
        /* "/home/denis/work/gevent/gevent/evbuffer.pxi":100
 
7961
        /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":100
7995
7962
 *         if res:
7996
7963
 *             try:
7997
7964
 *                 sys.stderr.write('evbuffer_drain(0x%x, %s) returned %s\n' % (self._obj, length, res))             # <<<<<<<<<<<<<<
8000
7967
 */
8001
7968
        __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
8002
7969
        __Pyx_GOTREF(__pyx_t_2);
8003
 
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__stderr); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
8004
 
        __Pyx_GOTREF(__pyx_t_4);
 
7970
        __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__stderr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
 
7971
        __Pyx_GOTREF(__pyx_t_3);
8005
7972
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8006
 
        __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
 
7973
        __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
8007
7974
        __Pyx_GOTREF(__pyx_t_2);
8008
 
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8009
 
        __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___obj); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
 
7975
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
7976
        __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
 
7977
        __Pyx_GOTREF(__pyx_t_3);
 
7978
        __pyx_t_4 = PyInt_FromLong(__pyx_v_length); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
8010
7979
        __Pyx_GOTREF(__pyx_t_4);
8011
 
        __pyx_t_5 = PyInt_FromLong(__pyx_v_length); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
 
7980
        __pyx_t_5 = PyInt_FromLong(__pyx_v_res); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
8012
7981
        __Pyx_GOTREF(__pyx_t_5);
8013
 
        __pyx_t_6 = PyInt_FromLong(__pyx_v_res); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
8014
 
        __Pyx_GOTREF(__pyx_t_6);
8015
 
        __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
8016
 
        __Pyx_GOTREF(__pyx_t_7);
8017
 
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4);
 
7982
        __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
 
7983
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
 
7984
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
 
7985
        __Pyx_GIVEREF(__pyx_t_3);
 
7986
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
8018
7987
        __Pyx_GIVEREF(__pyx_t_4);
8019
 
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
 
7988
        PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
8020
7989
        __Pyx_GIVEREF(__pyx_t_5);
8021
 
        PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
8022
 
        __Pyx_GIVEREF(__pyx_t_6);
 
7990
        __pyx_t_3 = 0;
8023
7991
        __pyx_t_4 = 0;
8024
7992
        __pyx_t_5 = 0;
8025
 
        __pyx_t_6 = 0;
8026
 
        __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_20), __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
8027
 
        __Pyx_GOTREF(__pyx_t_6);
8028
 
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8029
 
        __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
8030
 
        __Pyx_GOTREF(__pyx_t_7);
8031
 
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
8032
 
        __Pyx_GIVEREF(__pyx_t_6);
8033
 
        __pyx_t_6 = 0;
8034
 
        __pyx_t_6 = PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
8035
 
        __Pyx_GOTREF(__pyx_t_6);
 
7993
        __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_20), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
 
7994
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
 
7995
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
 
7996
        __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
 
7997
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
 
7998
        PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
 
7999
        __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
 
8000
        __pyx_t_5 = 0;
 
8001
        __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L10_error;}
 
8002
        __Pyx_GOTREF(__pyx_t_5);
8036
8003
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8037
 
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8038
 
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
8004
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
 
8005
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8039
8006
      }
8040
8007
      __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
8041
8008
      __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
8042
8009
      __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
8043
8010
      goto __pyx_L17_try_end;
8044
8011
      __pyx_L10_error:;
 
8012
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8045
8013
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8046
 
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8047
8014
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8048
 
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8049
8015
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
 
8016
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8050
8017
 
8051
 
      /* "/home/denis/work/gevent/gevent/evbuffer.pxi":101
 
8018
      /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":101
8052
8019
 *             try:
8053
8020
 *                 sys.stderr.write('evbuffer_drain(0x%x, %s) returned %s\n' % (self._obj, length, res))
8054
8021
 *             except:             # <<<<<<<<<<<<<<
8057
8024
 */
8058
8025
      /*except:*/ {
8059
8026
        __Pyx_AddTraceback("gevent.core.buffer.readline");
8060
 
        if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
 
8027
        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
 
8028
        __Pyx_GOTREF(__pyx_t_5);
8061
8029
        __Pyx_GOTREF(__pyx_t_6);
8062
 
        __Pyx_GOTREF(__pyx_t_7);
8063
8030
        __Pyx_GOTREF(__pyx_t_2);
8064
8031
 
8065
 
        /* "/home/denis/work/gevent/gevent/evbuffer.pxi":102
 
8032
        /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":102
8066
8033
 *                 sys.stderr.write('evbuffer_drain(0x%x, %s) returned %s\n' % (self._obj, length, res))
8067
8034
 *             except:
8068
8035
 *                 traceback.print_exc()             # <<<<<<<<<<<<<<
8069
8036
 *         return result
8070
8037
 * 
8071
8038
 */
8072
 
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
8073
 
        __Pyx_GOTREF(__pyx_t_5);
8074
 
        __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
8075
 
        __Pyx_GOTREF(__pyx_t_4);
8076
 
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8077
 
        __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
8078
 
        __Pyx_GOTREF(__pyx_t_5);
 
8039
        __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
 
8040
        __Pyx_GOTREF(__pyx_t_4);
 
8041
        __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
 
8042
        __Pyx_GOTREF(__pyx_t_3);
 
8043
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
8044
        __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L12_except_error;}
 
8045
        __Pyx_GOTREF(__pyx_t_4);
 
8046
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8079
8047
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8080
8048
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8081
8049
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8082
 
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8083
8050
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8084
8051
        goto __pyx_L11_exception_handled;
8085
8052
      }
8100
8067
  }
8101
8068
  __pyx_L9:;
8102
8069
 
8103
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":103
 
8070
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":103
8104
8071
 *             except:
8105
8072
 *                 traceback.print_exc()
8106
8073
 *         return result             # <<<<<<<<<<<<<<
8116
8083
  goto __pyx_L0;
8117
8084
  __pyx_L1_error:;
8118
8085
  __Pyx_XDECREF(__pyx_t_2);
 
8086
  __Pyx_XDECREF(__pyx_t_3);
8119
8087
  __Pyx_XDECREF(__pyx_t_4);
8120
8088
  __Pyx_XDECREF(__pyx_t_5);
8121
8089
  __Pyx_XDECREF(__pyx_t_6);
8122
 
  __Pyx_XDECREF(__pyx_t_7);
8123
8090
  __Pyx_AddTraceback("gevent.core.buffer.readline");
8124
8091
  __pyx_r = NULL;
8125
8092
  __pyx_L0:;
8126
8093
  __Pyx_XDECREF(__pyx_v_result);
8127
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
8128
 
  __Pyx_DECREF(__pyx_v_size);
8129
8094
  __Pyx_XGIVEREF(__pyx_r);
8130
8095
  __Pyx_RefNannyFinishContext();
8131
8096
  return __pyx_r;
8132
8097
}
8133
8098
 
8134
 
/* "/home/denis/work/gevent/gevent/evbuffer.pxi":105
 
8099
/* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":105
8135
8100
 *         return result
8136
8101
 * 
8137
8102
 *     def readlines(self, hint=-1):             # <<<<<<<<<<<<<<
8139
8104
 * 
8140
8105
 */
8141
8106
 
8142
 
static PyObject *__pyx_pf_6gevent_4core_6buffer_readlines(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8143
 
static PyObject *__pyx_pf_6gevent_4core_6buffer_readlines(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
8107
static PyObject *__pyx_pf_6gevent_4core_6buffer_8readlines(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
8108
static PyObject *__pyx_pf_6gevent_4core_6buffer_8readlines(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8144
8109
  PyObject *__pyx_v_hint = 0;
8145
8110
  PyObject *__pyx_r = NULL;
8146
8111
  PyObject *__pyx_t_1 = NULL;
8158
8123
    }
8159
8124
    switch (PyTuple_GET_SIZE(__pyx_args)) {
8160
8125
      case  0:
8161
 
      if (kw_args > 1) {
 
8126
      if (kw_args > 0) {
8162
8127
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__hint);
8163
 
        if (unlikely(value)) { values[0] = value; kw_args--; }
 
8128
        if (value) { values[0] = value; kw_args--; }
8164
8129
      }
8165
8130
    }
8166
8131
    if (unlikely(kw_args > 0)) {
8180
8145
  __Pyx_RaiseArgtupleInvalid("readlines", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
8181
8146
  __pyx_L3_error:;
8182
8147
  __Pyx_AddTraceback("gevent.core.buffer.readlines");
 
8148
  __Pyx_RefNannyFinishContext();
8183
8149
  return NULL;
8184
8150
  __pyx_L4_argument_unpacking_done:;
8185
8151
 
8186
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":106
 
8152
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":106
8187
8153
 * 
8188
8154
 *     def readlines(self, hint=-1):
8189
8155
 *         return list(self)             # <<<<<<<<<<<<<<
8190
8156
 * 
 
8157
 *     def write(self, bytes data):
8191
8158
 */
8192
8159
  __Pyx_XDECREF(__pyx_r);
8193
8160
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8194
 
  __Pyx_GOTREF(__pyx_t_1);
 
8161
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
8195
8162
  __Pyx_INCREF(__pyx_v_self);
8196
8163
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
8197
8164
  __Pyx_GIVEREF(__pyx_v_self);
8198
 
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyList_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8165
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8199
8166
  __Pyx_GOTREF(__pyx_t_2);
8200
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
8167
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
8201
8168
  __pyx_r = __pyx_t_2;
8202
8169
  __pyx_t_2 = 0;
8203
8170
  goto __pyx_L0;
8215
8182
  return __pyx_r;
8216
8183
}
8217
8184
 
8218
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":118
8219
 
 *     cdef public object default_response_headers
8220
 
 * 
8221
 
 *     def __init__(self, size_t _obj, object default_response_headers):             # <<<<<<<<<<<<<<
8222
 
 *         self.__obj = <evhttp_request*>_obj
8223
 
 *         self.default_response_headers = default_response_headers
8224
 
 */
8225
 
 
8226
 
static int __pyx_pf_6gevent_4core_12http_request___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8227
 
static int __pyx_pf_6gevent_4core_12http_request___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8228
 
  size_t __pyx_v__obj;
8229
 
  PyObject *__pyx_v_default_response_headers = 0;
 
8185
/* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":108
 
8186
 *         return list(self)
 
8187
 * 
 
8188
 *     def write(self, bytes data):             # <<<<<<<<<<<<<<
 
8189
 *         cdef int result = evbuffer_add(self.__obj, data, len(data))
 
8190
 *         if result < 0:
 
8191
 */
 
8192
 
 
8193
static PyObject *__pyx_pf_6gevent_4core_6buffer_9write(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
 
8194
static PyObject *__pyx_pf_6gevent_4core_6buffer_9write(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
 
8195
  int __pyx_v_result;
 
8196
  PyObject *__pyx_r = NULL;
 
8197
  struct evbuffer *__pyx_t_1;
 
8198
  char *__pyx_t_2;
 
8199
  PyObject *__pyx_t_3 = NULL;
 
8200
  Py_ssize_t __pyx_t_4;
 
8201
  int __pyx_t_5;
 
8202
  PyObject *__pyx_t_6 = NULL;
 
8203
  __Pyx_RefNannySetupContext("write");
 
8204
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyBytes_Type), 1, "data", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8205
 
 
8206
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":109
 
8207
 * 
 
8208
 *     def write(self, bytes data):
 
8209
 *         cdef int result = evbuffer_add(self.__obj, data, len(data))             # <<<<<<<<<<<<<<
 
8210
 *         if result < 0:
 
8211
 *             raise IOError("evbuffer_add() returned %s" % result)
 
8212
 */
 
8213
  __pyx_t_1 = ((struct __pyx_obj_6gevent_4core_buffer *)__pyx_v_self)->__pyx___obj;
 
8214
  __pyx_t_2 = PyBytes_AsString(((PyObject *)__pyx_v_data)); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8215
  __pyx_t_3 = ((PyObject *)__pyx_v_data);
 
8216
  __Pyx_INCREF(__pyx_t_3);
 
8217
  if (unlikely(__pyx_t_3 == Py_None)) {
 
8218
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
 
8219
  }
 
8220
  __pyx_t_4 = PyBytes_GET_SIZE(__pyx_t_3); 
 
8221
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
8222
  __pyx_v_result = evbuffer_add(__pyx_t_1, __pyx_t_2, __pyx_t_4);
 
8223
 
 
8224
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":110
 
8225
 *     def write(self, bytes data):
 
8226
 *         cdef int result = evbuffer_add(self.__obj, data, len(data))
 
8227
 *         if result < 0:             # <<<<<<<<<<<<<<
 
8228
 *             raise IOError("evbuffer_add() returned %s" % result)
 
8229
 *         return result
 
8230
 */
 
8231
  __pyx_t_5 = (__pyx_v_result < 0);
 
8232
  if (__pyx_t_5) {
 
8233
 
 
8234
    /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":111
 
8235
 *         cdef int result = evbuffer_add(self.__obj, data, len(data))
 
8236
 *         if result < 0:
 
8237
 *             raise IOError("evbuffer_add() returned %s" % result)             # <<<<<<<<<<<<<<
 
8238
 *         return result
 
8239
 */
 
8240
    __pyx_t_3 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8241
    __Pyx_GOTREF(__pyx_t_3);
 
8242
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_21), __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8243
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
 
8244
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
8245
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8246
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
8247
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_6));
 
8248
    __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
 
8249
    __pyx_t_6 = 0;
 
8250
    __pyx_t_6 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8251
    __Pyx_GOTREF(__pyx_t_6);
 
8252
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
 
8253
    __Pyx_Raise(__pyx_t_6, 0, 0);
 
8254
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
8255
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8256
    goto __pyx_L5;
 
8257
  }
 
8258
  __pyx_L5:;
 
8259
 
 
8260
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":112
 
8261
 *         if result < 0:
 
8262
 *             raise IOError("evbuffer_add() returned %s" % result)
 
8263
 *         return result             # <<<<<<<<<<<<<<
 
8264
 */
 
8265
  __Pyx_XDECREF(__pyx_r);
 
8266
  __pyx_t_6 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8267
  __Pyx_GOTREF(__pyx_t_6);
 
8268
  __pyx_r = __pyx_t_6;
 
8269
  __pyx_t_6 = 0;
 
8270
  goto __pyx_L0;
 
8271
 
 
8272
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
8273
  goto __pyx_L0;
 
8274
  __pyx_L1_error:;
 
8275
  __Pyx_XDECREF(__pyx_t_3);
 
8276
  __Pyx_XDECREF(__pyx_t_6);
 
8277
  __Pyx_AddTraceback("gevent.core.buffer.write");
 
8278
  __pyx_r = NULL;
 
8279
  __pyx_L0:;
 
8280
  __Pyx_XGIVEREF(__pyx_r);
 
8281
  __Pyx_RefNannyFinishContext();
 
8282
  return __pyx_r;
 
8283
}
 
8284
 
 
8285
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":155
 
8286
 *     cdef public object _output_buffer
 
8287
 * 
 
8288
 *     def __init__(self, size_t obj):             # <<<<<<<<<<<<<<
 
8289
 *         self.__obj = <evhttp_request *>obj
 
8290
 * 
 
8291
 */
 
8292
 
 
8293
static int __pyx_pf_6gevent_4core_17http_request_base___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
8294
static int __pyx_pf_6gevent_4core_17http_request_base___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
8295
  size_t __pyx_v_obj;
8230
8296
  int __pyx_r;
8231
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s___obj,&__pyx_n_s_21,0};
 
8297
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__obj,0};
8232
8298
  __Pyx_RefNannySetupContext("__init__");
8233
8299
  if (unlikely(__pyx_kwds)) {
8234
8300
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
8235
 
    PyObject* values[2] = {0,0};
 
8301
    PyObject* values[1] = {0};
8236
8302
    switch (PyTuple_GET_SIZE(__pyx_args)) {
8237
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8238
8303
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8239
8304
      case  0: break;
8240
8305
      default: goto __pyx_L5_argtuple_error;
8241
8306
    }
8242
8307
    switch (PyTuple_GET_SIZE(__pyx_args)) {
8243
8308
      case  0:
8244
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s___obj);
 
8309
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__obj);
8245
8310
      if (likely(values[0])) kw_args--;
8246
8311
      else goto __pyx_L5_argtuple_error;
8247
 
      case  1:
8248
 
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_21);
8249
 
      if (likely(values[1])) kw_args--;
8250
 
      else {
8251
 
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
8252
 
      }
8253
8312
    }
8254
8313
    if (unlikely(kw_args > 0)) {
8255
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
8314
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
8256
8315
    }
8257
 
    __pyx_v__obj = __Pyx_PyInt_AsSize_t(values[0]); if (unlikely((__pyx_v__obj == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
8258
 
    __pyx_v_default_response_headers = values[1];
8259
 
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
 
8316
    __pyx_v_obj = __Pyx_PyInt_AsSize_t(values[0]); if (unlikely((__pyx_v_obj == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
8317
  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
8260
8318
    goto __pyx_L5_argtuple_error;
8261
8319
  } else {
8262
 
    __pyx_v__obj = __Pyx_PyInt_AsSize_t(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v__obj == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
8263
 
    __pyx_v_default_response_headers = PyTuple_GET_ITEM(__pyx_args, 1);
 
8320
    __pyx_v_obj = __Pyx_PyInt_AsSize_t(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_obj == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
8264
8321
  }
8265
8322
  goto __pyx_L4_argument_unpacking_done;
8266
8323
  __pyx_L5_argtuple_error:;
8267
 
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
8324
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
8268
8325
  __pyx_L3_error:;
8269
 
  __Pyx_AddTraceback("gevent.core.http_request.__init__");
 
8326
  __Pyx_AddTraceback("gevent.core.http_request_base.__init__");
 
8327
  __Pyx_RefNannyFinishContext();
8270
8328
  return -1;
8271
8329
  __pyx_L4_argument_unpacking_done:;
8272
8330
 
8273
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":119
8274
 
 * 
8275
 
 *     def __init__(self, size_t _obj, object default_response_headers):
8276
 
 *         self.__obj = <evhttp_request*>_obj             # <<<<<<<<<<<<<<
8277
 
 *         self.default_response_headers = default_response_headers
8278
 
 * 
8279
 
 */
8280
 
  ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj = ((struct evhttp_request *)__pyx_v__obj);
8281
 
 
8282
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":120
8283
 
 *     def __init__(self, size_t _obj, object default_response_headers):
8284
 
 *         self.__obj = <evhttp_request*>_obj
8285
 
 *         self.default_response_headers = default_response_headers             # <<<<<<<<<<<<<<
8286
 
 * 
8287
 
 *     def __dealloc__(self):
8288
 
 */
8289
 
  __Pyx_INCREF(__pyx_v_default_response_headers);
8290
 
  __Pyx_GIVEREF(__pyx_v_default_response_headers);
8291
 
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers);
8292
 
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers);
8293
 
  ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers = __pyx_v_default_response_headers;
 
8331
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":156
 
8332
 * 
 
8333
 *     def __init__(self, size_t obj):
 
8334
 *         self.__obj = <evhttp_request *>obj             # <<<<<<<<<<<<<<
 
8335
 * 
 
8336
 *     property _obj:
 
8337
 */
 
8338
  ((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj = ((struct evhttp_request *)__pyx_v_obj);
8294
8339
 
8295
8340
  __pyx_r = 0;
8296
8341
  __Pyx_RefNannyFinishContext();
8297
8342
  return __pyx_r;
8298
8343
}
8299
8344
 
8300
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":122
8301
 
 *         self.default_response_headers = default_response_headers
8302
 
 * 
8303
 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
8304
 
 *         cdef evhttp_request* obj = self.__obj
8305
 
 *         if obj != NULL:
8306
 
 */
8307
 
 
8308
 
static void __pyx_pf_6gevent_4core_12http_request___dealloc__(PyObject *__pyx_v_self); /*proto*/
8309
 
static void __pyx_pf_6gevent_4core_12http_request___dealloc__(PyObject *__pyx_v_self) {
8310
 
  struct evhttp_request *__pyx_v_obj;
8311
 
  int __pyx_t_1;
8312
 
  __Pyx_RefNannySetupContext("__dealloc__");
8313
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
8314
 
 
8315
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":123
8316
 
 * 
8317
 
 *     def __dealloc__(self):
8318
 
 *         cdef evhttp_request* obj = self.__obj             # <<<<<<<<<<<<<<
8319
 
 *         if obj != NULL:
8320
 
 *             self.__obj = NULL
8321
 
 */
8322
 
  __pyx_v_obj = ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj;
8323
 
 
8324
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":124
8325
 
 *     def __dealloc__(self):
8326
 
 *         cdef evhttp_request* obj = self.__obj
8327
 
 *         if obj != NULL:             # <<<<<<<<<<<<<<
8328
 
 *             self.__obj = NULL
8329
 
 *             report_internal_error(obj)
8330
 
 */
8331
 
  __pyx_t_1 = (__pyx_v_obj != NULL);
8332
 
  if (__pyx_t_1) {
8333
 
 
8334
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":125
8335
 
 *         cdef evhttp_request* obj = self.__obj
8336
 
 *         if obj != NULL:
8337
 
 *             self.__obj = NULL             # <<<<<<<<<<<<<<
8338
 
 *             report_internal_error(obj)
8339
 
 * 
8340
 
 */
8341
 
    ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj = NULL;
8342
 
 
8343
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":126
8344
 
 *         if obj != NULL:
8345
 
 *             self.__obj = NULL
8346
 
 *             report_internal_error(obj)             # <<<<<<<<<<<<<<
8347
 
 * 
8348
 
 *     property _obj:
8349
 
 */
8350
 
    __pyx_f_6gevent_4core_report_internal_error(__pyx_v_obj);
8351
 
    goto __pyx_L5;
8352
 
  }
8353
 
  __pyx_L5:;
8354
 
 
8355
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
8356
 
  __Pyx_RefNannyFinishContext();
8357
 
}
8358
 
 
8359
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":130
 
8345
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":160
8360
8346
 *     property _obj:
8361
8347
 * 
8362
8348
 *         def __get__(self):             # <<<<<<<<<<<<<<
8364
8350
 * 
8365
8351
 */
8366
8352
 
8367
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_4_obj___get__(PyObject *__pyx_v_self); /*proto*/
8368
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_4_obj___get__(PyObject *__pyx_v_self) {
 
8353
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_4_obj___get__(PyObject *__pyx_v_self); /*proto*/
 
8354
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_4_obj___get__(PyObject *__pyx_v_self) {
8369
8355
  PyObject *__pyx_r = NULL;
8370
8356
  PyObject *__pyx_t_1 = NULL;
8371
8357
  __Pyx_RefNannySetupContext("__get__");
8372
8358
 
8373
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":131
 
8359
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":161
8374
8360
 * 
8375
8361
 *         def __get__(self):
8376
8362
 *             return <size_t>(self.__obj)             # <<<<<<<<<<<<<<
8378
8364
 *     def __nonzero__(self):
8379
8365
 */
8380
8366
  __Pyx_XDECREF(__pyx_r);
8381
 
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8367
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8382
8368
  __Pyx_GOTREF(__pyx_t_1);
8383
8369
  __pyx_r = __pyx_t_1;
8384
8370
  __pyx_t_1 = 0;
8388
8374
  goto __pyx_L0;
8389
8375
  __pyx_L1_error:;
8390
8376
  __Pyx_XDECREF(__pyx_t_1);
8391
 
  __Pyx_AddTraceback("gevent.core.http_request._obj.__get__");
 
8377
  __Pyx_AddTraceback("gevent.core.http_request_base._obj.__get__");
8392
8378
  __pyx_r = NULL;
8393
8379
  __pyx_L0:;
8394
8380
  __Pyx_XGIVEREF(__pyx_r);
8396
8382
  return __pyx_r;
8397
8383
}
8398
8384
 
8399
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":133
 
8385
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":163
8400
8386
 *             return <size_t>(self.__obj)
8401
8387
 * 
8402
8388
 *     def __nonzero__(self):             # <<<<<<<<<<<<<<
8404
8390
 *             return True
8405
8391
 */
8406
8392
 
8407
 
static int __pyx_pf_6gevent_4core_12http_request___nonzero__(PyObject *__pyx_v_self); /*proto*/
8408
 
static int __pyx_pf_6gevent_4core_12http_request___nonzero__(PyObject *__pyx_v_self) {
 
8393
static int __pyx_pf_6gevent_4core_17http_request_base_1__nonzero__(PyObject *__pyx_v_self); /*proto*/
 
8394
static int __pyx_pf_6gevent_4core_17http_request_base_1__nonzero__(PyObject *__pyx_v_self) {
8409
8395
  int __pyx_r;
8410
8396
  int __pyx_t_1;
8411
8397
  __Pyx_RefNannySetupContext("__nonzero__");
8412
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
8413
8398
 
8414
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":134
 
8399
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":164
8415
8400
 * 
8416
8401
 *     def __nonzero__(self):
8417
8402
 *         if self.__obj:             # <<<<<<<<<<<<<<
8418
8403
 *             return True
8419
8404
 *         else:
8420
8405
 */
8421
 
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0);
 
8406
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0);
8422
8407
  if (__pyx_t_1) {
8423
8408
 
8424
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":135
 
8409
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":165
8425
8410
 *     def __nonzero__(self):
8426
8411
 *         if self.__obj:
8427
8412
 *             return True             # <<<<<<<<<<<<<<
8434
8419
  }
8435
8420
  /*else*/ {
8436
8421
 
8437
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":137
 
8422
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":167
8438
8423
 *             return True
8439
8424
 *         else:
8440
8425
 *             return False             # <<<<<<<<<<<<<<
8448
8433
 
8449
8434
  __pyx_r = 0;
8450
8435
  __pyx_L0:;
8451
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
8452
8436
  __Pyx_RefNannyFinishContext();
8453
8437
  return __pyx_r;
8454
8438
}
8455
8439
 
8456
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":139
 
8440
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":169
8457
8441
 *             return False
8458
8442
 * 
8459
8443
 *     def detach(self):             # <<<<<<<<<<<<<<
8461
8445
 *         if self._input_buffer is not None:
8462
8446
 */
8463
8447
 
8464
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_detach(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
8465
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_detach(PyObject *__pyx_v_self, PyObject *unused) {
 
8448
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_2detach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
8449
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_2detach(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8466
8450
  PyObject *__pyx_r = NULL;
8467
8451
  int __pyx_t_1;
8468
8452
  PyObject *__pyx_t_2 = NULL;
8469
8453
  PyObject *__pyx_t_3 = NULL;
8470
8454
  __Pyx_RefNannySetupContext("detach");
8471
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
8472
8455
 
8473
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":140
 
8456
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":170
8474
8457
 * 
8475
8458
 *     def detach(self):
8476
8459
 *         self.__obj = NULL             # <<<<<<<<<<<<<<
8477
8460
 *         if self._input_buffer is not None:
8478
8461
 *             self._input_buffer.detach()
8479
8462
 */
8480
 
  ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj = NULL;
 
8463
  ((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj = NULL;
8481
8464
 
8482
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":141
 
8465
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":171
8483
8466
 *     def detach(self):
8484
8467
 *         self.__obj = NULL
8485
8468
 *         if self._input_buffer is not None:             # <<<<<<<<<<<<<<
8486
8469
 *             self._input_buffer.detach()
8487
8470
 *         if self._output_buffer is not None:
8488
8471
 */
8489
 
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_input_buffer != Py_None);
 
8472
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer != Py_None);
8490
8473
  if (__pyx_t_1) {
8491
8474
 
8492
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":142
 
8475
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":172
8493
8476
 *         self.__obj = NULL
8494
8477
 *         if self._input_buffer is not None:
8495
8478
 *             self._input_buffer.detach()             # <<<<<<<<<<<<<<
8496
8479
 *         if self._output_buffer is not None:
8497
8480
 *             self._output_buffer.detach()
8498
8481
 */
8499
 
    __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_input_buffer, __pyx_n_s__detach); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8482
    __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer, __pyx_n_s__detach); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8500
8483
    __Pyx_GOTREF(__pyx_t_2);
8501
 
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8484
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8502
8485
    __Pyx_GOTREF(__pyx_t_3);
8503
8486
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8504
8487
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8506
8489
  }
8507
8490
  __pyx_L5:;
8508
8491
 
8509
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":143
 
8492
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":173
8510
8493
 *         if self._input_buffer is not None:
8511
8494
 *             self._input_buffer.detach()
8512
8495
 *         if self._output_buffer is not None:             # <<<<<<<<<<<<<<
8513
8496
 *             self._output_buffer.detach()
8514
8497
 * 
8515
8498
 */
8516
 
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_output_buffer != Py_None);
 
8499
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer != Py_None);
8517
8500
  if (__pyx_t_1) {
8518
8501
 
8519
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":144
 
8502
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":174
8520
8503
 *             self._input_buffer.detach()
8521
8504
 *         if self._output_buffer is not None:
8522
8505
 *             self._output_buffer.detach()             # <<<<<<<<<<<<<<
8523
8506
 * 
8524
8507
 *     def _format(self):
8525
8508
 */
8526
 
    __pyx_t_3 = PyObject_GetAttr(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_output_buffer, __pyx_n_s__detach); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8509
    __pyx_t_3 = PyObject_GetAttr(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer, __pyx_n_s__detach); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8527
8510
    __Pyx_GOTREF(__pyx_t_3);
8528
 
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8511
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8529
8512
    __Pyx_GOTREF(__pyx_t_2);
8530
8513
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8531
8514
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8538
8521
  __pyx_L1_error:;
8539
8522
  __Pyx_XDECREF(__pyx_t_2);
8540
8523
  __Pyx_XDECREF(__pyx_t_3);
8541
 
  __Pyx_AddTraceback("gevent.core.http_request.detach");
 
8524
  __Pyx_AddTraceback("gevent.core.http_request_base.detach");
8542
8525
  __pyx_r = NULL;
8543
8526
  __pyx_L0:;
8544
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
8545
8527
  __Pyx_XGIVEREF(__pyx_r);
8546
8528
  __Pyx_RefNannyFinishContext();
8547
8529
  return __pyx_r;
8548
8530
}
8549
8531
 
8550
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":146
 
8532
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":176
8551
8533
 *             self._output_buffer.detach()
8552
8534
 * 
8553
8535
 *     def _format(self):             # <<<<<<<<<<<<<<
8555
8537
 *                 self.remote_host, self.remote_port)
8556
8538
 */
8557
8539
 
8558
 
static PyObject *__pyx_pf_6gevent_4core_12http_request__format(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
8559
 
static PyObject *__pyx_pf_6gevent_4core_12http_request__format(PyObject *__pyx_v_self, PyObject *unused) {
 
8540
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_3_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
8541
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_3_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8560
8542
  PyObject *__pyx_v_args;
8561
8543
  PyObject *__pyx_v_res;
8562
8544
  PyObject *__pyx_r = NULL;
8570
8552
  int __pyx_t_8;
8571
8553
  Py_ssize_t __pyx_t_9;
8572
8554
  __Pyx_RefNannySetupContext("_format");
8573
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
8574
 
  __pyx_v_args = Py_None; __Pyx_INCREF(Py_None);
 
8555
  __pyx_v_args = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
8575
8556
  __pyx_v_res = Py_None; __Pyx_INCREF(Py_None);
8576
8557
 
8577
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":147
 
8558
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":177
8578
8559
 * 
8579
8560
 *     def _format(self):
8580
8561
 *         args = (self.typestr, self.uri, self.major, self.minor,             # <<<<<<<<<<<<<<
8581
8562
 *                 self.remote_host, self.remote_port)
8582
8563
 *         res = '"%s %s HTTP/%s.%s" %s:%s' % args
8583
8564
 */
8584
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__typestr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8565
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__typestr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8585
8566
  __Pyx_GOTREF(__pyx_t_1);
8586
 
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__uri); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8567
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__uri); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8587
8568
  __Pyx_GOTREF(__pyx_t_2);
8588
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__major); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8569
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__major); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8589
8570
  __Pyx_GOTREF(__pyx_t_3);
8590
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__minor); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8571
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__minor); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8591
8572
  __Pyx_GOTREF(__pyx_t_4);
8592
8573
 
8593
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":148
 
8574
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":178
8594
8575
 *     def _format(self):
8595
8576
 *         args = (self.typestr, self.uri, self.major, self.minor,
8596
8577
 *                 self.remote_host, self.remote_port)             # <<<<<<<<<<<<<<
8597
8578
 *         res = '"%s %s HTTP/%s.%s" %s:%s' % args
8598
8579
 *         if self.response_code:
8599
8580
 */
8600
 
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__remote_host); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8581
  __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__remote_host); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8601
8582
  __Pyx_GOTREF(__pyx_t_5);
8602
 
  __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__remote_port); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8583
  __pyx_t_6 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__remote_port); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8603
8584
  __Pyx_GOTREF(__pyx_t_6);
8604
 
  __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8605
 
  __Pyx_GOTREF(__pyx_t_7);
 
8585
  __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8586
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
8606
8587
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
8607
8588
  __Pyx_GIVEREF(__pyx_t_1);
8608
8589
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
8621
8602
  __pyx_t_4 = 0;
8622
8603
  __pyx_t_5 = 0;
8623
8604
  __pyx_t_6 = 0;
8624
 
  __Pyx_DECREF(__pyx_v_args);
 
8605
  __Pyx_DECREF(((PyObject *)__pyx_v_args));
8625
8606
  __pyx_v_args = __pyx_t_7;
8626
8607
  __pyx_t_7 = 0;
8627
8608
 
8628
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":149
 
8609
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":179
8629
8610
 *         args = (self.typestr, self.uri, self.major, self.minor,
8630
8611
 *                 self.remote_host, self.remote_port)
8631
8612
 *         res = '"%s %s HTTP/%s.%s" %s:%s' % args             # <<<<<<<<<<<<<<
8632
8613
 *         if self.response_code:
8633
8614
 *             res += ' response=%s' % self.response_code
8634
8615
 */
8635
 
  __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_22), __pyx_v_args); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8636
 
  __Pyx_GOTREF(__pyx_t_7);
 
8616
  __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_22), ((PyObject *)__pyx_v_args)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8617
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
8637
8618
  __Pyx_DECREF(__pyx_v_res);
8638
 
  __pyx_v_res = __pyx_t_7;
 
8619
  __pyx_v_res = ((PyObject *)__pyx_t_7);
8639
8620
  __pyx_t_7 = 0;
8640
8621
 
8641
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":150
 
8622
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":180
8642
8623
 *                 self.remote_host, self.remote_port)
8643
8624
 *         res = '"%s %s HTTP/%s.%s" %s:%s' % args
8644
8625
 *         if self.response_code:             # <<<<<<<<<<<<<<
8645
8626
 *             res += ' response=%s' % self.response_code
8646
8627
 *         if self.input_buffer:
8647
8628
 */
8648
 
  __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__response_code); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8629
  __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__response_code); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8649
8630
  __Pyx_GOTREF(__pyx_t_7);
8650
 
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8631
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8651
8632
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8652
8633
  if (__pyx_t_8) {
8653
8634
 
8654
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":151
 
8635
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":181
8655
8636
 *         res = '"%s %s HTTP/%s.%s" %s:%s' % args
8656
8637
 *         if self.response_code:
8657
8638
 *             res += ' response=%s' % self.response_code             # <<<<<<<<<<<<<<
8658
8639
 *         if self.input_buffer:
8659
8640
 *             res += ' input=%s' % len(self.input_buffer)
8660
8641
 */
8661
 
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__response_code); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8642
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__response_code); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8662
8643
    __Pyx_GOTREF(__pyx_t_7);
8663
 
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8664
 
    __Pyx_GOTREF(__pyx_t_6);
 
8644
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_23), __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8645
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
8665
8646
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8666
 
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8647
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_res, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8667
8648
    __Pyx_GOTREF(__pyx_t_7);
8668
 
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
8649
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
8669
8650
    __Pyx_DECREF(__pyx_v_res);
8670
8651
    __pyx_v_res = __pyx_t_7;
8671
8652
    __pyx_t_7 = 0;
8673
8654
  }
8674
8655
  __pyx_L5:;
8675
8656
 
8676
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":152
 
8657
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":182
8677
8658
 *         if self.response_code:
8678
8659
 *             res += ' response=%s' % self.response_code
8679
8660
 *         if self.input_buffer:             # <<<<<<<<<<<<<<
8680
8661
 *             res += ' input=%s' % len(self.input_buffer)
8681
8662
 *         if self.output_buffer:
8682
8663
 */
8683
 
  __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__input_buffer); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8664
  __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__input_buffer); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8684
8665
  __Pyx_GOTREF(__pyx_t_7);
8685
 
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8666
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8686
8667
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8687
8668
  if (__pyx_t_8) {
8688
8669
 
8689
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":153
 
8670
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":183
8690
8671
 *             res += ' response=%s' % self.response_code
8691
8672
 *         if self.input_buffer:
8692
8673
 *             res += ' input=%s' % len(self.input_buffer)             # <<<<<<<<<<<<<<
8693
8674
 *         if self.output_buffer:
8694
8675
 *             res += ' output=%s' % len(self.output_buffer)
8695
8676
 */
8696
 
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__input_buffer); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8697
 
    __Pyx_GOTREF(__pyx_t_7);
8698
 
    __pyx_t_9 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8699
 
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8700
 
    __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8701
 
    __Pyx_GOTREF(__pyx_t_7);
8702
 
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_24), __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8703
 
    __Pyx_GOTREF(__pyx_t_6);
8704
 
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8705
 
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8706
 
    __Pyx_GOTREF(__pyx_t_7);
8707
 
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
8677
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__input_buffer); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8678
    __Pyx_GOTREF(__pyx_t_7);
 
8679
    __pyx_t_9 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8680
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
8681
    __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8682
    __Pyx_GOTREF(__pyx_t_7);
 
8683
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_24), __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8684
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
 
8685
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
8686
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_res, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8687
    __Pyx_GOTREF(__pyx_t_7);
 
8688
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
8708
8689
    __Pyx_DECREF(__pyx_v_res);
8709
8690
    __pyx_v_res = __pyx_t_7;
8710
8691
    __pyx_t_7 = 0;
8712
8693
  }
8713
8694
  __pyx_L6:;
8714
8695
 
8715
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":154
 
8696
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":184
8716
8697
 *         if self.input_buffer:
8717
8698
 *             res += ' input=%s' % len(self.input_buffer)
8718
8699
 *         if self.output_buffer:             # <<<<<<<<<<<<<<
8719
8700
 *             res += ' output=%s' % len(self.output_buffer)
8720
8701
 *         return res
8721
8702
 */
8722
 
  __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__output_buffer); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8703
  __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__output_buffer); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8723
8704
  __Pyx_GOTREF(__pyx_t_7);
8724
 
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8705
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8725
8706
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8726
8707
  if (__pyx_t_8) {
8727
8708
 
8728
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":155
 
8709
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":185
8729
8710
 *             res += ' input=%s' % len(self.input_buffer)
8730
8711
 *         if self.output_buffer:
8731
8712
 *             res += ' output=%s' % len(self.output_buffer)             # <<<<<<<<<<<<<<
8732
8713
 *         return res
8733
8714
 * 
8734
8715
 */
8735
 
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__output_buffer); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8736
 
    __Pyx_GOTREF(__pyx_t_7);
8737
 
    __pyx_t_9 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8738
 
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8739
 
    __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8740
 
    __Pyx_GOTREF(__pyx_t_7);
8741
 
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_25), __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8742
 
    __Pyx_GOTREF(__pyx_t_6);
8743
 
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8744
 
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8745
 
    __Pyx_GOTREF(__pyx_t_7);
8746
 
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
8716
    __pyx_t_7 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__output_buffer); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8717
    __Pyx_GOTREF(__pyx_t_7);
 
8718
    __pyx_t_9 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8719
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
8720
    __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8721
    __Pyx_GOTREF(__pyx_t_7);
 
8722
    __pyx_t_6 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_25), __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8723
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
 
8724
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
8725
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_res, ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8726
    __Pyx_GOTREF(__pyx_t_7);
 
8727
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
8747
8728
    __Pyx_DECREF(__pyx_v_res);
8748
8729
    __pyx_v_res = __pyx_t_7;
8749
8730
    __pyx_t_7 = 0;
8751
8732
  }
8752
8733
  __pyx_L7:;
8753
8734
 
8754
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":156
 
8735
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":186
8755
8736
 *         if self.output_buffer:
8756
8737
 *             res += ' output=%s' % len(self.output_buffer)
8757
8738
 *         return res             # <<<<<<<<<<<<<<
8773
8754
  __Pyx_XDECREF(__pyx_t_5);
8774
8755
  __Pyx_XDECREF(__pyx_t_6);
8775
8756
  __Pyx_XDECREF(__pyx_t_7);
8776
 
  __Pyx_AddTraceback("gevent.core.http_request._format");
 
8757
  __Pyx_AddTraceback("gevent.core.http_request_base._format");
8777
8758
  __pyx_r = NULL;
8778
8759
  __pyx_L0:;
8779
8760
  __Pyx_DECREF(__pyx_v_args);
8780
8761
  __Pyx_DECREF(__pyx_v_res);
8781
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
8782
8762
  __Pyx_XGIVEREF(__pyx_r);
8783
8763
  __Pyx_RefNannyFinishContext();
8784
8764
  return __pyx_r;
8785
8765
}
8786
8766
 
8787
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":158
 
8767
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":188
8788
8768
 *         return res
8789
8769
 * 
8790
8770
 *     def __str__(self):             # <<<<<<<<<<<<<<
8792
8772
 *             info = self._format()
8793
8773
 */
8794
8774
 
8795
 
static PyObject *__pyx_pf_6gevent_4core_12http_request___str__(PyObject *__pyx_v_self); /*proto*/
8796
 
static PyObject *__pyx_pf_6gevent_4core_12http_request___str__(PyObject *__pyx_v_self) {
 
8775
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_4__str__(PyObject *__pyx_v_self); /*proto*/
 
8776
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_4__str__(PyObject *__pyx_v_self) {
8797
8777
  PyObject *__pyx_v_info;
8798
8778
  PyObject *__pyx_v_ex;
8799
8779
  PyObject *__pyx_r = NULL;
8806
8786
  int __pyx_t_7;
8807
8787
  PyObject *__pyx_t_8 = NULL;
8808
8788
  __Pyx_RefNannySetupContext("__str__");
8809
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
8810
8789
  __pyx_v_info = Py_None; __Pyx_INCREF(Py_None);
8811
8790
  __pyx_v_ex = Py_None; __Pyx_INCREF(Py_None);
8812
8791
 
8813
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":159
 
8792
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":189
8814
8793
 * 
8815
8794
 *     def __str__(self):
8816
8795
 *         try:             # <<<<<<<<<<<<<<
8825
8804
    __Pyx_XGOTREF(__pyx_save_exc_tb);
8826
8805
    /*try:*/ {
8827
8806
 
8828
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":160
 
8807
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":190
8829
8808
 *     def __str__(self):
8830
8809
 *         try:
8831
8810
 *             info = self._format()             # <<<<<<<<<<<<<<
8832
8811
 *         except HttpRequestDeleted:
8833
8812
 *             info = 'deleted'
8834
8813
 */
8835
 
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
 
8814
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
8836
8815
      __Pyx_GOTREF(__pyx_t_1);
8837
 
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
 
8816
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
8838
8817
      __Pyx_GOTREF(__pyx_t_2);
8839
8818
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8840
8819
      __Pyx_DECREF(__pyx_v_info);
8849
8828
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8850
8829
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8851
8830
 
8852
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":161
 
8831
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":191
8853
8832
 *         try:
8854
8833
 *             info = self._format()
8855
8834
 *         except HttpRequestDeleted:             # <<<<<<<<<<<<<<
8856
8835
 *             info = 'deleted'
8857
8836
 *         except Exception, ex:
8858
8837
 */
8859
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
8838
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
8860
8839
    __Pyx_GOTREF(__pyx_t_2);
8861
8840
    __pyx_t_3 = PyErr_ExceptionMatches(__pyx_t_2);
8862
8841
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8863
8842
    if (__pyx_t_3) {
8864
 
      __Pyx_AddTraceback("gevent.core.http_request.__str__");
8865
 
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
8843
      __Pyx_AddTraceback("gevent.core.http_request_base.__str__");
 
8844
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
8866
8845
      __Pyx_GOTREF(__pyx_t_2);
8867
8846
      __Pyx_GOTREF(__pyx_t_1);
8868
8847
      __Pyx_GOTREF(__pyx_t_4);
8869
8848
 
8870
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":162
 
8849
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":192
8871
8850
 *             info = self._format()
8872
8851
 *         except HttpRequestDeleted:
8873
8852
 *             info = 'deleted'             # <<<<<<<<<<<<<<
8883
8862
      goto __pyx_L6_exception_handled;
8884
8863
    }
8885
8864
 
8886
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":163
 
8865
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":193
8887
8866
 *         except HttpRequestDeleted:
8888
8867
 *             info = 'deleted'
8889
8868
 *         except Exception, ex:             # <<<<<<<<<<<<<<
8892
8871
 */
8893
8872
    __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
8894
8873
    if (__pyx_t_3) {
8895
 
      __Pyx_AddTraceback("gevent.core.http_request.__str__");
8896
 
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
8874
      __Pyx_AddTraceback("gevent.core.http_request_base.__str__");
 
8875
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
8897
8876
      __Pyx_GOTREF(__pyx_t_4);
8898
8877
      __Pyx_GOTREF(__pyx_t_1);
8899
8878
      __Pyx_GOTREF(__pyx_t_2);
8901
8880
      __Pyx_DECREF(__pyx_v_ex);
8902
8881
      __pyx_v_ex = __pyx_t_1;
8903
8882
 
8904
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":164
 
8883
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":194
8905
8884
 *             info = 'deleted'
8906
8885
 *         except Exception, ex:
8907
8886
 *             info = str(ex) or repr(ex) or '<Error>'             # <<<<<<<<<<<<<<
8908
8887
 *         return '<%s %s>' % (self.__class__.__name__, info)
8909
8888
 * 
8910
8889
 */
8911
 
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
8912
 
      __Pyx_GOTREF(__pyx_t_5);
 
8890
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
8891
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
8913
8892
      __Pyx_INCREF(__pyx_v_ex);
8914
8893
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ex);
8915
8894
      __Pyx_GIVEREF(__pyx_v_ex);
8916
 
      __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
8895
      __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
8917
8896
      __Pyx_GOTREF(__pyx_t_6);
8918
 
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8919
 
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
8897
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
 
8898
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
8920
8899
      if (!__pyx_t_7) {
8921
8900
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8922
 
        __pyx_t_5 = PyObject_Repr(__pyx_v_ex); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
8901
        __pyx_t_5 = PyObject_Repr(__pyx_v_ex); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
8923
8902
        __Pyx_GOTREF(__pyx_t_5);
8924
 
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
8903
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
8925
8904
        if (!__pyx_t_7) {
8926
8905
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8927
8906
          __Pyx_INCREF(((PyObject *)__pyx_kp_s_26));
8958
8937
    __pyx_L12_try_end:;
8959
8938
  }
8960
8939
 
8961
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":165
 
8940
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":195
8962
8941
 *         except Exception, ex:
8963
8942
 *             info = str(ex) or repr(ex) or '<Error>'
8964
8943
 *         return '<%s %s>' % (self.__class__.__name__, info)             # <<<<<<<<<<<<<<
8966
8945
 *     def __repr__(self):
8967
8946
 */
8968
8947
  __Pyx_XDECREF(__pyx_r);
8969
 
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____class__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8948
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____class__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8970
8949
  __Pyx_GOTREF(__pyx_t_2);
8971
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____name__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8950
  __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s____name__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8972
8951
  __Pyx_GOTREF(__pyx_t_1);
8973
8952
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8974
 
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8975
 
  __Pyx_GOTREF(__pyx_t_2);
 
8953
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8954
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
8976
8955
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
8977
8956
  __Pyx_GIVEREF(__pyx_t_1);
8978
8957
  __Pyx_INCREF(__pyx_v_info);
8979
8958
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_info);
8980
8959
  __Pyx_GIVEREF(__pyx_v_info);
8981
8960
  __pyx_t_1 = 0;
8982
 
  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_27), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8983
 
  __Pyx_GOTREF(__pyx_t_1);
8984
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8985
 
  __pyx_r = __pyx_t_1;
 
8961
  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_27), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
8962
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
8963
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
 
8964
  __pyx_r = ((PyObject *)__pyx_t_1);
8986
8965
  __pyx_t_1 = 0;
8987
8966
  goto __pyx_L0;
8988
8967
 
8995
8974
  __Pyx_XDECREF(__pyx_t_5);
8996
8975
  __Pyx_XDECREF(__pyx_t_6);
8997
8976
  __Pyx_XDECREF(__pyx_t_8);
8998
 
  __Pyx_AddTraceback("gevent.core.http_request.__str__");
 
8977
  __Pyx_AddTraceback("gevent.core.http_request_base.__str__");
8999
8978
  __pyx_r = NULL;
9000
8979
  __pyx_L0:;
9001
8980
  __Pyx_DECREF(__pyx_v_info);
9002
8981
  __Pyx_DECREF(__pyx_v_ex);
9003
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
9004
8982
  __Pyx_XGIVEREF(__pyx_r);
9005
8983
  __Pyx_RefNannyFinishContext();
9006
8984
  return __pyx_r;
9007
8985
}
9008
8986
 
9009
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":167
 
8987
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":197
9010
8988
 *         return '<%s %s>' % (self.__class__.__name__, info)
9011
8989
 * 
9012
8990
 *     def __repr__(self):             # <<<<<<<<<<<<<<
9014
8992
 *             info = ' ' + self._format()
9015
8993
 */
9016
8994
 
9017
 
static PyObject *__pyx_pf_6gevent_4core_12http_request___repr__(PyObject *__pyx_v_self); /*proto*/
9018
 
static PyObject *__pyx_pf_6gevent_4core_12http_request___repr__(PyObject *__pyx_v_self) {
 
8995
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_5__repr__(PyObject *__pyx_v_self); /*proto*/
 
8996
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_5__repr__(PyObject *__pyx_v_self) {
9019
8997
  PyObject *__pyx_v_info;
9020
8998
  PyObject *__pyx_v_ex;
9021
8999
  PyObject *__pyx_r = NULL;
9028
9006
  int __pyx_t_7;
9029
9007
  PyObject *__pyx_t_8 = NULL;
9030
9008
  __Pyx_RefNannySetupContext("__repr__");
9031
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
9032
9009
  __pyx_v_info = Py_None; __Pyx_INCREF(Py_None);
9033
9010
  __pyx_v_ex = Py_None; __Pyx_INCREF(Py_None);
9034
9011
 
9035
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":168
 
9012
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":198
9036
9013
 * 
9037
9014
 *     def __repr__(self):
9038
9015
 *         try:             # <<<<<<<<<<<<<<
9047
9024
    __Pyx_XGOTREF(__pyx_save_exc_tb);
9048
9025
    /*try:*/ {
9049
9026
 
9050
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":169
 
9027
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":199
9051
9028
 *     def __repr__(self):
9052
9029
 *         try:
9053
9030
 *             info = ' ' + self._format()             # <<<<<<<<<<<<<<
9054
9031
 *         except HttpRequestDeleted:
9055
9032
 *             info = ''
9056
9033
 */
9057
 
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
 
9034
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
9058
9035
      __Pyx_GOTREF(__pyx_t_1);
9059
 
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
 
9036
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
9060
9037
      __Pyx_GOTREF(__pyx_t_2);
9061
9038
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9062
 
      __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_10), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
 
9039
      __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_10), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
9063
9040
      __Pyx_GOTREF(__pyx_t_1);
9064
9041
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9065
9042
      __Pyx_DECREF(__pyx_v_info);
9074
9051
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
9075
9052
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9076
9053
 
9077
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":170
 
9054
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":200
9078
9055
 *         try:
9079
9056
 *             info = ' ' + self._format()
9080
9057
 *         except HttpRequestDeleted:             # <<<<<<<<<<<<<<
9081
9058
 *             info = ''
9082
9059
 *         except Exception, ex:
9083
9060
 */
9084
 
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
9061
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
9085
9062
    __Pyx_GOTREF(__pyx_t_1);
9086
9063
    __pyx_t_3 = PyErr_ExceptionMatches(__pyx_t_1);
9087
9064
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9088
9065
    if (__pyx_t_3) {
9089
 
      __Pyx_AddTraceback("gevent.core.http_request.__repr__");
9090
 
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
9066
      __Pyx_AddTraceback("gevent.core.http_request_base.__repr__");
 
9067
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
9091
9068
      __Pyx_GOTREF(__pyx_t_1);
9092
9069
      __Pyx_GOTREF(__pyx_t_2);
9093
9070
      __Pyx_GOTREF(__pyx_t_4);
9094
9071
 
9095
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":171
 
9072
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":201
9096
9073
 *             info = ' ' + self._format()
9097
9074
 *         except HttpRequestDeleted:
9098
9075
 *             info = ''             # <<<<<<<<<<<<<<
9108
9085
      goto __pyx_L6_exception_handled;
9109
9086
    }
9110
9087
 
9111
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":172
 
9088
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":202
9112
9089
 *         except HttpRequestDeleted:
9113
9090
 *             info = ''
9114
9091
 *         except Exception, ex:             # <<<<<<<<<<<<<<
9117
9094
 */
9118
9095
    __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
9119
9096
    if (__pyx_t_3) {
9120
 
      __Pyx_AddTraceback("gevent.core.http_request.__repr__");
9121
 
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
9097
      __Pyx_AddTraceback("gevent.core.http_request_base.__repr__");
 
9098
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
9122
9099
      __Pyx_GOTREF(__pyx_t_4);
9123
9100
      __Pyx_GOTREF(__pyx_t_2);
9124
9101
      __Pyx_GOTREF(__pyx_t_1);
9126
9103
      __Pyx_DECREF(__pyx_v_ex);
9127
9104
      __pyx_v_ex = __pyx_t_2;
9128
9105
 
9129
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":173
 
9106
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":203
9130
9107
 *             info = ''
9131
9108
 *         except Exception, ex:
9132
9109
 *             info = ' ' + (str(ex) or repr(ex) or '<Error>')             # <<<<<<<<<<<<<<
9133
9110
 *         return '<%s _obj=0x%x %s>' % (self.__class__.__name__, self._obj, info)
9134
9111
 * 
9135
9112
 */
9136
 
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
9137
 
      __Pyx_GOTREF(__pyx_t_5);
 
9113
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
9114
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
9138
9115
      __Pyx_INCREF(__pyx_v_ex);
9139
9116
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_ex);
9140
9117
      __Pyx_GIVEREF(__pyx_v_ex);
9141
 
      __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
9118
      __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
9142
9119
      __Pyx_GOTREF(__pyx_t_6);
9143
 
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9144
 
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
9120
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
 
9121
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
9145
9122
      if (!__pyx_t_7) {
9146
9123
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9147
 
        __pyx_t_5 = PyObject_Repr(__pyx_v_ex); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
9124
        __pyx_t_5 = PyObject_Repr(__pyx_v_ex); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
9148
9125
        __Pyx_GOTREF(__pyx_t_5);
9149
 
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
9126
        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
9150
9127
        if (!__pyx_t_7) {
9151
9128
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9152
9129
          __Pyx_INCREF(((PyObject *)__pyx_kp_s_26));
9161
9138
        __pyx_t_5 = __pyx_t_6;
9162
9139
        __pyx_t_6 = 0;
9163
9140
      }
9164
 
      __pyx_t_6 = PyNumber_Add(((PyObject *)__pyx_kp_s_10), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
9141
      __pyx_t_6 = PyNumber_Add(((PyObject *)__pyx_kp_s_10), __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
9165
9142
      __Pyx_GOTREF(__pyx_t_6);
9166
9143
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9167
9144
      __Pyx_DECREF(__pyx_v_info);
9186
9163
    __pyx_L12_try_end:;
9187
9164
  }
9188
9165
 
9189
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":174
 
9166
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":204
9190
9167
 *         except Exception, ex:
9191
9168
 *             info = ' ' + (str(ex) or repr(ex) or '<Error>')
9192
9169
 *         return '<%s _obj=0x%x %s>' % (self.__class__.__name__, self._obj, info)             # <<<<<<<<<<<<<<
9194
9171
 *     def get_input_headers(self):
9195
9172
 */
9196
9173
  __Pyx_XDECREF(__pyx_r);
9197
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9174
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9198
9175
  __Pyx_GOTREF(__pyx_t_1);
9199
 
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____name__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9176
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____name__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9200
9177
  __Pyx_GOTREF(__pyx_t_2);
9201
9178
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9202
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___obj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9179
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___obj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9203
9180
  __Pyx_GOTREF(__pyx_t_1);
9204
 
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9205
 
  __Pyx_GOTREF(__pyx_t_4);
 
9181
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9182
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
9206
9183
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
9207
9184
  __Pyx_GIVEREF(__pyx_t_2);
9208
9185
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
9212
9189
  __Pyx_GIVEREF(__pyx_v_info);
9213
9190
  __pyx_t_2 = 0;
9214
9191
  __pyx_t_1 = 0;
9215
 
  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_28), __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9216
 
  __Pyx_GOTREF(__pyx_t_1);
9217
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9218
 
  __pyx_r = __pyx_t_1;
 
9192
  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_28), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9193
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
9194
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
 
9195
  __pyx_r = ((PyObject *)__pyx_t_1);
9219
9196
  __pyx_t_1 = 0;
9220
9197
  goto __pyx_L0;
9221
9198
 
9228
9205
  __Pyx_XDECREF(__pyx_t_5);
9229
9206
  __Pyx_XDECREF(__pyx_t_6);
9230
9207
  __Pyx_XDECREF(__pyx_t_8);
9231
 
  __Pyx_AddTraceback("gevent.core.http_request.__repr__");
 
9208
  __Pyx_AddTraceback("gevent.core.http_request_base.__repr__");
9232
9209
  __pyx_r = NULL;
9233
9210
  __pyx_L0:;
9234
9211
  __Pyx_DECREF(__pyx_v_info);
9235
9212
  __Pyx_DECREF(__pyx_v_ex);
9236
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
9237
9213
  __Pyx_XGIVEREF(__pyx_r);
9238
9214
  __Pyx_RefNannyFinishContext();
9239
9215
  return __pyx_r;
9240
9216
}
9241
9217
 
9242
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":176
 
9218
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":206
9243
9219
 *         return '<%s _obj=0x%x %s>' % (self.__class__.__name__, self._obj, info)
9244
9220
 * 
9245
9221
 *     def get_input_headers(self):             # <<<<<<<<<<<<<<
9247
9223
 *             raise HttpRequestDeleted
9248
9224
 */
9249
9225
 
9250
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_get_input_headers(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
9251
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_get_input_headers(PyObject *__pyx_v_self, PyObject *unused) {
 
9226
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_6get_input_headers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
9227
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_6get_input_headers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9252
9228
  struct evkeyvalq *__pyx_v_headers;
9253
9229
  struct evkeyval *__pyx_v_p;
9254
9230
  char *__pyx_v_key;
9257
9233
  PyObject *__pyx_r = NULL;
9258
9234
  int __pyx_t_1;
9259
9235
  PyObject *__pyx_t_2 = NULL;
9260
 
  PyObject *__pyx_t_3 = NULL;
9261
 
  PyObject *__pyx_t_4 = NULL;
 
9236
  int __pyx_t_3;
 
9237
  int __pyx_t_4;
 
9238
  PyObject *__pyx_t_5 = NULL;
 
9239
  PyObject *__pyx_t_6 = NULL;
 
9240
  int __pyx_t_7;
9262
9241
  __Pyx_RefNannySetupContext("get_input_headers");
9263
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
9264
 
  __pyx_v_result = Py_None; __Pyx_INCREF(Py_None);
 
9242
  __pyx_v_result = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
9265
9243
 
9266
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":177
 
9244
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":207
9267
9245
 * 
9268
9246
 *     def get_input_headers(self):
9269
9247
 *         if not self.__obj:             # <<<<<<<<<<<<<<
9270
9248
 *             raise HttpRequestDeleted
9271
9249
 *         cdef evkeyvalq* headers = self.__obj.input_headers
9272
9250
 */
9273
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
9251
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
9274
9252
  if (__pyx_t_1) {
9275
9253
 
9276
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":178
 
9254
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":208
9277
9255
 *     def get_input_headers(self):
9278
9256
 *         if not self.__obj:
9279
9257
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
9280
9258
 *         cdef evkeyvalq* headers = self.__obj.input_headers
9281
9259
 *         cdef evkeyval* p = TAILQ_FIRST(headers)
9282
9260
 */
9283
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9261
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9284
9262
    __Pyx_GOTREF(__pyx_t_2);
9285
9263
    __Pyx_Raise(__pyx_t_2, 0, 0);
9286
9264
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9287
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9265
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9288
9266
    goto __pyx_L5;
9289
9267
  }
9290
9268
  __pyx_L5:;
9291
9269
 
9292
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":179
 
9270
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":209
9293
9271
 *         if not self.__obj:
9294
9272
 *             raise HttpRequestDeleted
9295
9273
 *         cdef evkeyvalq* headers = self.__obj.input_headers             # <<<<<<<<<<<<<<
9296
9274
 *         cdef evkeyval* p = TAILQ_FIRST(headers)
9297
9275
 *         cdef char *key, *value
9298
9276
 */
9299
 
  __pyx_v_headers = ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->input_headers;
 
9277
  __pyx_v_headers = ((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->input_headers;
9300
9278
 
9301
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":180
 
9279
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":210
9302
9280
 *             raise HttpRequestDeleted
9303
9281
 *         cdef evkeyvalq* headers = self.__obj.input_headers
9304
9282
 *         cdef evkeyval* p = TAILQ_FIRST(headers)             # <<<<<<<<<<<<<<
9307
9285
 */
9308
9286
  __pyx_v_p = TAILQ_FIRST(__pyx_v_headers);
9309
9287
 
9310
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":182
 
9288
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":212
9311
9289
 *         cdef evkeyval* p = TAILQ_FIRST(headers)
9312
9290
 *         cdef char *key, *value
9313
9291
 *         result = []             # <<<<<<<<<<<<<<
9314
9292
 *         while p:
9315
9293
 *             key = p.key
9316
9294
 */
9317
 
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9295
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9318
9296
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
9319
 
  __Pyx_DECREF(__pyx_v_result);
9320
 
  __pyx_v_result = ((PyObject *)__pyx_t_2);
 
9297
  __Pyx_DECREF(((PyObject *)__pyx_v_result));
 
9298
  __pyx_v_result = __pyx_t_2;
9321
9299
  __pyx_t_2 = 0;
9322
9300
 
9323
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":183
 
9301
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":213
9324
9302
 *         cdef char *key, *value
9325
9303
 *         result = []
9326
9304
 *         while p:             # <<<<<<<<<<<<<<
9331
9309
    __pyx_t_1 = (__pyx_v_p != 0);
9332
9310
    if (!__pyx_t_1) break;
9333
9311
 
9334
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":184
 
9312
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":214
9335
9313
 *         result = []
9336
9314
 *         while p:
9337
9315
 *             key = p.key             # <<<<<<<<<<<<<<
9338
9316
 *             value = p.value
9339
 
 *             result.append((key if key else None, value if value else None))
 
9317
 *             if key == NULL or value == NULL:
9340
9318
 */
9341
9319
    __pyx_v_key = __pyx_v_p->key;
9342
9320
 
9343
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":185
 
9321
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":215
9344
9322
 *         while p:
9345
9323
 *             key = p.key
9346
9324
 *             value = p.value             # <<<<<<<<<<<<<<
9347
 
 *             result.append((key if key else None, value if value else None))
9348
 
 *             p = TAILQ_GET_NEXT(p)
 
9325
 *             if key == NULL or value == NULL:
 
9326
 *                 break
9349
9327
 */
9350
9328
    __pyx_v_value = __pyx_v_p->value;
9351
9329
 
9352
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":186
 
9330
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":216
9353
9331
 *             key = p.key
9354
9332
 *             value = p.value
9355
 
 *             result.append((key if key else None, value if value else None))             # <<<<<<<<<<<<<<
 
9333
 *             if key == NULL or value == NULL:             # <<<<<<<<<<<<<<
 
9334
 *                 break
 
9335
 *             result.append((key.lower(), value))
 
9336
 */
 
9337
    __pyx_t_1 = (__pyx_v_key == NULL);
 
9338
    if (!__pyx_t_1) {
 
9339
      __pyx_t_3 = (__pyx_v_value == NULL);
 
9340
      __pyx_t_4 = __pyx_t_3;
 
9341
    } else {
 
9342
      __pyx_t_4 = __pyx_t_1;
 
9343
    }
 
9344
    if (__pyx_t_4) {
 
9345
 
 
9346
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":217
 
9347
 *             value = p.value
 
9348
 *             if key == NULL or value == NULL:
 
9349
 *                 break             # <<<<<<<<<<<<<<
 
9350
 *             result.append((key.lower(), value))
 
9351
 *             p = TAILQ_GET_NEXT(p)
 
9352
 */
 
9353
      goto __pyx_L7_break;
 
9354
      goto __pyx_L8;
 
9355
    }
 
9356
    __pyx_L8:;
 
9357
 
 
9358
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":218
 
9359
 *             if key == NULL or value == NULL:
 
9360
 *                 break
 
9361
 *             result.append((key.lower(), value))             # <<<<<<<<<<<<<<
9356
9362
 *             p = TAILQ_GET_NEXT(p)
9357
9363
 *         return result
9358
9364
 */
9359
 
    if ((__pyx_v_key != 0)) {
9360
 
      __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_key); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9361
 
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
9362
 
      __pyx_t_2 = __pyx_t_3;
9363
 
      __pyx_t_3 = 0;
9364
 
    } else {
9365
 
      __Pyx_INCREF(Py_None);
9366
 
      __pyx_t_2 = Py_None;
9367
 
    }
9368
 
    if ((__pyx_v_value != 0)) {
9369
 
      __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9370
 
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
9371
 
      __pyx_t_3 = __pyx_t_4;
9372
 
      __pyx_t_4 = 0;
9373
 
    } else {
9374
 
      __Pyx_INCREF(Py_None);
9375
 
      __pyx_t_3 = Py_None;
9376
 
    }
9377
 
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9378
 
    __Pyx_GOTREF(__pyx_t_4);
9379
 
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
 
9365
    if (unlikely(__pyx_v_result == Py_None)) {
 
9366
      PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} 
 
9367
    }
 
9368
    __pyx_t_2 = PyBytes_FromString(__pyx_v_key); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9369
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
 
9370
    __pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_t_2), __pyx_n_s__lower); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9371
    __Pyx_GOTREF(__pyx_t_5);
 
9372
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
 
9373
    __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9374
    __Pyx_GOTREF(__pyx_t_2);
 
9375
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
9376
    __pyx_t_5 = PyBytes_FromString(__pyx_v_value); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9377
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
 
9378
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9379
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
 
9380
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
9380
9381
    __Pyx_GIVEREF(__pyx_t_2);
9381
 
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
9382
 
    __Pyx_GIVEREF(__pyx_t_3);
 
9382
    PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_5));
 
9383
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
9383
9384
    __pyx_t_2 = 0;
9384
 
    __pyx_t_3 = 0;
9385
 
    __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9386
 
    __Pyx_GOTREF(__pyx_t_3);
9387
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9388
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
9385
    __pyx_t_5 = 0;
 
9386
    __pyx_t_7 = PyList_Append(__pyx_v_result, ((PyObject *)__pyx_t_6)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9387
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
9389
9388
 
9390
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":187
9391
 
 *             value = p.value
9392
 
 *             result.append((key if key else None, value if value else None))
 
9389
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":219
 
9390
 *                 break
 
9391
 *             result.append((key.lower(), value))
9393
9392
 *             p = TAILQ_GET_NEXT(p)             # <<<<<<<<<<<<<<
9394
9393
 *         return result
9395
9394
 * 
9396
9395
 */
9397
9396
    __pyx_v_p = TAILQ_GET_NEXT(__pyx_v_p);
9398
9397
  }
 
9398
  __pyx_L7_break:;
9399
9399
 
9400
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":188
9401
 
 *             result.append((key if key else None, value if value else None))
 
9400
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":220
 
9401
 *             result.append((key.lower(), value))
9402
9402
 *             p = TAILQ_GET_NEXT(p)
9403
9403
 *         return result             # <<<<<<<<<<<<<<
9404
9404
 * 
9405
9405
 *     property connection:
9406
9406
 */
9407
9407
  __Pyx_XDECREF(__pyx_r);
9408
 
  __Pyx_INCREF(__pyx_v_result);
9409
 
  __pyx_r = __pyx_v_result;
 
9408
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
 
9409
  __pyx_r = ((PyObject *)__pyx_v_result);
9410
9410
  goto __pyx_L0;
9411
9411
 
9412
9412
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9413
9413
  goto __pyx_L0;
9414
9414
  __pyx_L1_error:;
9415
9415
  __Pyx_XDECREF(__pyx_t_2);
9416
 
  __Pyx_XDECREF(__pyx_t_3);
9417
 
  __Pyx_XDECREF(__pyx_t_4);
9418
 
  __Pyx_AddTraceback("gevent.core.http_request.get_input_headers");
 
9416
  __Pyx_XDECREF(__pyx_t_5);
 
9417
  __Pyx_XDECREF(__pyx_t_6);
 
9418
  __Pyx_AddTraceback("gevent.core.http_request_base.get_input_headers");
9419
9419
  __pyx_r = NULL;
9420
9420
  __pyx_L0:;
9421
9421
  __Pyx_DECREF(__pyx_v_result);
9422
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
9423
9422
  __Pyx_XGIVEREF(__pyx_r);
9424
9423
  __Pyx_RefNannyFinishContext();
9425
9424
  return __pyx_r;
9426
9425
}
9427
9426
 
9428
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":192
 
9427
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":224
9429
9428
 *     property connection:
9430
9429
 * 
9431
9430
 *         def __get__(self):             # <<<<<<<<<<<<<<
9433
9432
 *                 raise HttpRequestDeleted
9434
9433
 */
9435
9434
 
9436
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_10connection___get__(PyObject *__pyx_v_self); /*proto*/
9437
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_10connection___get__(PyObject *__pyx_v_self) {
 
9435
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_10connection___get__(PyObject *__pyx_v_self); /*proto*/
 
9436
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_10connection___get__(PyObject *__pyx_v_self) {
9438
9437
  PyObject *__pyx_r = NULL;
9439
9438
  int __pyx_t_1;
9440
9439
  PyObject *__pyx_t_2 = NULL;
9441
9440
  PyObject *__pyx_t_3 = NULL;
9442
9441
  __Pyx_RefNannySetupContext("__get__");
9443
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
9444
9442
 
9445
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":193
 
9443
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":225
9446
9444
 * 
9447
9445
 *         def __get__(self):
9448
9446
 *             if not self.__obj:             # <<<<<<<<<<<<<<
9449
9447
 *                 raise HttpRequestDeleted
9450
9448
 *             return http_connection(<size_t>self.__obj.evcon)
9451
9449
 */
9452
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
9450
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
9453
9451
  if (__pyx_t_1) {
9454
9452
 
9455
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":194
 
9453
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":226
9456
9454
 *         def __get__(self):
9457
9455
 *             if not self.__obj:
9458
9456
 *                 raise HttpRequestDeleted             # <<<<<<<<<<<<<<
9459
9457
 *             return http_connection(<size_t>self.__obj.evcon)
9460
9458
 * 
9461
9459
 */
9462
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9460
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9463
9461
    __Pyx_GOTREF(__pyx_t_2);
9464
9462
    __Pyx_Raise(__pyx_t_2, 0, 0);
9465
9463
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9466
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9464
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9467
9465
    goto __pyx_L5;
9468
9466
  }
9469
9467
  __pyx_L5:;
9470
9468
 
9471
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":195
 
9469
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":227
9472
9470
 *             if not self.__obj:
9473
9471
 *                 raise HttpRequestDeleted
9474
9472
 *             return http_connection(<size_t>self.__obj.evcon)             # <<<<<<<<<<<<<<
9476
9474
 *     property remote_host:
9477
9475
 */
9478
9476
  __Pyx_XDECREF(__pyx_r);
9479
 
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(((size_t)((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->evcon)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9477
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(((size_t)((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->evcon)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9480
9478
  __Pyx_GOTREF(__pyx_t_2);
9481
 
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9482
 
  __Pyx_GOTREF(__pyx_t_3);
 
9479
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9480
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
9483
9481
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
9484
9482
  __Pyx_GIVEREF(__pyx_t_2);
9485
9483
  __pyx_t_2 = 0;
9486
 
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_http_connection)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9484
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_http_connection)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9487
9485
  __Pyx_GOTREF(__pyx_t_2);
9488
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
9486
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
9489
9487
  __pyx_r = __pyx_t_2;
9490
9488
  __pyx_t_2 = 0;
9491
9489
  goto __pyx_L0;
9495
9493
  __pyx_L1_error:;
9496
9494
  __Pyx_XDECREF(__pyx_t_2);
9497
9495
  __Pyx_XDECREF(__pyx_t_3);
9498
 
  __Pyx_AddTraceback("gevent.core.http_request.connection.__get__");
 
9496
  __Pyx_AddTraceback("gevent.core.http_request_base.connection.__get__");
9499
9497
  __pyx_r = NULL;
9500
9498
  __pyx_L0:;
9501
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
9502
9499
  __Pyx_XGIVEREF(__pyx_r);
9503
9500
  __Pyx_RefNannyFinishContext();
9504
9501
  return __pyx_r;
9505
9502
}
9506
9503
 
9507
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":199
 
9504
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":231
9508
9505
 *     property remote_host:
9509
9506
 * 
9510
9507
 *         def __get__(self):             # <<<<<<<<<<<<<<
9512
9509
 *                 raise HttpRequestDeleted
9513
9510
 */
9514
9511
 
9515
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_11remote_host___get__(PyObject *__pyx_v_self); /*proto*/
9516
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_11remote_host___get__(PyObject *__pyx_v_self) {
 
9512
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_11remote_host___get__(PyObject *__pyx_v_self); /*proto*/
 
9513
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_11remote_host___get__(PyObject *__pyx_v_self) {
9517
9514
  PyObject *__pyx_r = NULL;
9518
9515
  int __pyx_t_1;
9519
9516
  PyObject *__pyx_t_2 = NULL;
9520
9517
  __Pyx_RefNannySetupContext("__get__");
9521
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
9522
9518
 
9523
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":200
 
9519
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":232
9524
9520
 * 
9525
9521
 *         def __get__(self):
9526
9522
 *             if not self.__obj:             # <<<<<<<<<<<<<<
9527
9523
 *                 raise HttpRequestDeleted
9528
9524
 *             if self.__obj.remote_host:
9529
9525
 */
9530
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
9526
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
9531
9527
  if (__pyx_t_1) {
9532
9528
 
9533
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":201
 
9529
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":233
9534
9530
 *         def __get__(self):
9535
9531
 *             if not self.__obj:
9536
9532
 *                 raise HttpRequestDeleted             # <<<<<<<<<<<<<<
9537
9533
 *             if self.__obj.remote_host:
9538
9534
 *                 return self.__obj.remote_host
9539
9535
 */
9540
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9536
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9541
9537
    __Pyx_GOTREF(__pyx_t_2);
9542
9538
    __Pyx_Raise(__pyx_t_2, 0, 0);
9543
9539
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9544
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9540
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9545
9541
    goto __pyx_L5;
9546
9542
  }
9547
9543
  __pyx_L5:;
9548
9544
 
9549
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":202
 
9545
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":234
9550
9546
 *             if not self.__obj:
9551
9547
 *                 raise HttpRequestDeleted
9552
9548
 *             if self.__obj.remote_host:             # <<<<<<<<<<<<<<
9553
9549
 *                 return self.__obj.remote_host
9554
9550
 * 
9555
9551
 */
9556
 
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->remote_host != 0);
 
9552
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->remote_host != 0);
9557
9553
  if (__pyx_t_1) {
9558
9554
 
9559
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":203
 
9555
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":235
9560
9556
 *                 raise HttpRequestDeleted
9561
9557
 *             if self.__obj.remote_host:
9562
9558
 *                 return self.__obj.remote_host             # <<<<<<<<<<<<<<
9564
9560
 *     property remote_port:
9565
9561
 */
9566
9562
    __Pyx_XDECREF(__pyx_r);
9567
 
    __pyx_t_2 = __Pyx_PyBytes_FromString(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->remote_host); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9563
    __pyx_t_2 = PyBytes_FromString(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->remote_host); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9568
9564
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
9569
9565
    __pyx_r = ((PyObject *)__pyx_t_2);
9570
9566
    __pyx_t_2 = 0;
9577
9573
  goto __pyx_L0;
9578
9574
  __pyx_L1_error:;
9579
9575
  __Pyx_XDECREF(__pyx_t_2);
9580
 
  __Pyx_AddTraceback("gevent.core.http_request.remote_host.__get__");
 
9576
  __Pyx_AddTraceback("gevent.core.http_request_base.remote_host.__get__");
9581
9577
  __pyx_r = NULL;
9582
9578
  __pyx_L0:;
9583
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
9584
9579
  __Pyx_XGIVEREF(__pyx_r);
9585
9580
  __Pyx_RefNannyFinishContext();
9586
9581
  return __pyx_r;
9587
9582
}
9588
9583
 
9589
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":207
 
9584
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":239
9590
9585
 *     property remote_port:
9591
9586
 * 
9592
9587
 *         def __get__(self):             # <<<<<<<<<<<<<<
9594
9589
 *                 raise HttpRequestDeleted
9595
9590
 */
9596
9591
 
9597
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_11remote_port___get__(PyObject *__pyx_v_self); /*proto*/
9598
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_11remote_port___get__(PyObject *__pyx_v_self) {
 
9592
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_11remote_port___get__(PyObject *__pyx_v_self); /*proto*/
 
9593
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_11remote_port___get__(PyObject *__pyx_v_self) {
9599
9594
  PyObject *__pyx_r = NULL;
9600
9595
  int __pyx_t_1;
9601
9596
  PyObject *__pyx_t_2 = NULL;
9602
9597
  __Pyx_RefNannySetupContext("__get__");
9603
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
9604
9598
 
9605
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":208
 
9599
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":240
9606
9600
 * 
9607
9601
 *         def __get__(self):
9608
9602
 *             if not self.__obj:             # <<<<<<<<<<<<<<
9609
9603
 *                 raise HttpRequestDeleted
9610
9604
 *             return self.__obj.remote_port
9611
9605
 */
9612
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
9606
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
9613
9607
  if (__pyx_t_1) {
9614
9608
 
9615
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":209
 
9609
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":241
9616
9610
 *         def __get__(self):
9617
9611
 *             if not self.__obj:
9618
9612
 *                 raise HttpRequestDeleted             # <<<<<<<<<<<<<<
9619
9613
 *             return self.__obj.remote_port
9620
9614
 * 
9621
9615
 */
9622
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9616
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9623
9617
    __Pyx_GOTREF(__pyx_t_2);
9624
9618
    __Pyx_Raise(__pyx_t_2, 0, 0);
9625
9619
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9626
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9620
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9627
9621
    goto __pyx_L5;
9628
9622
  }
9629
9623
  __pyx_L5:;
9630
9624
 
9631
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":210
 
9625
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":242
9632
9626
 *             if not self.__obj:
9633
9627
 *                 raise HttpRequestDeleted
9634
9628
 *             return self.__obj.remote_port             # <<<<<<<<<<<<<<
9636
9630
 *     property remote:
9637
9631
 */
9638
9632
  __Pyx_XDECREF(__pyx_r);
9639
 
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->remote_port); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9633
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->remote_port); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9640
9634
  __Pyx_GOTREF(__pyx_t_2);
9641
9635
  __pyx_r = __pyx_t_2;
9642
9636
  __pyx_t_2 = 0;
9646
9640
  goto __pyx_L0;
9647
9641
  __pyx_L1_error:;
9648
9642
  __Pyx_XDECREF(__pyx_t_2);
9649
 
  __Pyx_AddTraceback("gevent.core.http_request.remote_port.__get__");
 
9643
  __Pyx_AddTraceback("gevent.core.http_request_base.remote_port.__get__");
9650
9644
  __pyx_r = NULL;
9651
9645
  __pyx_L0:;
9652
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
9653
9646
  __Pyx_XGIVEREF(__pyx_r);
9654
9647
  __Pyx_RefNannyFinishContext();
9655
9648
  return __pyx_r;
9656
9649
}
9657
9650
 
9658
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":214
 
9651
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":246
9659
9652
 *     property remote:
9660
9653
 * 
9661
9654
 *         def __get__(self):             # <<<<<<<<<<<<<<
9663
9656
 * 
9664
9657
 */
9665
9658
 
9666
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_6remote___get__(PyObject *__pyx_v_self); /*proto*/
9667
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_6remote___get__(PyObject *__pyx_v_self) {
 
9659
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_6remote___get__(PyObject *__pyx_v_self); /*proto*/
 
9660
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_6remote___get__(PyObject *__pyx_v_self) {
9668
9661
  PyObject *__pyx_r = NULL;
9669
9662
  PyObject *__pyx_t_1 = NULL;
9670
9663
  PyObject *__pyx_t_2 = NULL;
9671
9664
  PyObject *__pyx_t_3 = NULL;
9672
9665
  __Pyx_RefNannySetupContext("__get__");
9673
9666
 
9674
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":215
 
9667
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":247
9675
9668
 * 
9676
9669
 *         def __get__(self):
9677
9670
 *             return (self.remote_host, self.remote_port)             # <<<<<<<<<<<<<<
9679
9672
 *     property kind:
9680
9673
 */
9681
9674
  __Pyx_XDECREF(__pyx_r);
9682
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__remote_host); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9675
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__remote_host); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9683
9676
  __Pyx_GOTREF(__pyx_t_1);
9684
 
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__remote_port); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9677
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__remote_port); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9685
9678
  __Pyx_GOTREF(__pyx_t_2);
9686
 
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9687
 
  __Pyx_GOTREF(__pyx_t_3);
 
9679
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9680
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
9688
9681
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
9689
9682
  __Pyx_GIVEREF(__pyx_t_1);
9690
9683
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
9691
9684
  __Pyx_GIVEREF(__pyx_t_2);
9692
9685
  __pyx_t_1 = 0;
9693
9686
  __pyx_t_2 = 0;
9694
 
  __pyx_r = __pyx_t_3;
 
9687
  __pyx_r = ((PyObject *)__pyx_t_3);
9695
9688
  __pyx_t_3 = 0;
9696
9689
  goto __pyx_L0;
9697
9690
 
9701
9694
  __Pyx_XDECREF(__pyx_t_1);
9702
9695
  __Pyx_XDECREF(__pyx_t_2);
9703
9696
  __Pyx_XDECREF(__pyx_t_3);
9704
 
  __Pyx_AddTraceback("gevent.core.http_request.remote.__get__");
 
9697
  __Pyx_AddTraceback("gevent.core.http_request_base.remote.__get__");
9705
9698
  __pyx_r = NULL;
9706
9699
  __pyx_L0:;
9707
9700
  __Pyx_XGIVEREF(__pyx_r);
9709
9702
  return __pyx_r;
9710
9703
}
9711
9704
 
9712
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":219
 
9705
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":251
9713
9706
 *     property kind:
9714
9707
 * 
9715
9708
 *         def __get__(self):             # <<<<<<<<<<<<<<
9717
9710
 *                 raise HttpRequestDeleted
9718
9711
 */
9719
9712
 
9720
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_4kind___get__(PyObject *__pyx_v_self); /*proto*/
9721
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_4kind___get__(PyObject *__pyx_v_self) {
 
9713
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_4kind___get__(PyObject *__pyx_v_self); /*proto*/
 
9714
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_4kind___get__(PyObject *__pyx_v_self) {
9722
9715
  PyObject *__pyx_r = NULL;
9723
9716
  int __pyx_t_1;
9724
9717
  PyObject *__pyx_t_2 = NULL;
9725
9718
  __Pyx_RefNannySetupContext("__get__");
9726
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
9727
9719
 
9728
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":220
 
9720
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":252
9729
9721
 * 
9730
9722
 *         def __get__(self):
9731
9723
 *             if not self.__obj:             # <<<<<<<<<<<<<<
9732
9724
 *                 raise HttpRequestDeleted
9733
9725
 *             return self.__obj.kind
9734
9726
 */
9735
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
9727
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
9736
9728
  if (__pyx_t_1) {
9737
9729
 
9738
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":221
 
9730
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":253
9739
9731
 *         def __get__(self):
9740
9732
 *             if not self.__obj:
9741
9733
 *                 raise HttpRequestDeleted             # <<<<<<<<<<<<<<
9742
9734
 *             return self.__obj.kind
9743
9735
 * 
9744
9736
 */
9745
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9737
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9746
9738
    __Pyx_GOTREF(__pyx_t_2);
9747
9739
    __Pyx_Raise(__pyx_t_2, 0, 0);
9748
9740
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9749
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9741
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9750
9742
    goto __pyx_L5;
9751
9743
  }
9752
9744
  __pyx_L5:;
9753
9745
 
9754
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":222
 
9746
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":254
9755
9747
 *             if not self.__obj:
9756
9748
 *                 raise HttpRequestDeleted
9757
9749
 *             return self.__obj.kind             # <<<<<<<<<<<<<<
9759
9751
 *     property type:
9760
9752
 */
9761
9753
  __Pyx_XDECREF(__pyx_r);
9762
 
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->kind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9754
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->kind); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9763
9755
  __Pyx_GOTREF(__pyx_t_2);
9764
9756
  __pyx_r = __pyx_t_2;
9765
9757
  __pyx_t_2 = 0;
9769
9761
  goto __pyx_L0;
9770
9762
  __pyx_L1_error:;
9771
9763
  __Pyx_XDECREF(__pyx_t_2);
9772
 
  __Pyx_AddTraceback("gevent.core.http_request.kind.__get__");
 
9764
  __Pyx_AddTraceback("gevent.core.http_request_base.kind.__get__");
9773
9765
  __pyx_r = NULL;
9774
9766
  __pyx_L0:;
9775
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
9776
9767
  __Pyx_XGIVEREF(__pyx_r);
9777
9768
  __Pyx_RefNannyFinishContext();
9778
9769
  return __pyx_r;
9779
9770
}
9780
9771
 
9781
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":226
 
9772
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":258
9782
9773
 *     property type:
9783
9774
 * 
9784
9775
 *         def __get__(self):             # <<<<<<<<<<<<<<
9786
9777
 *                 raise HttpRequestDeleted
9787
9778
 */
9788
9779
 
9789
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_4type___get__(PyObject *__pyx_v_self); /*proto*/
9790
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_4type___get__(PyObject *__pyx_v_self) {
 
9780
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_4type___get__(PyObject *__pyx_v_self); /*proto*/
 
9781
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_4type___get__(PyObject *__pyx_v_self) {
9791
9782
  PyObject *__pyx_r = NULL;
9792
9783
  int __pyx_t_1;
9793
9784
  PyObject *__pyx_t_2 = NULL;
9794
9785
  __Pyx_RefNannySetupContext("__get__");
9795
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
9796
9786
 
9797
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":227
 
9787
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":259
9798
9788
 * 
9799
9789
 *         def __get__(self):
9800
9790
 *             if not self.__obj:             # <<<<<<<<<<<<<<
9801
9791
 *                 raise HttpRequestDeleted
9802
9792
 *             return self.__obj.type
9803
9793
 */
9804
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
9794
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
9805
9795
  if (__pyx_t_1) {
9806
9796
 
9807
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":228
 
9797
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":260
9808
9798
 *         def __get__(self):
9809
9799
 *             if not self.__obj:
9810
9800
 *                 raise HttpRequestDeleted             # <<<<<<<<<<<<<<
9811
9801
 *             return self.__obj.type
9812
9802
 * 
9813
9803
 */
9814
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9804
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9815
9805
    __Pyx_GOTREF(__pyx_t_2);
9816
9806
    __Pyx_Raise(__pyx_t_2, 0, 0);
9817
9807
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9818
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9808
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9819
9809
    goto __pyx_L5;
9820
9810
  }
9821
9811
  __pyx_L5:;
9822
9812
 
9823
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":229
 
9813
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":261
9824
9814
 *             if not self.__obj:
9825
9815
 *                 raise HttpRequestDeleted
9826
9816
 *             return self.__obj.type             # <<<<<<<<<<<<<<
9828
9818
 *     property typestr:
9829
9819
 */
9830
9820
  __Pyx_XDECREF(__pyx_r);
9831
 
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9821
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9832
9822
  __Pyx_GOTREF(__pyx_t_2);
9833
9823
  __pyx_r = __pyx_t_2;
9834
9824
  __pyx_t_2 = 0;
9838
9828
  goto __pyx_L0;
9839
9829
  __pyx_L1_error:;
9840
9830
  __Pyx_XDECREF(__pyx_t_2);
9841
 
  __Pyx_AddTraceback("gevent.core.http_request.type.__get__");
 
9831
  __Pyx_AddTraceback("gevent.core.http_request_base.type.__get__");
9842
9832
  __pyx_r = NULL;
9843
9833
  __pyx_L0:;
9844
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
9845
9834
  __Pyx_XGIVEREF(__pyx_r);
9846
9835
  __Pyx_RefNannyFinishContext();
9847
9836
  return __pyx_r;
9848
9837
}
9849
9838
 
9850
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":233
 
9839
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":265
9851
9840
 *     property typestr:
9852
9841
 * 
9853
9842
 *         def __get__(self):             # <<<<<<<<<<<<<<
9855
9844
 *                 raise HttpRequestDeleted
9856
9845
 */
9857
9846
 
9858
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_7typestr___get__(PyObject *__pyx_v_self); /*proto*/
9859
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_7typestr___get__(PyObject *__pyx_v_self) {
 
9847
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_7typestr___get__(PyObject *__pyx_v_self); /*proto*/
 
9848
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_7typestr___get__(PyObject *__pyx_v_self) {
9860
9849
  PyObject *__pyx_r = NULL;
9861
9850
  int __pyx_t_1;
9862
9851
  PyObject *__pyx_t_2 = NULL;
9863
9852
  PyObject *__pyx_t_3 = NULL;
9864
9853
  PyObject *__pyx_t_4 = NULL;
9865
9854
  __Pyx_RefNannySetupContext("__get__");
9866
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
9867
9855
 
9868
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":234
 
9856
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":266
9869
9857
 * 
9870
9858
 *         def __get__(self):
9871
9859
 *             if not self.__obj:             # <<<<<<<<<<<<<<
9872
9860
 *                 raise HttpRequestDeleted
9873
9861
 *             return HTTP_method2name.get(self.__obj.type) or str(self.__obj.type)
9874
9862
 */
9875
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
9863
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
9876
9864
  if (__pyx_t_1) {
9877
9865
 
9878
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":235
 
9866
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":267
9879
9867
 *         def __get__(self):
9880
9868
 *             if not self.__obj:
9881
9869
 *                 raise HttpRequestDeleted             # <<<<<<<<<<<<<<
9882
9870
 *             return HTTP_method2name.get(self.__obj.type) or str(self.__obj.type)
9883
9871
 * 
9884
9872
 */
9885
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9873
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9886
9874
    __Pyx_GOTREF(__pyx_t_2);
9887
9875
    __Pyx_Raise(__pyx_t_2, 0, 0);
9888
9876
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9889
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9877
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9890
9878
    goto __pyx_L5;
9891
9879
  }
9892
9880
  __pyx_L5:;
9893
9881
 
9894
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":236
 
9882
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":268
9895
9883
 *             if not self.__obj:
9896
9884
 *                 raise HttpRequestDeleted
9897
9885
 *             return HTTP_method2name.get(self.__obj.type) or str(self.__obj.type)             # <<<<<<<<<<<<<<
9899
9887
 *     property uri:
9900
9888
 */
9901
9889
  __Pyx_XDECREF(__pyx_r);
9902
 
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HTTP_method2name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9890
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HTTP_method2name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9903
9891
  __Pyx_GOTREF(__pyx_t_2);
9904
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9892
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9905
9893
  __Pyx_GOTREF(__pyx_t_3);
9906
9894
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9907
 
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9895
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9908
9896
  __Pyx_GOTREF(__pyx_t_2);
9909
 
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9910
 
  __Pyx_GOTREF(__pyx_t_4);
 
9897
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9898
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
9911
9899
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
9912
9900
  __Pyx_GIVEREF(__pyx_t_2);
9913
9901
  __pyx_t_2 = 0;
9914
 
  __pyx_t_2 = PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9902
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9915
9903
  __Pyx_GOTREF(__pyx_t_2);
9916
9904
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9917
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9918
 
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9905
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
 
9906
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9919
9907
  if (!__pyx_t_1) {
9920
9908
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9921
 
    __pyx_t_4 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9909
    __pyx_t_4 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->type); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9922
9910
    __Pyx_GOTREF(__pyx_t_4);
9923
 
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9924
 
    __Pyx_GOTREF(__pyx_t_3);
 
9911
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9912
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
9925
9913
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
9926
9914
    __Pyx_GIVEREF(__pyx_t_4);
9927
9915
    __pyx_t_4 = 0;
9928
 
    __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9916
    __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9929
9917
    __Pyx_GOTREF(__pyx_t_4);
9930
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
9918
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
9931
9919
    __pyx_t_3 = __pyx_t_4;
9932
9920
    __pyx_t_4 = 0;
9933
9921
  } else {
9944
9932
  __Pyx_XDECREF(__pyx_t_2);
9945
9933
  __Pyx_XDECREF(__pyx_t_3);
9946
9934
  __Pyx_XDECREF(__pyx_t_4);
9947
 
  __Pyx_AddTraceback("gevent.core.http_request.typestr.__get__");
 
9935
  __Pyx_AddTraceback("gevent.core.http_request_base.typestr.__get__");
9948
9936
  __pyx_r = NULL;
9949
9937
  __pyx_L0:;
9950
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
9951
9938
  __Pyx_XGIVEREF(__pyx_r);
9952
9939
  __Pyx_RefNannyFinishContext();
9953
9940
  return __pyx_r;
9954
9941
}
9955
9942
 
9956
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":240
 
9943
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":272
9957
9944
 *     property uri:
9958
9945
 * 
9959
9946
 *         def __get__(self):             # <<<<<<<<<<<<<<
9961
9948
 *                 raise HttpRequestDeleted
9962
9949
 */
9963
9950
 
9964
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_3uri___get__(PyObject *__pyx_v_self); /*proto*/
9965
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_3uri___get__(PyObject *__pyx_v_self) {
 
9951
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_3uri___get__(PyObject *__pyx_v_self); /*proto*/
 
9952
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_3uri___get__(PyObject *__pyx_v_self) {
9966
9953
  PyObject *__pyx_r = NULL;
9967
9954
  int __pyx_t_1;
9968
9955
  PyObject *__pyx_t_2 = NULL;
9969
9956
  __Pyx_RefNannySetupContext("__get__");
9970
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
9971
9957
 
9972
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":241
 
9958
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":273
9973
9959
 * 
9974
9960
 *         def __get__(self):
9975
9961
 *             if not self.__obj:             # <<<<<<<<<<<<<<
9976
9962
 *                 raise HttpRequestDeleted
9977
9963
 *             if self.__obj.uri:
9978
9964
 */
9979
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
9965
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
9980
9966
  if (__pyx_t_1) {
9981
9967
 
9982
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":242
 
9968
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":274
9983
9969
 *         def __get__(self):
9984
9970
 *             if not self.__obj:
9985
9971
 *                 raise HttpRequestDeleted             # <<<<<<<<<<<<<<
9986
9972
 *             if self.__obj.uri:
9987
9973
 *                 return self.__obj.uri
9988
9974
 */
9989
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9975
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9990
9976
    __Pyx_GOTREF(__pyx_t_2);
9991
9977
    __Pyx_Raise(__pyx_t_2, 0, 0);
9992
9978
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9993
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
9979
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9994
9980
    goto __pyx_L5;
9995
9981
  }
9996
9982
  __pyx_L5:;
9997
9983
 
9998
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":243
 
9984
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":275
9999
9985
 *             if not self.__obj:
10000
9986
 *                 raise HttpRequestDeleted
10001
9987
 *             if self.__obj.uri:             # <<<<<<<<<<<<<<
10002
9988
 *                 return self.__obj.uri
10003
9989
 * 
10004
9990
 */
10005
 
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->uri != 0);
 
9991
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->uri != 0);
10006
9992
  if (__pyx_t_1) {
10007
9993
 
10008
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":244
 
9994
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":276
10009
9995
 *                 raise HttpRequestDeleted
10010
9996
 *             if self.__obj.uri:
10011
9997
 *                 return self.__obj.uri             # <<<<<<<<<<<<<<
10013
9999
 *     property major:
10014
10000
 */
10015
10001
    __Pyx_XDECREF(__pyx_r);
10016
 
    __pyx_t_2 = __Pyx_PyBytes_FromString(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->uri); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10002
    __pyx_t_2 = PyBytes_FromString(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->uri); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10017
10003
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
10018
10004
    __pyx_r = ((PyObject *)__pyx_t_2);
10019
10005
    __pyx_t_2 = 0;
10026
10012
  goto __pyx_L0;
10027
10013
  __pyx_L1_error:;
10028
10014
  __Pyx_XDECREF(__pyx_t_2);
10029
 
  __Pyx_AddTraceback("gevent.core.http_request.uri.__get__");
 
10015
  __Pyx_AddTraceback("gevent.core.http_request_base.uri.__get__");
10030
10016
  __pyx_r = NULL;
10031
10017
  __pyx_L0:;
10032
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
10033
10018
  __Pyx_XGIVEREF(__pyx_r);
10034
10019
  __Pyx_RefNannyFinishContext();
10035
10020
  return __pyx_r;
10036
10021
}
10037
10022
 
10038
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":248
 
10023
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":280
10039
10024
 *     property major:
10040
10025
 * 
10041
10026
 *         def __get__(self):             # <<<<<<<<<<<<<<
10043
10028
 *                 raise HttpRequestDeleted
10044
10029
 */
10045
10030
 
10046
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_5major___get__(PyObject *__pyx_v_self); /*proto*/
10047
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_5major___get__(PyObject *__pyx_v_self) {
 
10031
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_5major___get__(PyObject *__pyx_v_self); /*proto*/
 
10032
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_5major___get__(PyObject *__pyx_v_self) {
10048
10033
  PyObject *__pyx_r = NULL;
10049
10034
  int __pyx_t_1;
10050
10035
  PyObject *__pyx_t_2 = NULL;
10051
10036
  __Pyx_RefNannySetupContext("__get__");
10052
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
10053
10037
 
10054
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":249
 
10038
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":281
10055
10039
 * 
10056
10040
 *         def __get__(self):
10057
10041
 *             if not self.__obj:             # <<<<<<<<<<<<<<
10058
10042
 *                 raise HttpRequestDeleted
10059
10043
 *             return self.__obj.major
10060
10044
 */
10061
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
10045
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
10062
10046
  if (__pyx_t_1) {
10063
10047
 
10064
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":250
 
10048
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":282
10065
10049
 *         def __get__(self):
10066
10050
 *             if not self.__obj:
10067
10051
 *                 raise HttpRequestDeleted             # <<<<<<<<<<<<<<
10068
10052
 *             return self.__obj.major
10069
10053
 * 
10070
10054
 */
10071
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10055
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10072
10056
    __Pyx_GOTREF(__pyx_t_2);
10073
10057
    __Pyx_Raise(__pyx_t_2, 0, 0);
10074
10058
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10075
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10059
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10076
10060
    goto __pyx_L5;
10077
10061
  }
10078
10062
  __pyx_L5:;
10079
10063
 
10080
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":251
 
10064
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":283
10081
10065
 *             if not self.__obj:
10082
10066
 *                 raise HttpRequestDeleted
10083
10067
 *             return self.__obj.major             # <<<<<<<<<<<<<<
10085
10069
 *     property minor:
10086
10070
 */
10087
10071
  __Pyx_XDECREF(__pyx_r);
10088
 
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->major); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10072
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->major); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10089
10073
  __Pyx_GOTREF(__pyx_t_2);
10090
10074
  __pyx_r = __pyx_t_2;
10091
10075
  __pyx_t_2 = 0;
10095
10079
  goto __pyx_L0;
10096
10080
  __pyx_L1_error:;
10097
10081
  __Pyx_XDECREF(__pyx_t_2);
10098
 
  __Pyx_AddTraceback("gevent.core.http_request.major.__get__");
 
10082
  __Pyx_AddTraceback("gevent.core.http_request_base.major.__get__");
10099
10083
  __pyx_r = NULL;
10100
10084
  __pyx_L0:;
10101
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
10102
10085
  __Pyx_XGIVEREF(__pyx_r);
10103
10086
  __Pyx_RefNannyFinishContext();
10104
10087
  return __pyx_r;
10105
10088
}
10106
10089
 
10107
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":255
 
10090
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":287
10108
10091
 *     property minor:
10109
10092
 * 
10110
10093
 *         def __get__(self):             # <<<<<<<<<<<<<<
10112
10095
 *                 raise HttpRequestDeleted
10113
10096
 */
10114
10097
 
10115
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_5minor___get__(PyObject *__pyx_v_self); /*proto*/
10116
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_5minor___get__(PyObject *__pyx_v_self) {
 
10098
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_5minor___get__(PyObject *__pyx_v_self); /*proto*/
 
10099
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_5minor___get__(PyObject *__pyx_v_self) {
10117
10100
  PyObject *__pyx_r = NULL;
10118
10101
  int __pyx_t_1;
10119
10102
  PyObject *__pyx_t_2 = NULL;
10120
10103
  __Pyx_RefNannySetupContext("__get__");
10121
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
10122
10104
 
10123
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":256
 
10105
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":288
10124
10106
 * 
10125
10107
 *         def __get__(self):
10126
10108
 *             if not self.__obj:             # <<<<<<<<<<<<<<
10127
10109
 *                 raise HttpRequestDeleted
10128
10110
 *             return self.__obj.minor
10129
10111
 */
10130
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
10112
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
10131
10113
  if (__pyx_t_1) {
10132
10114
 
10133
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":257
 
10115
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":289
10134
10116
 *         def __get__(self):
10135
10117
 *             if not self.__obj:
10136
10118
 *                 raise HttpRequestDeleted             # <<<<<<<<<<<<<<
10137
10119
 *             return self.__obj.minor
10138
10120
 * 
10139
10121
 */
10140
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10122
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10141
10123
    __Pyx_GOTREF(__pyx_t_2);
10142
10124
    __Pyx_Raise(__pyx_t_2, 0, 0);
10143
10125
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10144
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10126
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10145
10127
    goto __pyx_L5;
10146
10128
  }
10147
10129
  __pyx_L5:;
10148
10130
 
10149
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":258
 
10131
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":290
10150
10132
 *             if not self.__obj:
10151
10133
 *                 raise HttpRequestDeleted
10152
10134
 *             return self.__obj.minor             # <<<<<<<<<<<<<<
10154
10136
 *     property version:
10155
10137
 */
10156
10138
  __Pyx_XDECREF(__pyx_r);
10157
 
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->minor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10139
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->minor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10158
10140
  __Pyx_GOTREF(__pyx_t_2);
10159
10141
  __pyx_r = __pyx_t_2;
10160
10142
  __pyx_t_2 = 0;
10164
10146
  goto __pyx_L0;
10165
10147
  __pyx_L1_error:;
10166
10148
  __Pyx_XDECREF(__pyx_t_2);
10167
 
  __Pyx_AddTraceback("gevent.core.http_request.minor.__get__");
 
10149
  __Pyx_AddTraceback("gevent.core.http_request_base.minor.__get__");
10168
10150
  __pyx_r = NULL;
10169
10151
  __pyx_L0:;
10170
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
10171
10152
  __Pyx_XGIVEREF(__pyx_r);
10172
10153
  __Pyx_RefNannyFinishContext();
10173
10154
  return __pyx_r;
10174
10155
}
10175
10156
 
10176
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":262
 
10157
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":294
10177
10158
 *     property version:
10178
10159
 * 
10179
10160
 *         def __get__(self):             # <<<<<<<<<<<<<<
10181
10162
 *                 raise HttpRequestDeleted
10182
10163
 */
10183
10164
 
10184
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_7version___get__(PyObject *__pyx_v_self); /*proto*/
10185
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_7version___get__(PyObject *__pyx_v_self) {
 
10165
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_7version___get__(PyObject *__pyx_v_self); /*proto*/
 
10166
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_7version___get__(PyObject *__pyx_v_self) {
10186
10167
  PyObject *__pyx_r = NULL;
10187
10168
  int __pyx_t_1;
10188
10169
  PyObject *__pyx_t_2 = NULL;
10189
10170
  PyObject *__pyx_t_3 = NULL;
10190
10171
  PyObject *__pyx_t_4 = NULL;
10191
10172
  __Pyx_RefNannySetupContext("__get__");
10192
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
10193
10173
 
10194
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":263
 
10174
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":295
10195
10175
 * 
10196
10176
 *         def __get__(self):
10197
10177
 *             if not self.__obj:             # <<<<<<<<<<<<<<
10198
10178
 *                 raise HttpRequestDeleted
10199
10179
 *             return (self.__obj.major, self.__obj.minor)
10200
10180
 */
10201
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
10181
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
10202
10182
  if (__pyx_t_1) {
10203
10183
 
10204
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":264
 
10184
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":296
10205
10185
 *         def __get__(self):
10206
10186
 *             if not self.__obj:
10207
10187
 *                 raise HttpRequestDeleted             # <<<<<<<<<<<<<<
10208
10188
 *             return (self.__obj.major, self.__obj.minor)
10209
10189
 * 
10210
10190
 */
10211
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10191
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10212
10192
    __Pyx_GOTREF(__pyx_t_2);
10213
10193
    __Pyx_Raise(__pyx_t_2, 0, 0);
10214
10194
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10215
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10195
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10216
10196
    goto __pyx_L5;
10217
10197
  }
10218
10198
  __pyx_L5:;
10219
10199
 
10220
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":265
 
10200
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":297
10221
10201
 *             if not self.__obj:
10222
10202
 *                 raise HttpRequestDeleted
10223
10203
 *             return (self.__obj.major, self.__obj.minor)             # <<<<<<<<<<<<<<
10225
10205
 *     property response_code:
10226
10206
 */
10227
10207
  __Pyx_XDECREF(__pyx_r);
10228
 
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->major); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10208
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->major); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10229
10209
  __Pyx_GOTREF(__pyx_t_2);
10230
 
  __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->minor); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10210
  __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->minor); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10231
10211
  __Pyx_GOTREF(__pyx_t_3);
10232
 
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10233
 
  __Pyx_GOTREF(__pyx_t_4);
 
10212
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10213
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
10234
10214
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
10235
10215
  __Pyx_GIVEREF(__pyx_t_2);
10236
10216
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
10237
10217
  __Pyx_GIVEREF(__pyx_t_3);
10238
10218
  __pyx_t_2 = 0;
10239
10219
  __pyx_t_3 = 0;
10240
 
  __pyx_r = __pyx_t_4;
 
10220
  __pyx_r = ((PyObject *)__pyx_t_4);
10241
10221
  __pyx_t_4 = 0;
10242
10222
  goto __pyx_L0;
10243
10223
 
10247
10227
  __Pyx_XDECREF(__pyx_t_2);
10248
10228
  __Pyx_XDECREF(__pyx_t_3);
10249
10229
  __Pyx_XDECREF(__pyx_t_4);
10250
 
  __Pyx_AddTraceback("gevent.core.http_request.version.__get__");
 
10230
  __Pyx_AddTraceback("gevent.core.http_request_base.version.__get__");
10251
10231
  __pyx_r = NULL;
10252
10232
  __pyx_L0:;
10253
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
10254
10233
  __Pyx_XGIVEREF(__pyx_r);
10255
10234
  __Pyx_RefNannyFinishContext();
10256
10235
  return __pyx_r;
10257
10236
}
10258
10237
 
10259
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":269
 
10238
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":301
10260
10239
 *     property response_code:
10261
10240
 * 
10262
10241
 *         def __get__(self):             # <<<<<<<<<<<<<<
10264
10243
 *                 raise HttpRequestDeleted
10265
10244
 */
10266
10245
 
10267
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_13response_code___get__(PyObject *__pyx_v_self); /*proto*/
10268
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_13response_code___get__(PyObject *__pyx_v_self) {
 
10246
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_13response_code___get__(PyObject *__pyx_v_self); /*proto*/
 
10247
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_13response_code___get__(PyObject *__pyx_v_self) {
10269
10248
  PyObject *__pyx_r = NULL;
10270
10249
  int __pyx_t_1;
10271
10250
  PyObject *__pyx_t_2 = NULL;
10272
10251
  __Pyx_RefNannySetupContext("__get__");
10273
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
10274
10252
 
10275
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":270
 
10253
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":302
10276
10254
 * 
10277
10255
 *         def __get__(self):
10278
10256
 *             if not self.__obj:             # <<<<<<<<<<<<<<
10279
10257
 *                 raise HttpRequestDeleted
10280
10258
 *             return self.__obj.response_code
10281
10259
 */
10282
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
10260
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
10283
10261
  if (__pyx_t_1) {
10284
10262
 
10285
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":271
 
10263
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":303
10286
10264
 *         def __get__(self):
10287
10265
 *             if not self.__obj:
10288
10266
 *                 raise HttpRequestDeleted             # <<<<<<<<<<<<<<
10289
10267
 *             return self.__obj.response_code
10290
10268
 * 
10291
10269
 */
10292
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10270
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10293
10271
    __Pyx_GOTREF(__pyx_t_2);
10294
10272
    __Pyx_Raise(__pyx_t_2, 0, 0);
10295
10273
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10296
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10274
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10297
10275
    goto __pyx_L5;
10298
10276
  }
10299
10277
  __pyx_L5:;
10300
10278
 
10301
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":272
 
10279
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":304
10302
10280
 *             if not self.__obj:
10303
10281
 *                 raise HttpRequestDeleted
10304
10282
 *             return self.__obj.response_code             # <<<<<<<<<<<<<<
10306
10284
 *     property response_code_line:
10307
10285
 */
10308
10286
  __Pyx_XDECREF(__pyx_r);
10309
 
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->response_code); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10287
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->response_code); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10310
10288
  __Pyx_GOTREF(__pyx_t_2);
10311
10289
  __pyx_r = __pyx_t_2;
10312
10290
  __pyx_t_2 = 0;
10316
10294
  goto __pyx_L0;
10317
10295
  __pyx_L1_error:;
10318
10296
  __Pyx_XDECREF(__pyx_t_2);
10319
 
  __Pyx_AddTraceback("gevent.core.http_request.response_code.__get__");
 
10297
  __Pyx_AddTraceback("gevent.core.http_request_base.response_code.__get__");
10320
10298
  __pyx_r = NULL;
10321
10299
  __pyx_L0:;
10322
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
10323
10300
  __Pyx_XGIVEREF(__pyx_r);
10324
10301
  __Pyx_RefNannyFinishContext();
10325
10302
  return __pyx_r;
10326
10303
}
10327
10304
 
10328
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":276
 
10305
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":308
10329
10306
 *     property response_code_line:
10330
10307
 * 
10331
10308
 *         def __get__(self):             # <<<<<<<<<<<<<<
10333
10310
 *                 raise HttpRequestDeleted
10334
10311
 */
10335
10312
 
10336
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_18response_code_line___get__(PyObject *__pyx_v_self); /*proto*/
10337
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_18response_code_line___get__(PyObject *__pyx_v_self) {
 
10313
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_18response_code_line___get__(PyObject *__pyx_v_self); /*proto*/
 
10314
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_18response_code_line___get__(PyObject *__pyx_v_self) {
10338
10315
  PyObject *__pyx_r = NULL;
10339
10316
  int __pyx_t_1;
10340
10317
  PyObject *__pyx_t_2 = NULL;
10341
10318
  __Pyx_RefNannySetupContext("__get__");
10342
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
10343
10319
 
10344
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":277
 
10320
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":309
10345
10321
 * 
10346
10322
 *         def __get__(self):
10347
10323
 *             if not self.__obj:             # <<<<<<<<<<<<<<
10348
10324
 *                 raise HttpRequestDeleted
10349
10325
 *             if self.__obj.response_code_line:
10350
10326
 */
10351
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
10327
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
10352
10328
  if (__pyx_t_1) {
10353
10329
 
10354
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":278
 
10330
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":310
10355
10331
 *         def __get__(self):
10356
10332
 *             if not self.__obj:
10357
10333
 *                 raise HttpRequestDeleted             # <<<<<<<<<<<<<<
10358
10334
 *             if self.__obj.response_code_line:
10359
10335
 *                 return self.__obj.response_code_line
10360
10336
 */
10361
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10337
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10362
10338
    __Pyx_GOTREF(__pyx_t_2);
10363
10339
    __Pyx_Raise(__pyx_t_2, 0, 0);
10364
10340
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10365
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10341
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10366
10342
    goto __pyx_L5;
10367
10343
  }
10368
10344
  __pyx_L5:;
10369
10345
 
10370
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":279
 
10346
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":311
10371
10347
 *             if not self.__obj:
10372
10348
 *                 raise HttpRequestDeleted
10373
10349
 *             if self.__obj.response_code_line:             # <<<<<<<<<<<<<<
10374
10350
 *                 return self.__obj.response_code_line
10375
10351
 * 
10376
10352
 */
10377
 
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->response_code_line != 0);
 
10353
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->response_code_line != 0);
10378
10354
  if (__pyx_t_1) {
10379
10355
 
10380
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":280
 
10356
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":312
10381
10357
 *                 raise HttpRequestDeleted
10382
10358
 *             if self.__obj.response_code_line:
10383
10359
 *                 return self.__obj.response_code_line             # <<<<<<<<<<<<<<
10385
10361
 *     property response:
10386
10362
 */
10387
10363
    __Pyx_XDECREF(__pyx_r);
10388
 
    __pyx_t_2 = __Pyx_PyBytes_FromString(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->response_code_line); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10364
    __pyx_t_2 = PyBytes_FromString(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->response_code_line); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10389
10365
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
10390
10366
    __pyx_r = ((PyObject *)__pyx_t_2);
10391
10367
    __pyx_t_2 = 0;
10398
10374
  goto __pyx_L0;
10399
10375
  __pyx_L1_error:;
10400
10376
  __Pyx_XDECREF(__pyx_t_2);
10401
 
  __Pyx_AddTraceback("gevent.core.http_request.response_code_line.__get__");
 
10377
  __Pyx_AddTraceback("gevent.core.http_request_base.response_code_line.__get__");
10402
10378
  __pyx_r = NULL;
10403
10379
  __pyx_L0:;
10404
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
10405
10380
  __Pyx_XGIVEREF(__pyx_r);
10406
10381
  __Pyx_RefNannyFinishContext();
10407
10382
  return __pyx_r;
10408
10383
}
10409
10384
 
10410
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":284
 
10385
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":316
10411
10386
 *     property response:
10412
10387
 * 
10413
10388
 *         def __get__(self):             # <<<<<<<<<<<<<<
10415
10390
 * 
10416
10391
 */
10417
10392
 
10418
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_8response___get__(PyObject *__pyx_v_self); /*proto*/
10419
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_8response___get__(PyObject *__pyx_v_self) {
 
10393
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_8response___get__(PyObject *__pyx_v_self); /*proto*/
 
10394
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_8response___get__(PyObject *__pyx_v_self) {
10420
10395
  PyObject *__pyx_r = NULL;
10421
10396
  PyObject *__pyx_t_1 = NULL;
10422
10397
  PyObject *__pyx_t_2 = NULL;
10423
10398
  PyObject *__pyx_t_3 = NULL;
10424
10399
  __Pyx_RefNannySetupContext("__get__");
10425
10400
 
10426
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":285
 
10401
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":317
10427
10402
 * 
10428
10403
 *         def __get__(self):
10429
10404
 *             return (self.response_code, self.response_code_line)             # <<<<<<<<<<<<<<
10431
10406
 *     property chunked:
10432
10407
 */
10433
10408
  __Pyx_XDECREF(__pyx_r);
10434
 
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__response_code); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10409
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__response_code); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10435
10410
  __Pyx_GOTREF(__pyx_t_1);
10436
 
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__response_code_line); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10411
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__response_code_line); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10437
10412
  __Pyx_GOTREF(__pyx_t_2);
10438
 
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10439
 
  __Pyx_GOTREF(__pyx_t_3);
 
10413
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10414
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
10440
10415
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
10441
10416
  __Pyx_GIVEREF(__pyx_t_1);
10442
10417
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
10443
10418
  __Pyx_GIVEREF(__pyx_t_2);
10444
10419
  __pyx_t_1 = 0;
10445
10420
  __pyx_t_2 = 0;
10446
 
  __pyx_r = __pyx_t_3;
 
10421
  __pyx_r = ((PyObject *)__pyx_t_3);
10447
10422
  __pyx_t_3 = 0;
10448
10423
  goto __pyx_L0;
10449
10424
 
10453
10428
  __Pyx_XDECREF(__pyx_t_1);
10454
10429
  __Pyx_XDECREF(__pyx_t_2);
10455
10430
  __Pyx_XDECREF(__pyx_t_3);
10456
 
  __Pyx_AddTraceback("gevent.core.http_request.response.__get__");
 
10431
  __Pyx_AddTraceback("gevent.core.http_request_base.response.__get__");
10457
10432
  __pyx_r = NULL;
10458
10433
  __pyx_L0:;
10459
10434
  __Pyx_XGIVEREF(__pyx_r);
10461
10436
  return __pyx_r;
10462
10437
}
10463
10438
 
10464
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":289
 
10439
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":321
10465
10440
 *     property chunked:
10466
10441
 * 
10467
10442
 *         def __get__(self):             # <<<<<<<<<<<<<<
10469
10444
 *                 raise HttpRequestDeleted
10470
10445
 */
10471
10446
 
10472
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_7chunked___get__(PyObject *__pyx_v_self); /*proto*/
10473
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_7chunked___get__(PyObject *__pyx_v_self) {
 
10447
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_7chunked___get__(PyObject *__pyx_v_self); /*proto*/
 
10448
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_7chunked___get__(PyObject *__pyx_v_self) {
10474
10449
  PyObject *__pyx_r = NULL;
10475
10450
  int __pyx_t_1;
10476
10451
  PyObject *__pyx_t_2 = NULL;
10477
10452
  __Pyx_RefNannySetupContext("__get__");
10478
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
10479
10453
 
10480
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":290
 
10454
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":322
10481
10455
 * 
10482
10456
 *         def __get__(self):
10483
10457
 *             if not self.__obj:             # <<<<<<<<<<<<<<
10484
10458
 *                 raise HttpRequestDeleted
10485
10459
 *             return self.__obj.chunked
10486
10460
 */
10487
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
10461
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
10488
10462
  if (__pyx_t_1) {
10489
10463
 
10490
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":291
 
10464
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":323
10491
10465
 *         def __get__(self):
10492
10466
 *             if not self.__obj:
10493
10467
 *                 raise HttpRequestDeleted             # <<<<<<<<<<<<<<
10494
10468
 *             return self.__obj.chunked
10495
10469
 * 
10496
10470
 */
10497
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10471
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10498
10472
    __Pyx_GOTREF(__pyx_t_2);
10499
10473
    __Pyx_Raise(__pyx_t_2, 0, 0);
10500
10474
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10501
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10475
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10502
10476
    goto __pyx_L5;
10503
10477
  }
10504
10478
  __pyx_L5:;
10505
10479
 
10506
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":292
 
10480
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":324
10507
10481
 *             if not self.__obj:
10508
10482
 *                 raise HttpRequestDeleted
10509
10483
 *             return self.__obj.chunked             # <<<<<<<<<<<<<<
10511
10485
 *     property input_buffer:
10512
10486
 */
10513
10487
  __Pyx_XDECREF(__pyx_r);
10514
 
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->chunked); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10488
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->chunked); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10515
10489
  __Pyx_GOTREF(__pyx_t_2);
10516
10490
  __pyx_r = __pyx_t_2;
10517
10491
  __pyx_t_2 = 0;
10521
10495
  goto __pyx_L0;
10522
10496
  __pyx_L1_error:;
10523
10497
  __Pyx_XDECREF(__pyx_t_2);
10524
 
  __Pyx_AddTraceback("gevent.core.http_request.chunked.__get__");
 
10498
  __Pyx_AddTraceback("gevent.core.http_request_base.chunked.__get__");
10525
10499
  __pyx_r = NULL;
10526
10500
  __pyx_L0:;
10527
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
10528
10501
  __Pyx_XGIVEREF(__pyx_r);
10529
10502
  __Pyx_RefNannyFinishContext();
10530
10503
  return __pyx_r;
10531
10504
}
10532
10505
 
10533
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":296
 
10506
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":328
10534
10507
 *     property input_buffer:
10535
10508
 * 
10536
10509
 *         def __get__(self):             # <<<<<<<<<<<<<<
10538
10511
 *                 return self._input_buffer
10539
10512
 */
10540
10513
 
10541
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_12input_buffer___get__(PyObject *__pyx_v_self); /*proto*/
10542
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_12input_buffer___get__(PyObject *__pyx_v_self) {
 
10514
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_12input_buffer___get__(PyObject *__pyx_v_self); /*proto*/
 
10515
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_12input_buffer___get__(PyObject *__pyx_v_self) {
10543
10516
  PyObject *__pyx_r = NULL;
10544
10517
  int __pyx_t_1;
10545
10518
  PyObject *__pyx_t_2 = NULL;
10546
10519
  PyObject *__pyx_t_3 = NULL;
10547
10520
  __Pyx_RefNannySetupContext("__get__");
10548
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
10549
10521
 
10550
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":297
 
10522
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":329
10551
10523
 * 
10552
10524
 *         def __get__(self):
10553
10525
 *             if self._input_buffer is not None:             # <<<<<<<<<<<<<<
10554
10526
 *                 return self._input_buffer
10555
10527
 *             if not self.__obj:
10556
10528
 */
10557
 
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_input_buffer != Py_None);
 
10529
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer != Py_None);
10558
10530
  if (__pyx_t_1) {
10559
10531
 
10560
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":298
 
10532
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":330
10561
10533
 *         def __get__(self):
10562
10534
 *             if self._input_buffer is not None:
10563
10535
 *                 return self._input_buffer             # <<<<<<<<<<<<<<
10565
10537
 *                 raise HttpRequestDeleted
10566
10538
 */
10567
10539
    __Pyx_XDECREF(__pyx_r);
10568
 
    __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_input_buffer);
10569
 
    __pyx_r = ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_input_buffer;
 
10540
    __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer);
 
10541
    __pyx_r = ((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer;
10570
10542
    goto __pyx_L0;
10571
10543
    goto __pyx_L5;
10572
10544
  }
10573
10545
  __pyx_L5:;
10574
10546
 
10575
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":299
 
10547
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":331
10576
10548
 *             if self._input_buffer is not None:
10577
10549
 *                 return self._input_buffer
10578
10550
 *             if not self.__obj:             # <<<<<<<<<<<<<<
10579
10551
 *                 raise HttpRequestDeleted
10580
10552
 *             self._input_buffer = buffer(<size_t>self.__obj.input_buffer)
10581
10553
 */
10582
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
10554
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
10583
10555
  if (__pyx_t_1) {
10584
10556
 
10585
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":300
 
10557
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":332
10586
10558
 *                 return self._input_buffer
10587
10559
 *             if not self.__obj:
10588
10560
 *                 raise HttpRequestDeleted             # <<<<<<<<<<<<<<
10589
10561
 *             self._input_buffer = buffer(<size_t>self.__obj.input_buffer)
10590
10562
 *             return self._input_buffer
10591
10563
 */
10592
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10564
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10593
10565
    __Pyx_GOTREF(__pyx_t_2);
10594
10566
    __Pyx_Raise(__pyx_t_2, 0, 0);
10595
10567
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10596
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10568
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10597
10569
    goto __pyx_L6;
10598
10570
  }
10599
10571
  __pyx_L6:;
10600
10572
 
10601
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":301
 
10573
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":333
10602
10574
 *             if not self.__obj:
10603
10575
 *                 raise HttpRequestDeleted
10604
10576
 *             self._input_buffer = buffer(<size_t>self.__obj.input_buffer)             # <<<<<<<<<<<<<<
10605
10577
 *             return self._input_buffer
10606
10578
 * 
10607
10579
 */
10608
 
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(((size_t)((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->input_buffer)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10580
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(((size_t)((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->input_buffer)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10609
10581
  __Pyx_GOTREF(__pyx_t_2);
10610
 
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10611
 
  __Pyx_GOTREF(__pyx_t_3);
 
10582
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10583
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
10612
10584
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
10613
10585
  __Pyx_GIVEREF(__pyx_t_2);
10614
10586
  __pyx_t_2 = 0;
10615
 
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_buffer)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10587
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_buffer)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10616
10588
  __Pyx_GOTREF(__pyx_t_2);
10617
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
10589
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
10618
10590
  __Pyx_GIVEREF(__pyx_t_2);
10619
 
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_input_buffer);
10620
 
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_input_buffer);
10621
 
  ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_input_buffer = __pyx_t_2;
 
10591
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer);
 
10592
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer);
 
10593
  ((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer = __pyx_t_2;
10622
10594
  __pyx_t_2 = 0;
10623
10595
 
10624
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":302
 
10596
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":334
10625
10597
 *                 raise HttpRequestDeleted
10626
10598
 *             self._input_buffer = buffer(<size_t>self.__obj.input_buffer)
10627
10599
 *             return self._input_buffer             # <<<<<<<<<<<<<<
10629
10601
 *     property output_buffer:
10630
10602
 */
10631
10603
  __Pyx_XDECREF(__pyx_r);
10632
 
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_input_buffer);
10633
 
  __pyx_r = ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_input_buffer;
 
10604
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer);
 
10605
  __pyx_r = ((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer;
10634
10606
  goto __pyx_L0;
10635
10607
 
10636
10608
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10638
10610
  __pyx_L1_error:;
10639
10611
  __Pyx_XDECREF(__pyx_t_2);
10640
10612
  __Pyx_XDECREF(__pyx_t_3);
10641
 
  __Pyx_AddTraceback("gevent.core.http_request.input_buffer.__get__");
 
10613
  __Pyx_AddTraceback("gevent.core.http_request_base.input_buffer.__get__");
10642
10614
  __pyx_r = NULL;
10643
10615
  __pyx_L0:;
10644
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
10645
10616
  __Pyx_XGIVEREF(__pyx_r);
10646
10617
  __Pyx_RefNannyFinishContext();
10647
10618
  return __pyx_r;
10648
10619
}
10649
10620
 
10650
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":306
 
10621
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":338
10651
10622
 *     property output_buffer:
10652
10623
 * 
10653
10624
 *         def __get__(self):             # <<<<<<<<<<<<<<
10655
10626
 *                 return self._output_buffer
10656
10627
 */
10657
10628
 
10658
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_13output_buffer___get__(PyObject *__pyx_v_self); /*proto*/
10659
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_13output_buffer___get__(PyObject *__pyx_v_self) {
 
10629
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_13output_buffer___get__(PyObject *__pyx_v_self); /*proto*/
 
10630
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_13output_buffer___get__(PyObject *__pyx_v_self) {
10660
10631
  PyObject *__pyx_r = NULL;
10661
10632
  int __pyx_t_1;
10662
10633
  PyObject *__pyx_t_2 = NULL;
10663
10634
  PyObject *__pyx_t_3 = NULL;
10664
10635
  __Pyx_RefNannySetupContext("__get__");
10665
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
10666
10636
 
10667
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":307
 
10637
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":339
10668
10638
 * 
10669
10639
 *         def __get__(self):
10670
10640
 *             if self._output_buffer is not None:             # <<<<<<<<<<<<<<
10671
10641
 *                 return self._output_buffer
10672
10642
 *             if not self.__obj:
10673
10643
 */
10674
 
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_output_buffer != Py_None);
 
10644
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer != Py_None);
10675
10645
  if (__pyx_t_1) {
10676
10646
 
10677
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":308
 
10647
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":340
10678
10648
 *         def __get__(self):
10679
10649
 *             if self._output_buffer is not None:
10680
10650
 *                 return self._output_buffer             # <<<<<<<<<<<<<<
10682
10652
 *                 raise HttpRequestDeleted
10683
10653
 */
10684
10654
    __Pyx_XDECREF(__pyx_r);
10685
 
    __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_output_buffer);
10686
 
    __pyx_r = ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_output_buffer;
 
10655
    __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer);
 
10656
    __pyx_r = ((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer;
10687
10657
    goto __pyx_L0;
10688
10658
    goto __pyx_L5;
10689
10659
  }
10690
10660
  __pyx_L5:;
10691
10661
 
10692
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":309
 
10662
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":341
10693
10663
 *             if self._output_buffer is not None:
10694
10664
 *                 return self._output_buffer
10695
10665
 *             if not self.__obj:             # <<<<<<<<<<<<<<
10696
10666
 *                 raise HttpRequestDeleted
10697
10667
 *             self._output_buffer = buffer(<size_t>self.__obj.output_buffer)
10698
10668
 */
10699
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
10669
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
10700
10670
  if (__pyx_t_1) {
10701
10671
 
10702
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":310
 
10672
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":342
10703
10673
 *                 return self._output_buffer
10704
10674
 *             if not self.__obj:
10705
10675
 *                 raise HttpRequestDeleted             # <<<<<<<<<<<<<<
10706
10676
 *             self._output_buffer = buffer(<size_t>self.__obj.output_buffer)
10707
10677
 *             return self._output_buffer
10708
10678
 */
10709
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10679
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10710
10680
    __Pyx_GOTREF(__pyx_t_2);
10711
10681
    __Pyx_Raise(__pyx_t_2, 0, 0);
10712
10682
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10713
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10683
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10714
10684
    goto __pyx_L6;
10715
10685
  }
10716
10686
  __pyx_L6:;
10717
10687
 
10718
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":311
 
10688
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":343
10719
10689
 *             if not self.__obj:
10720
10690
 *                 raise HttpRequestDeleted
10721
10691
 *             self._output_buffer = buffer(<size_t>self.__obj.output_buffer)             # <<<<<<<<<<<<<<
10722
10692
 *             return self._output_buffer
10723
10693
 * 
10724
10694
 */
10725
 
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(((size_t)((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->output_buffer)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10695
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(((size_t)((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->output_buffer)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10726
10696
  __Pyx_GOTREF(__pyx_t_2);
10727
 
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10728
 
  __Pyx_GOTREF(__pyx_t_3);
 
10697
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10698
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
10729
10699
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
10730
10700
  __Pyx_GIVEREF(__pyx_t_2);
10731
10701
  __pyx_t_2 = 0;
10732
 
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_buffer)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10702
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_buffer)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10733
10703
  __Pyx_GOTREF(__pyx_t_2);
10734
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
10704
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
10735
10705
  __Pyx_GIVEREF(__pyx_t_2);
10736
 
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_output_buffer);
10737
 
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_output_buffer);
10738
 
  ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_output_buffer = __pyx_t_2;
 
10706
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer);
 
10707
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer);
 
10708
  ((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer = __pyx_t_2;
10739
10709
  __pyx_t_2 = 0;
10740
10710
 
10741
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":312
 
10711
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":344
10742
10712
 *                 raise HttpRequestDeleted
10743
10713
 *             self._output_buffer = buffer(<size_t>self.__obj.output_buffer)
10744
10714
 *             return self._output_buffer             # <<<<<<<<<<<<<<
10745
10715
 * 
 
10716
 *     def find_input_header(self, char* key):
 
10717
 */
 
10718
  __Pyx_XDECREF(__pyx_r);
 
10719
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer);
 
10720
  __pyx_r = ((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer;
 
10721
  goto __pyx_L0;
 
10722
 
 
10723
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
10724
  goto __pyx_L0;
 
10725
  __pyx_L1_error:;
 
10726
  __Pyx_XDECREF(__pyx_t_2);
 
10727
  __Pyx_XDECREF(__pyx_t_3);
 
10728
  __Pyx_AddTraceback("gevent.core.http_request_base.output_buffer.__get__");
 
10729
  __pyx_r = NULL;
 
10730
  __pyx_L0:;
 
10731
  __Pyx_XGIVEREF(__pyx_r);
 
10732
  __Pyx_RefNannyFinishContext();
 
10733
  return __pyx_r;
 
10734
}
 
10735
 
 
10736
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":346
 
10737
 *             return self._output_buffer
 
10738
 * 
 
10739
 *     def find_input_header(self, char* key):             # <<<<<<<<<<<<<<
 
10740
 *         if not self.__obj:
 
10741
 *             raise HttpRequestDeleted
 
10742
 */
 
10743
 
 
10744
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_7find_input_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_key); /*proto*/
 
10745
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_7find_input_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_key) {
 
10746
  char *__pyx_v_key;
 
10747
  const char* __pyx_v_val;
 
10748
  PyObject *__pyx_r = NULL;
 
10749
  int __pyx_t_1;
 
10750
  PyObject *__pyx_t_2 = NULL;
 
10751
  __Pyx_RefNannySetupContext("find_input_header");
 
10752
  assert(__pyx_arg_key); {
 
10753
    __pyx_v_key = PyBytes_AsString(__pyx_arg_key); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
10754
  }
 
10755
  goto __pyx_L4_argument_unpacking_done;
 
10756
  __pyx_L3_error:;
 
10757
  __Pyx_AddTraceback("gevent.core.http_request_base.find_input_header");
 
10758
  __Pyx_RefNannyFinishContext();
 
10759
  return NULL;
 
10760
  __pyx_L4_argument_unpacking_done:;
 
10761
 
 
10762
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":347
 
10763
 * 
 
10764
 *     def find_input_header(self, char* key):
 
10765
 *         if not self.__obj:             # <<<<<<<<<<<<<<
 
10766
 *             raise HttpRequestDeleted
 
10767
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.input_headers, key)
 
10768
 */
 
10769
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
 
10770
  if (__pyx_t_1) {
 
10771
 
 
10772
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":348
 
10773
 *     def find_input_header(self, char* key):
 
10774
 *         if not self.__obj:
 
10775
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
 
10776
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.input_headers, key)
 
10777
 *         if val:
 
10778
 */
 
10779
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10780
    __Pyx_GOTREF(__pyx_t_2);
 
10781
    __Pyx_Raise(__pyx_t_2, 0, 0);
 
10782
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
10783
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10784
    goto __pyx_L5;
 
10785
  }
 
10786
  __pyx_L5:;
 
10787
 
 
10788
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":349
 
10789
 *         if not self.__obj:
 
10790
 *             raise HttpRequestDeleted
 
10791
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.input_headers, key)             # <<<<<<<<<<<<<<
 
10792
 *         if val:
 
10793
 *             return val
 
10794
 */
 
10795
  __pyx_v_val = evhttp_find_header(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->input_headers, __pyx_v_key);
 
10796
 
 
10797
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":350
 
10798
 *             raise HttpRequestDeleted
 
10799
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.input_headers, key)
 
10800
 *         if val:             # <<<<<<<<<<<<<<
 
10801
 *             return val
 
10802
 * 
 
10803
 */
 
10804
  __pyx_t_1 = (__pyx_v_val != 0);
 
10805
  if (__pyx_t_1) {
 
10806
 
 
10807
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":351
 
10808
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.input_headers, key)
 
10809
 *         if val:
 
10810
 *             return val             # <<<<<<<<<<<<<<
 
10811
 * 
 
10812
 *     def find_output_header(self, char* key):
 
10813
 */
 
10814
    __Pyx_XDECREF(__pyx_r);
 
10815
    __pyx_t_2 = PyBytes_FromString(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10816
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
 
10817
    __pyx_r = ((PyObject *)__pyx_t_2);
 
10818
    __pyx_t_2 = 0;
 
10819
    goto __pyx_L0;
 
10820
    goto __pyx_L6;
 
10821
  }
 
10822
  __pyx_L6:;
 
10823
 
 
10824
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
10825
  goto __pyx_L0;
 
10826
  __pyx_L1_error:;
 
10827
  __Pyx_XDECREF(__pyx_t_2);
 
10828
  __Pyx_AddTraceback("gevent.core.http_request_base.find_input_header");
 
10829
  __pyx_r = NULL;
 
10830
  __pyx_L0:;
 
10831
  __Pyx_XGIVEREF(__pyx_r);
 
10832
  __Pyx_RefNannyFinishContext();
 
10833
  return __pyx_r;
 
10834
}
 
10835
 
 
10836
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":353
 
10837
 *             return val
 
10838
 * 
 
10839
 *     def find_output_header(self, char* key):             # <<<<<<<<<<<<<<
 
10840
 *         if not self.__obj:
 
10841
 *             raise HttpRequestDeleted
 
10842
 */
 
10843
 
 
10844
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_8find_output_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_key); /*proto*/
 
10845
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_8find_output_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_key) {
 
10846
  char *__pyx_v_key;
 
10847
  const char* __pyx_v_val;
 
10848
  PyObject *__pyx_r = NULL;
 
10849
  int __pyx_t_1;
 
10850
  PyObject *__pyx_t_2 = NULL;
 
10851
  __Pyx_RefNannySetupContext("find_output_header");
 
10852
  assert(__pyx_arg_key); {
 
10853
    __pyx_v_key = PyBytes_AsString(__pyx_arg_key); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
10854
  }
 
10855
  goto __pyx_L4_argument_unpacking_done;
 
10856
  __pyx_L3_error:;
 
10857
  __Pyx_AddTraceback("gevent.core.http_request_base.find_output_header");
 
10858
  __Pyx_RefNannyFinishContext();
 
10859
  return NULL;
 
10860
  __pyx_L4_argument_unpacking_done:;
 
10861
 
 
10862
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":354
 
10863
 * 
 
10864
 *     def find_output_header(self, char* key):
 
10865
 *         if not self.__obj:             # <<<<<<<<<<<<<<
 
10866
 *             raise HttpRequestDeleted
 
10867
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.output_headers, key)
 
10868
 */
 
10869
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
 
10870
  if (__pyx_t_1) {
 
10871
 
 
10872
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":355
 
10873
 *     def find_output_header(self, char* key):
 
10874
 *         if not self.__obj:
 
10875
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
 
10876
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.output_headers, key)
 
10877
 *         if val:
 
10878
 */
 
10879
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10880
    __Pyx_GOTREF(__pyx_t_2);
 
10881
    __Pyx_Raise(__pyx_t_2, 0, 0);
 
10882
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
10883
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10884
    goto __pyx_L5;
 
10885
  }
 
10886
  __pyx_L5:;
 
10887
 
 
10888
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":356
 
10889
 *         if not self.__obj:
 
10890
 *             raise HttpRequestDeleted
 
10891
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.output_headers, key)             # <<<<<<<<<<<<<<
 
10892
 *         if val:
 
10893
 *             return val
 
10894
 */
 
10895
  __pyx_v_val = evhttp_find_header(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->output_headers, __pyx_v_key);
 
10896
 
 
10897
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":357
 
10898
 *             raise HttpRequestDeleted
 
10899
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.output_headers, key)
 
10900
 *         if val:             # <<<<<<<<<<<<<<
 
10901
 *             return val
 
10902
 * 
 
10903
 */
 
10904
  __pyx_t_1 = (__pyx_v_val != 0);
 
10905
  if (__pyx_t_1) {
 
10906
 
 
10907
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":358
 
10908
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.output_headers, key)
 
10909
 *         if val:
 
10910
 *             return val             # <<<<<<<<<<<<<<
 
10911
 * 
 
10912
 *     def add_input_header(self, char* key, char* value):
 
10913
 */
 
10914
    __Pyx_XDECREF(__pyx_r);
 
10915
    __pyx_t_2 = PyBytes_FromString(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
10916
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
 
10917
    __pyx_r = ((PyObject *)__pyx_t_2);
 
10918
    __pyx_t_2 = 0;
 
10919
    goto __pyx_L0;
 
10920
    goto __pyx_L6;
 
10921
  }
 
10922
  __pyx_L6:;
 
10923
 
 
10924
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
10925
  goto __pyx_L0;
 
10926
  __pyx_L1_error:;
 
10927
  __Pyx_XDECREF(__pyx_t_2);
 
10928
  __Pyx_AddTraceback("gevent.core.http_request_base.find_output_header");
 
10929
  __pyx_r = NULL;
 
10930
  __pyx_L0:;
 
10931
  __Pyx_XGIVEREF(__pyx_r);
 
10932
  __Pyx_RefNannyFinishContext();
 
10933
  return __pyx_r;
 
10934
}
 
10935
 
 
10936
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":360
 
10937
 *             return val
 
10938
 * 
 
10939
 *     def add_input_header(self, char* key, char* value):             # <<<<<<<<<<<<<<
 
10940
 *         if not self.__obj:
 
10941
 *             raise HttpRequestDeleted
 
10942
 */
 
10943
 
 
10944
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_9add_input_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
10945
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_9add_input_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
10946
  char *__pyx_v_key;
 
10947
  char *__pyx_v_value;
 
10948
  PyObject *__pyx_r = NULL;
 
10949
  int __pyx_t_1;
 
10950
  PyObject *__pyx_t_2 = NULL;
 
10951
  int __pyx_t_3;
 
10952
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__value,0};
 
10953
  __Pyx_RefNannySetupContext("add_input_header");
 
10954
  if (unlikely(__pyx_kwds)) {
 
10955
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
 
10956
    PyObject* values[2] = {0,0};
 
10957
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
10958
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
 
10959
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
 
10960
      case  0: break;
 
10961
      default: goto __pyx_L5_argtuple_error;
 
10962
    }
 
10963
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
10964
      case  0:
 
10965
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
 
10966
      if (likely(values[0])) kw_args--;
 
10967
      else goto __pyx_L5_argtuple_error;
 
10968
      case  1:
 
10969
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
 
10970
      if (likely(values[1])) kw_args--;
 
10971
      else {
 
10972
        __Pyx_RaiseArgtupleInvalid("add_input_header", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
10973
      }
 
10974
    }
 
10975
    if (unlikely(kw_args > 0)) {
 
10976
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add_input_header") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
10977
    }
 
10978
    __pyx_v_key = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
10979
    __pyx_v_value = PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_value) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
10980
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
 
10981
    goto __pyx_L5_argtuple_error;
 
10982
  } else {
 
10983
    __pyx_v_key = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
10984
    __pyx_v_value = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((!__pyx_v_value) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
10985
  }
 
10986
  goto __pyx_L4_argument_unpacking_done;
 
10987
  __pyx_L5_argtuple_error:;
 
10988
  __Pyx_RaiseArgtupleInvalid("add_input_header", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
10989
  __pyx_L3_error:;
 
10990
  __Pyx_AddTraceback("gevent.core.http_request_base.add_input_header");
 
10991
  __Pyx_RefNannyFinishContext();
 
10992
  return NULL;
 
10993
  __pyx_L4_argument_unpacking_done:;
 
10994
 
 
10995
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":361
 
10996
 * 
 
10997
 *     def add_input_header(self, char* key, char* value):
 
10998
 *         if not self.__obj:             # <<<<<<<<<<<<<<
 
10999
 *             raise HttpRequestDeleted
 
11000
 *         if evhttp_add_header(self.__obj.input_headers, key, value):
 
11001
 */
 
11002
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
 
11003
  if (__pyx_t_1) {
 
11004
 
 
11005
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":362
 
11006
 *     def add_input_header(self, char* key, char* value):
 
11007
 *         if not self.__obj:
 
11008
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
 
11009
 *         if evhttp_add_header(self.__obj.input_headers, key, value):
 
11010
 *             raise RuntimeError('Internal error in evhttp_add_header')
 
11011
 */
 
11012
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11013
    __Pyx_GOTREF(__pyx_t_2);
 
11014
    __Pyx_Raise(__pyx_t_2, 0, 0);
 
11015
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
11016
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11017
    goto __pyx_L6;
 
11018
  }
 
11019
  __pyx_L6:;
 
11020
 
 
11021
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":363
 
11022
 *         if not self.__obj:
 
11023
 *             raise HttpRequestDeleted
 
11024
 *         if evhttp_add_header(self.__obj.input_headers, key, value):             # <<<<<<<<<<<<<<
 
11025
 *             raise RuntimeError('Internal error in evhttp_add_header')
 
11026
 * 
 
11027
 */
 
11028
  __pyx_t_3 = evhttp_add_header(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->input_headers, __pyx_v_key, __pyx_v_value);
 
11029
  if (__pyx_t_3) {
 
11030
 
 
11031
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":364
 
11032
 *             raise HttpRequestDeleted
 
11033
 *         if evhttp_add_header(self.__obj.input_headers, key, value):
 
11034
 *             raise RuntimeError('Internal error in evhttp_add_header')             # <<<<<<<<<<<<<<
 
11035
 * 
 
11036
 *     def add_output_header(self, char* key, char* value):
 
11037
 */
 
11038
    __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_30), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11039
    __Pyx_GOTREF(__pyx_t_2);
 
11040
    __Pyx_Raise(__pyx_t_2, 0, 0);
 
11041
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
11042
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11043
    goto __pyx_L7;
 
11044
  }
 
11045
  __pyx_L7:;
 
11046
 
 
11047
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
11048
  goto __pyx_L0;
 
11049
  __pyx_L1_error:;
 
11050
  __Pyx_XDECREF(__pyx_t_2);
 
11051
  __Pyx_AddTraceback("gevent.core.http_request_base.add_input_header");
 
11052
  __pyx_r = NULL;
 
11053
  __pyx_L0:;
 
11054
  __Pyx_XGIVEREF(__pyx_r);
 
11055
  __Pyx_RefNannyFinishContext();
 
11056
  return __pyx_r;
 
11057
}
 
11058
 
 
11059
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":366
 
11060
 *             raise RuntimeError('Internal error in evhttp_add_header')
 
11061
 * 
 
11062
 *     def add_output_header(self, char* key, char* value):             # <<<<<<<<<<<<<<
 
11063
 *         if not self.__obj:
 
11064
 *             raise HttpRequestDeleted
 
11065
 */
 
11066
 
 
11067
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_10add_output_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
11068
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_10add_output_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
11069
  char *__pyx_v_key;
 
11070
  char *__pyx_v_value;
 
11071
  PyObject *__pyx_r = NULL;
 
11072
  int __pyx_t_1;
 
11073
  PyObject *__pyx_t_2 = NULL;
 
11074
  int __pyx_t_3;
 
11075
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__value,0};
 
11076
  __Pyx_RefNannySetupContext("add_output_header");
 
11077
  if (unlikely(__pyx_kwds)) {
 
11078
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
 
11079
    PyObject* values[2] = {0,0};
 
11080
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
11081
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
 
11082
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
 
11083
      case  0: break;
 
11084
      default: goto __pyx_L5_argtuple_error;
 
11085
    }
 
11086
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
11087
      case  0:
 
11088
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
 
11089
      if (likely(values[0])) kw_args--;
 
11090
      else goto __pyx_L5_argtuple_error;
 
11091
      case  1:
 
11092
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
 
11093
      if (likely(values[1])) kw_args--;
 
11094
      else {
 
11095
        __Pyx_RaiseArgtupleInvalid("add_output_header", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11096
      }
 
11097
    }
 
11098
    if (unlikely(kw_args > 0)) {
 
11099
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add_output_header") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11100
    }
 
11101
    __pyx_v_key = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11102
    __pyx_v_value = PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_value) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11103
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
 
11104
    goto __pyx_L5_argtuple_error;
 
11105
  } else {
 
11106
    __pyx_v_key = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11107
    __pyx_v_value = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((!__pyx_v_value) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11108
  }
 
11109
  goto __pyx_L4_argument_unpacking_done;
 
11110
  __pyx_L5_argtuple_error:;
 
11111
  __Pyx_RaiseArgtupleInvalid("add_output_header", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11112
  __pyx_L3_error:;
 
11113
  __Pyx_AddTraceback("gevent.core.http_request_base.add_output_header");
 
11114
  __Pyx_RefNannyFinishContext();
 
11115
  return NULL;
 
11116
  __pyx_L4_argument_unpacking_done:;
 
11117
 
 
11118
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":367
 
11119
 * 
 
11120
 *     def add_output_header(self, char* key, char* value):
 
11121
 *         if not self.__obj:             # <<<<<<<<<<<<<<
 
11122
 *             raise HttpRequestDeleted
 
11123
 *         if evhttp_add_header(self.__obj.output_headers, key, value):
 
11124
 */
 
11125
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
 
11126
  if (__pyx_t_1) {
 
11127
 
 
11128
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":368
 
11129
 *     def add_output_header(self, char* key, char* value):
 
11130
 *         if not self.__obj:
 
11131
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
 
11132
 *         if evhttp_add_header(self.__obj.output_headers, key, value):
 
11133
 *             raise RuntimeError('Internal error in evhttp_add_header')
 
11134
 */
 
11135
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11136
    __Pyx_GOTREF(__pyx_t_2);
 
11137
    __Pyx_Raise(__pyx_t_2, 0, 0);
 
11138
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
11139
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11140
    goto __pyx_L6;
 
11141
  }
 
11142
  __pyx_L6:;
 
11143
 
 
11144
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":369
 
11145
 *         if not self.__obj:
 
11146
 *             raise HttpRequestDeleted
 
11147
 *         if evhttp_add_header(self.__obj.output_headers, key, value):             # <<<<<<<<<<<<<<
 
11148
 *             raise RuntimeError('Internal error in evhttp_add_header')
 
11149
 * 
 
11150
 */
 
11151
  __pyx_t_3 = evhttp_add_header(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->output_headers, __pyx_v_key, __pyx_v_value);
 
11152
  if (__pyx_t_3) {
 
11153
 
 
11154
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":370
 
11155
 *             raise HttpRequestDeleted
 
11156
 *         if evhttp_add_header(self.__obj.output_headers, key, value):
 
11157
 *             raise RuntimeError('Internal error in evhttp_add_header')             # <<<<<<<<<<<<<<
 
11158
 * 
 
11159
 *     def remove_input_header(self, char* key):
 
11160
 */
 
11161
    __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_31), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11162
    __Pyx_GOTREF(__pyx_t_2);
 
11163
    __Pyx_Raise(__pyx_t_2, 0, 0);
 
11164
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
11165
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11166
    goto __pyx_L7;
 
11167
  }
 
11168
  __pyx_L7:;
 
11169
 
 
11170
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
11171
  goto __pyx_L0;
 
11172
  __pyx_L1_error:;
 
11173
  __Pyx_XDECREF(__pyx_t_2);
 
11174
  __Pyx_AddTraceback("gevent.core.http_request_base.add_output_header");
 
11175
  __pyx_r = NULL;
 
11176
  __pyx_L0:;
 
11177
  __Pyx_XGIVEREF(__pyx_r);
 
11178
  __Pyx_RefNannyFinishContext();
 
11179
  return __pyx_r;
 
11180
}
 
11181
 
 
11182
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":372
 
11183
 *             raise RuntimeError('Internal error in evhttp_add_header')
 
11184
 * 
 
11185
 *     def remove_input_header(self, char* key):             # <<<<<<<<<<<<<<
 
11186
 *         """Return True if header was found and removed"""
 
11187
 *         if not self.__obj:
 
11188
 */
 
11189
 
 
11190
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_11remove_input_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_key); /*proto*/
 
11191
static char __pyx_doc_6gevent_4core_17http_request_base_11remove_input_header[] = "Return True if header was found and removed";
 
11192
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_11remove_input_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_key) {
 
11193
  char *__pyx_v_key;
 
11194
  PyObject *__pyx_r = NULL;
 
11195
  int __pyx_t_1;
 
11196
  PyObject *__pyx_t_2 = NULL;
 
11197
  __Pyx_RefNannySetupContext("remove_input_header");
 
11198
  assert(__pyx_arg_key); {
 
11199
    __pyx_v_key = PyBytes_AsString(__pyx_arg_key); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11200
  }
 
11201
  goto __pyx_L4_argument_unpacking_done;
 
11202
  __pyx_L3_error:;
 
11203
  __Pyx_AddTraceback("gevent.core.http_request_base.remove_input_header");
 
11204
  __Pyx_RefNannyFinishContext();
 
11205
  return NULL;
 
11206
  __pyx_L4_argument_unpacking_done:;
 
11207
 
 
11208
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":374
 
11209
 *     def remove_input_header(self, char* key):
 
11210
 *         """Return True if header was found and removed"""
 
11211
 *         if not self.__obj:             # <<<<<<<<<<<<<<
 
11212
 *             raise HttpRequestDeleted
 
11213
 *         return True if 0 == evhttp_remove_header(self.__obj.input_headers, key) else False
 
11214
 */
 
11215
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
 
11216
  if (__pyx_t_1) {
 
11217
 
 
11218
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":375
 
11219
 *         """Return True if header was found and removed"""
 
11220
 *         if not self.__obj:
 
11221
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
 
11222
 *         return True if 0 == evhttp_remove_header(self.__obj.input_headers, key) else False
 
11223
 * 
 
11224
 */
 
11225
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11226
    __Pyx_GOTREF(__pyx_t_2);
 
11227
    __Pyx_Raise(__pyx_t_2, 0, 0);
 
11228
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
11229
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11230
    goto __pyx_L5;
 
11231
  }
 
11232
  __pyx_L5:;
 
11233
 
 
11234
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":376
 
11235
 *         if not self.__obj:
 
11236
 *             raise HttpRequestDeleted
 
11237
 *         return True if 0 == evhttp_remove_header(self.__obj.input_headers, key) else False             # <<<<<<<<<<<<<<
 
11238
 * 
 
11239
 *     def remove_output_header(self, char* key):
 
11240
 */
 
11241
  __Pyx_XDECREF(__pyx_r);
 
11242
  if ((0 == evhttp_remove_header(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->input_headers, __pyx_v_key))) {
 
11243
    __pyx_t_1 = 1;
 
11244
  } else {
 
11245
    __pyx_t_1 = 0;
 
11246
  }
 
11247
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11248
  __Pyx_GOTREF(__pyx_t_2);
 
11249
  __pyx_r = __pyx_t_2;
 
11250
  __pyx_t_2 = 0;
 
11251
  goto __pyx_L0;
 
11252
 
 
11253
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
11254
  goto __pyx_L0;
 
11255
  __pyx_L1_error:;
 
11256
  __Pyx_XDECREF(__pyx_t_2);
 
11257
  __Pyx_AddTraceback("gevent.core.http_request_base.remove_input_header");
 
11258
  __pyx_r = NULL;
 
11259
  __pyx_L0:;
 
11260
  __Pyx_XGIVEREF(__pyx_r);
 
11261
  __Pyx_RefNannyFinishContext();
 
11262
  return __pyx_r;
 
11263
}
 
11264
 
 
11265
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":378
 
11266
 *         return True if 0 == evhttp_remove_header(self.__obj.input_headers, key) else False
 
11267
 * 
 
11268
 *     def remove_output_header(self, char* key):             # <<<<<<<<<<<<<<
 
11269
 *         """Return True if header was found and removed"""
 
11270
 *         if not self.__obj:
 
11271
 */
 
11272
 
 
11273
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_12remove_output_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_key); /*proto*/
 
11274
static char __pyx_doc_6gevent_4core_17http_request_base_12remove_output_header[] = "Return True if header was found and removed";
 
11275
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_12remove_output_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_key) {
 
11276
  char *__pyx_v_key;
 
11277
  PyObject *__pyx_r = NULL;
 
11278
  int __pyx_t_1;
 
11279
  PyObject *__pyx_t_2 = NULL;
 
11280
  __Pyx_RefNannySetupContext("remove_output_header");
 
11281
  assert(__pyx_arg_key); {
 
11282
    __pyx_v_key = PyBytes_AsString(__pyx_arg_key); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11283
  }
 
11284
  goto __pyx_L4_argument_unpacking_done;
 
11285
  __pyx_L3_error:;
 
11286
  __Pyx_AddTraceback("gevent.core.http_request_base.remove_output_header");
 
11287
  __Pyx_RefNannyFinishContext();
 
11288
  return NULL;
 
11289
  __pyx_L4_argument_unpacking_done:;
 
11290
 
 
11291
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":380
 
11292
 *     def remove_output_header(self, char* key):
 
11293
 *         """Return True if header was found and removed"""
 
11294
 *         if not self.__obj:             # <<<<<<<<<<<<<<
 
11295
 *             raise HttpRequestDeleted
 
11296
 *         return True if 0 == evhttp_remove_header(self.__obj.output_headers, key) else False
 
11297
 */
 
11298
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
 
11299
  if (__pyx_t_1) {
 
11300
 
 
11301
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":381
 
11302
 *         """Return True if header was found and removed"""
 
11303
 *         if not self.__obj:
 
11304
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
 
11305
 *         return True if 0 == evhttp_remove_header(self.__obj.output_headers, key) else False
 
11306
 * 
 
11307
 */
 
11308
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11309
    __Pyx_GOTREF(__pyx_t_2);
 
11310
    __Pyx_Raise(__pyx_t_2, 0, 0);
 
11311
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
11312
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11313
    goto __pyx_L5;
 
11314
  }
 
11315
  __pyx_L5:;
 
11316
 
 
11317
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":382
 
11318
 *         if not self.__obj:
 
11319
 *             raise HttpRequestDeleted
 
11320
 *         return True if 0 == evhttp_remove_header(self.__obj.output_headers, key) else False             # <<<<<<<<<<<<<<
 
11321
 * 
 
11322
 *     def clear_input_headers(self):
 
11323
 */
 
11324
  __Pyx_XDECREF(__pyx_r);
 
11325
  if ((0 == evhttp_remove_header(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->output_headers, __pyx_v_key))) {
 
11326
    __pyx_t_1 = 1;
 
11327
  } else {
 
11328
    __pyx_t_1 = 0;
 
11329
  }
 
11330
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11331
  __Pyx_GOTREF(__pyx_t_2);
 
11332
  __pyx_r = __pyx_t_2;
 
11333
  __pyx_t_2 = 0;
 
11334
  goto __pyx_L0;
 
11335
 
 
11336
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
11337
  goto __pyx_L0;
 
11338
  __pyx_L1_error:;
 
11339
  __Pyx_XDECREF(__pyx_t_2);
 
11340
  __Pyx_AddTraceback("gevent.core.http_request_base.remove_output_header");
 
11341
  __pyx_r = NULL;
 
11342
  __pyx_L0:;
 
11343
  __Pyx_XGIVEREF(__pyx_r);
 
11344
  __Pyx_RefNannyFinishContext();
 
11345
  return __pyx_r;
 
11346
}
 
11347
 
 
11348
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":384
 
11349
 *         return True if 0 == evhttp_remove_header(self.__obj.output_headers, key) else False
 
11350
 * 
 
11351
 *     def clear_input_headers(self):             # <<<<<<<<<<<<<<
 
11352
 *         if not self.__obj:
 
11353
 *             raise HttpRequestDeleted
 
11354
 */
 
11355
 
 
11356
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_13clear_input_headers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
11357
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_13clear_input_headers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
 
11358
  PyObject *__pyx_r = NULL;
 
11359
  int __pyx_t_1;
 
11360
  PyObject *__pyx_t_2 = NULL;
 
11361
  __Pyx_RefNannySetupContext("clear_input_headers");
 
11362
 
 
11363
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":385
 
11364
 * 
 
11365
 *     def clear_input_headers(self):
 
11366
 *         if not self.__obj:             # <<<<<<<<<<<<<<
 
11367
 *             raise HttpRequestDeleted
 
11368
 *         evhttp_clear_headers(self.__obj.input_headers)
 
11369
 */
 
11370
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
 
11371
  if (__pyx_t_1) {
 
11372
 
 
11373
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":386
 
11374
 *     def clear_input_headers(self):
 
11375
 *         if not self.__obj:
 
11376
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
 
11377
 *         evhttp_clear_headers(self.__obj.input_headers)
 
11378
 * 
 
11379
 */
 
11380
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11381
    __Pyx_GOTREF(__pyx_t_2);
 
11382
    __Pyx_Raise(__pyx_t_2, 0, 0);
 
11383
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
11384
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11385
    goto __pyx_L5;
 
11386
  }
 
11387
  __pyx_L5:;
 
11388
 
 
11389
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":387
 
11390
 *         if not self.__obj:
 
11391
 *             raise HttpRequestDeleted
 
11392
 *         evhttp_clear_headers(self.__obj.input_headers)             # <<<<<<<<<<<<<<
 
11393
 * 
 
11394
 *     def clear_output_headers(self):
 
11395
 */
 
11396
  evhttp_clear_headers(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->input_headers);
 
11397
 
 
11398
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
11399
  goto __pyx_L0;
 
11400
  __pyx_L1_error:;
 
11401
  __Pyx_XDECREF(__pyx_t_2);
 
11402
  __Pyx_AddTraceback("gevent.core.http_request_base.clear_input_headers");
 
11403
  __pyx_r = NULL;
 
11404
  __pyx_L0:;
 
11405
  __Pyx_XGIVEREF(__pyx_r);
 
11406
  __Pyx_RefNannyFinishContext();
 
11407
  return __pyx_r;
 
11408
}
 
11409
 
 
11410
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":389
 
11411
 *         evhttp_clear_headers(self.__obj.input_headers)
 
11412
 * 
 
11413
 *     def clear_output_headers(self):             # <<<<<<<<<<<<<<
 
11414
 *         if not self.__obj:
 
11415
 *             raise HttpRequestDeleted
 
11416
 */
 
11417
 
 
11418
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_14clear_output_headers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
11419
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_14clear_output_headers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
 
11420
  PyObject *__pyx_r = NULL;
 
11421
  int __pyx_t_1;
 
11422
  PyObject *__pyx_t_2 = NULL;
 
11423
  __Pyx_RefNannySetupContext("clear_output_headers");
 
11424
 
 
11425
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":390
 
11426
 * 
 
11427
 *     def clear_output_headers(self):
 
11428
 *         if not self.__obj:             # <<<<<<<<<<<<<<
 
11429
 *             raise HttpRequestDeleted
 
11430
 *         evhttp_clear_headers(self.__obj.output_headers)
 
11431
 */
 
11432
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj != 0));
 
11433
  if (__pyx_t_1) {
 
11434
 
 
11435
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":391
 
11436
 *     def clear_output_headers(self):
 
11437
 *         if not self.__obj:
 
11438
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
 
11439
 *         evhttp_clear_headers(self.__obj.output_headers)
 
11440
 * 
 
11441
 */
 
11442
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11443
    __Pyx_GOTREF(__pyx_t_2);
 
11444
    __Pyx_Raise(__pyx_t_2, 0, 0);
 
11445
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
11446
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11447
    goto __pyx_L5;
 
11448
  }
 
11449
  __pyx_L5:;
 
11450
 
 
11451
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":392
 
11452
 *         if not self.__obj:
 
11453
 *             raise HttpRequestDeleted
 
11454
 *         evhttp_clear_headers(self.__obj.output_headers)             # <<<<<<<<<<<<<<
 
11455
 * 
 
11456
 * 
 
11457
 */
 
11458
  evhttp_clear_headers(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->__pyx___obj->output_headers);
 
11459
 
 
11460
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
11461
  goto __pyx_L0;
 
11462
  __pyx_L1_error:;
 
11463
  __Pyx_XDECREF(__pyx_t_2);
 
11464
  __Pyx_AddTraceback("gevent.core.http_request_base.clear_output_headers");
 
11465
  __pyx_r = NULL;
 
11466
  __pyx_L0:;
 
11467
  __Pyx_XGIVEREF(__pyx_r);
 
11468
  __Pyx_RefNannyFinishContext();
 
11469
  return __pyx_r;
 
11470
}
 
11471
 
 
11472
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":152
 
11473
 *     cdef object __weakref__
 
11474
 *     cdef evhttp_request* __obj
 
11475
 *     cdef public object _input_buffer             # <<<<<<<<<<<<<<
 
11476
 *     cdef public object _output_buffer
 
11477
 * 
 
11478
 */
 
11479
 
 
11480
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_13_input_buffer___get__(PyObject *__pyx_v_self); /*proto*/
 
11481
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_13_input_buffer___get__(PyObject *__pyx_v_self) {
 
11482
  PyObject *__pyx_r = NULL;
 
11483
  __Pyx_RefNannySetupContext("__get__");
 
11484
  __Pyx_XDECREF(__pyx_r);
 
11485
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer);
 
11486
  __pyx_r = ((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer;
 
11487
  goto __pyx_L0;
 
11488
 
 
11489
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
11490
  __pyx_L0:;
 
11491
  __Pyx_XGIVEREF(__pyx_r);
 
11492
  __Pyx_RefNannyFinishContext();
 
11493
  return __pyx_r;
 
11494
}
 
11495
 
 
11496
static int __pyx_pf_6gevent_4core_17http_request_base_13_input_buffer_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
 
11497
static int __pyx_pf_6gevent_4core_17http_request_base_13_input_buffer_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
 
11498
  int __pyx_r;
 
11499
  __Pyx_RefNannySetupContext("__set__");
 
11500
  __Pyx_INCREF(__pyx_v_value);
 
11501
  __Pyx_GIVEREF(__pyx_v_value);
 
11502
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer);
 
11503
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer);
 
11504
  ((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer = __pyx_v_value;
 
11505
 
 
11506
  __pyx_r = 0;
 
11507
  __Pyx_RefNannyFinishContext();
 
11508
  return __pyx_r;
 
11509
}
 
11510
 
 
11511
static int __pyx_pf_6gevent_4core_17http_request_base_13_input_buffer_2__del__(PyObject *__pyx_v_self); /*proto*/
 
11512
static int __pyx_pf_6gevent_4core_17http_request_base_13_input_buffer_2__del__(PyObject *__pyx_v_self) {
 
11513
  int __pyx_r;
 
11514
  __Pyx_RefNannySetupContext("__del__");
 
11515
  __Pyx_INCREF(Py_None);
 
11516
  __Pyx_GIVEREF(Py_None);
 
11517
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer);
 
11518
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer);
 
11519
  ((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_input_buffer = Py_None;
 
11520
 
 
11521
  __pyx_r = 0;
 
11522
  __Pyx_RefNannyFinishContext();
 
11523
  return __pyx_r;
 
11524
}
 
11525
 
 
11526
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":153
 
11527
 *     cdef evhttp_request* __obj
 
11528
 *     cdef public object _input_buffer
 
11529
 *     cdef public object _output_buffer             # <<<<<<<<<<<<<<
 
11530
 * 
 
11531
 *     def __init__(self, size_t obj):
 
11532
 */
 
11533
 
 
11534
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_14_output_buffer___get__(PyObject *__pyx_v_self); /*proto*/
 
11535
static PyObject *__pyx_pf_6gevent_4core_17http_request_base_14_output_buffer___get__(PyObject *__pyx_v_self) {
 
11536
  PyObject *__pyx_r = NULL;
 
11537
  __Pyx_RefNannySetupContext("__get__");
 
11538
  __Pyx_XDECREF(__pyx_r);
 
11539
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer);
 
11540
  __pyx_r = ((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer;
 
11541
  goto __pyx_L0;
 
11542
 
 
11543
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
11544
  __pyx_L0:;
 
11545
  __Pyx_XGIVEREF(__pyx_r);
 
11546
  __Pyx_RefNannyFinishContext();
 
11547
  return __pyx_r;
 
11548
}
 
11549
 
 
11550
static int __pyx_pf_6gevent_4core_17http_request_base_14_output_buffer_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
 
11551
static int __pyx_pf_6gevent_4core_17http_request_base_14_output_buffer_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
 
11552
  int __pyx_r;
 
11553
  __Pyx_RefNannySetupContext("__set__");
 
11554
  __Pyx_INCREF(__pyx_v_value);
 
11555
  __Pyx_GIVEREF(__pyx_v_value);
 
11556
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer);
 
11557
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer);
 
11558
  ((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer = __pyx_v_value;
 
11559
 
 
11560
  __pyx_r = 0;
 
11561
  __Pyx_RefNannyFinishContext();
 
11562
  return __pyx_r;
 
11563
}
 
11564
 
 
11565
static int __pyx_pf_6gevent_4core_17http_request_base_14_output_buffer_2__del__(PyObject *__pyx_v_self); /*proto*/
 
11566
static int __pyx_pf_6gevent_4core_17http_request_base_14_output_buffer_2__del__(PyObject *__pyx_v_self) {
 
11567
  int __pyx_r;
 
11568
  __Pyx_RefNannySetupContext("__del__");
 
11569
  __Pyx_INCREF(Py_None);
 
11570
  __Pyx_GIVEREF(Py_None);
 
11571
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer);
 
11572
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer);
 
11573
  ((struct __pyx_obj_6gevent_4core_http_request_base *)__pyx_v_self)->_output_buffer = Py_None;
 
11574
 
 
11575
  __pyx_r = 0;
 
11576
  __Pyx_RefNannyFinishContext();
 
11577
  return __pyx_r;
 
11578
}
 
11579
 
 
11580
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":403
 
11581
 *     cdef public object default_response_headers
 
11582
 * 
 
11583
 *     def __init__(self, size_t obj, object default_response_headers=[]):             # <<<<<<<<<<<<<<
 
11584
 *         http_request_base.__init__(self, obj)
 
11585
 *         self.default_response_headers = default_response_headers
 
11586
 */
 
11587
 
 
11588
static int __pyx_pf_6gevent_4core_12http_request___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
11589
static int __pyx_pf_6gevent_4core_12http_request___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
11590
  size_t __pyx_v_obj;
 
11591
  PyObject *__pyx_v_default_response_headers = 0;
 
11592
  int __pyx_r;
 
11593
  PyObject *__pyx_t_1 = NULL;
 
11594
  PyObject *__pyx_t_2 = NULL;
 
11595
  PyObject *__pyx_t_3 = NULL;
 
11596
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__obj,&__pyx_n_s_32,0};
 
11597
  __Pyx_RefNannySetupContext("__init__");
 
11598
  if (unlikely(__pyx_kwds)) {
 
11599
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
 
11600
    PyObject* values[2] = {0,0};
 
11601
    values[1] = __pyx_k_33;
 
11602
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
11603
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
 
11604
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
 
11605
      case  0: break;
 
11606
      default: goto __pyx_L5_argtuple_error;
 
11607
    }
 
11608
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
11609
      case  0:
 
11610
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__obj);
 
11611
      if (likely(values[0])) kw_args--;
 
11612
      else goto __pyx_L5_argtuple_error;
 
11613
      case  1:
 
11614
      if (kw_args > 0) {
 
11615
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_32);
 
11616
        if (value) { values[1] = value; kw_args--; }
 
11617
      }
 
11618
    }
 
11619
    if (unlikely(kw_args > 0)) {
 
11620
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11621
    }
 
11622
    __pyx_v_obj = __Pyx_PyInt_AsSize_t(values[0]); if (unlikely((__pyx_v_obj == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11623
    __pyx_v_default_response_headers = values[1];
 
11624
  } else {
 
11625
    __pyx_v_default_response_headers = __pyx_k_33;
 
11626
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
11627
      case  2: __pyx_v_default_response_headers = PyTuple_GET_ITEM(__pyx_args, 1);
 
11628
      case  1: __pyx_v_obj = __Pyx_PyInt_AsSize_t(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_obj == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11629
      break;
 
11630
      default: goto __pyx_L5_argtuple_error;
 
11631
    }
 
11632
  }
 
11633
  goto __pyx_L4_argument_unpacking_done;
 
11634
  __pyx_L5_argtuple_error:;
 
11635
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11636
  __pyx_L3_error:;
 
11637
  __Pyx_AddTraceback("gevent.core.http_request.__init__");
 
11638
  __Pyx_RefNannyFinishContext();
 
11639
  return -1;
 
11640
  __pyx_L4_argument_unpacking_done:;
 
11641
 
 
11642
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":404
 
11643
 * 
 
11644
 *     def __init__(self, size_t obj, object default_response_headers=[]):
 
11645
 *         http_request_base.__init__(self, obj)             # <<<<<<<<<<<<<<
 
11646
 *         self.default_response_headers = default_response_headers
 
11647
 * 
 
11648
 */
 
11649
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_http_request_base)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11650
  __Pyx_GOTREF(__pyx_t_1);
 
11651
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_obj); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11652
  __Pyx_GOTREF(__pyx_t_2);
 
11653
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11654
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
11655
  __Pyx_INCREF(__pyx_v_self);
 
11656
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self);
 
11657
  __Pyx_GIVEREF(__pyx_v_self);
 
11658
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
 
11659
  __Pyx_GIVEREF(__pyx_t_2);
 
11660
  __pyx_t_2 = 0;
 
11661
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11662
  __Pyx_GOTREF(__pyx_t_2);
 
11663
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
11664
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
 
11665
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
11666
 
 
11667
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":405
 
11668
 *     def __init__(self, size_t obj, object default_response_headers=[]):
 
11669
 *         http_request_base.__init__(self, obj)
 
11670
 *         self.default_response_headers = default_response_headers             # <<<<<<<<<<<<<<
 
11671
 * 
 
11672
 *     def __dealloc__(self):
 
11673
 */
 
11674
  __Pyx_INCREF(__pyx_v_default_response_headers);
 
11675
  __Pyx_GIVEREF(__pyx_v_default_response_headers);
 
11676
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers);
 
11677
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers);
 
11678
  ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers = __pyx_v_default_response_headers;
 
11679
 
 
11680
  __pyx_r = 0;
 
11681
  goto __pyx_L0;
 
11682
  __pyx_L1_error:;
 
11683
  __Pyx_XDECREF(__pyx_t_1);
 
11684
  __Pyx_XDECREF(__pyx_t_2);
 
11685
  __Pyx_XDECREF(__pyx_t_3);
 
11686
  __Pyx_AddTraceback("gevent.core.http_request.__init__");
 
11687
  __pyx_r = -1;
 
11688
  __pyx_L0:;
 
11689
  __Pyx_RefNannyFinishContext();
 
11690
  return __pyx_r;
 
11691
}
 
11692
 
 
11693
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":407
 
11694
 *         self.default_response_headers = default_response_headers
 
11695
 * 
 
11696
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 
11697
 *         cdef evhttp_request* obj = self.__obj
 
11698
 *         if obj != NULL:
 
11699
 */
 
11700
 
 
11701
static void __pyx_pf_6gevent_4core_12http_request_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
 
11702
static void __pyx_pf_6gevent_4core_12http_request_1__dealloc__(PyObject *__pyx_v_self) {
 
11703
  struct evhttp_request *__pyx_v_obj;
 
11704
  int __pyx_t_1;
 
11705
  PyObject *__pyx_t_2 = NULL;
 
11706
  PyObject *__pyx_t_3 = NULL;
 
11707
  __Pyx_RefNannySetupContext("__dealloc__");
 
11708
 
 
11709
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":408
 
11710
 * 
 
11711
 *     def __dealloc__(self):
 
11712
 *         cdef evhttp_request* obj = self.__obj             # <<<<<<<<<<<<<<
 
11713
 *         if obj != NULL:
 
11714
 *             self.detach()
 
11715
 */
 
11716
  __pyx_v_obj = ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx_base.__pyx___obj;
 
11717
 
 
11718
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":409
 
11719
 *     def __dealloc__(self):
 
11720
 *         cdef evhttp_request* obj = self.__obj
 
11721
 *         if obj != NULL:             # <<<<<<<<<<<<<<
 
11722
 *             self.detach()
 
11723
 *             report_internal_error(obj)
 
11724
 */
 
11725
  __pyx_t_1 = (__pyx_v_obj != NULL);
 
11726
  if (__pyx_t_1) {
 
11727
 
 
11728
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":410
 
11729
 *         cdef evhttp_request* obj = self.__obj
 
11730
 *         if obj != NULL:
 
11731
 *             self.detach()             # <<<<<<<<<<<<<<
 
11732
 *             report_internal_error(obj)
 
11733
 * 
 
11734
 */
 
11735
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__detach); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11736
    __Pyx_GOTREF(__pyx_t_2);
 
11737
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11738
    __Pyx_GOTREF(__pyx_t_3);
 
11739
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
11740
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
11741
 
 
11742
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":411
 
11743
 *         if obj != NULL:
 
11744
 *             self.detach()
 
11745
 *             report_internal_error(obj)             # <<<<<<<<<<<<<<
 
11746
 * 
10746
11747
 *     def _add_default_response_headers(self):
10747
11748
 */
10748
 
  __Pyx_XDECREF(__pyx_r);
10749
 
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_output_buffer);
10750
 
  __pyx_r = ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->_output_buffer;
10751
 
  goto __pyx_L0;
 
11749
    __pyx_f_6gevent_4core_report_internal_error(__pyx_v_obj);
 
11750
    goto __pyx_L5;
 
11751
  }
 
11752
  __pyx_L5:;
10752
11753
 
10753
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10754
11754
  goto __pyx_L0;
10755
11755
  __pyx_L1_error:;
10756
11756
  __Pyx_XDECREF(__pyx_t_2);
10757
11757
  __Pyx_XDECREF(__pyx_t_3);
10758
 
  __Pyx_AddTraceback("gevent.core.http_request.output_buffer.__get__");
10759
 
  __pyx_r = NULL;
 
11758
  __Pyx_AddTraceback("gevent.core.http_request.__dealloc__");
10760
11759
  __pyx_L0:;
10761
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
10762
 
  __Pyx_XGIVEREF(__pyx_r);
10763
11760
  __Pyx_RefNannyFinishContext();
10764
 
  return __pyx_r;
10765
11761
}
10766
11762
 
10767
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":314
10768
 
 *             return self._output_buffer
 
11763
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":413
 
11764
 *             report_internal_error(obj)
10769
11765
 * 
10770
11766
 *     def _add_default_response_headers(self):             # <<<<<<<<<<<<<<
10771
11767
 *         for key, value in self.default_response_headers:
10772
11768
 *             if not self.find_output_header(key):
10773
11769
 */
10774
11770
 
10775
 
static PyObject *__pyx_pf_6gevent_4core_12http_request__add_default_response_headers(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
10776
 
static PyObject *__pyx_pf_6gevent_4core_12http_request__add_default_response_headers(PyObject *__pyx_v_self, PyObject *unused) {
 
11771
static PyObject *__pyx_pf_6gevent_4core_12http_request_2_add_default_response_headers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
11772
static PyObject *__pyx_pf_6gevent_4core_12http_request_2_add_default_response_headers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10777
11773
  PyObject *__pyx_v_key;
10778
11774
  PyObject *__pyx_v_value;
10779
11775
  PyObject *__pyx_r = NULL;
10786
11782
  int __pyx_t_7;
10787
11783
  int __pyx_t_8;
10788
11784
  __Pyx_RefNannySetupContext("_add_default_response_headers");
10789
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
10790
11785
  __pyx_v_key = Py_None; __Pyx_INCREF(Py_None);
10791
11786
  __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
10792
11787
 
10793
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":315
 
11788
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":414
10794
11789
 * 
10795
11790
 *     def _add_default_response_headers(self):
10796
11791
 *         for key, value in self.default_response_headers:             # <<<<<<<<<<<<<<
10800
11795
  if (PyList_CheckExact(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers) || PyTuple_CheckExact(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers)) {
10801
11796
    __pyx_t_1 = 0; __pyx_t_2 = ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers; __Pyx_INCREF(__pyx_t_2);
10802
11797
  } else {
10803
 
    __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11798
    __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10804
11799
    __Pyx_GOTREF(__pyx_t_2);
10805
11800
  }
10806
11801
  for (;;) {
10813
11808
    } else {
10814
11809
      __pyx_t_3 = PyIter_Next(__pyx_t_2);
10815
11810
      if (!__pyx_t_3) {
10816
 
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11811
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10817
11812
        break;
10818
11813
      }
10819
11814
      __Pyx_GOTREF(__pyx_t_3);
10830
11825
      __pyx_v_value = __pyx_t_5;
10831
11826
      __pyx_t_5 = 0;
10832
11827
    } else {
10833
 
      __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11828
      __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10834
11829
      __Pyx_GOTREF(__pyx_t_6);
10835
11830
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10836
 
      __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_6, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11831
      __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_6, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10837
11832
      __Pyx_GOTREF(__pyx_t_4);
10838
 
      __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_6, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11833
      __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_6, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10839
11834
      __Pyx_GOTREF(__pyx_t_5);
10840
 
      if (__Pyx_EndUnpack(__pyx_t_6) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11835
      if (__Pyx_EndUnpack(__pyx_t_6, 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10841
11836
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10842
11837
      __Pyx_DECREF(__pyx_v_key);
10843
11838
      __pyx_v_key = __pyx_t_4;
10847
11842
      __pyx_t_5 = 0;
10848
11843
    }
10849
11844
 
10850
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":316
 
11845
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":415
10851
11846
 *     def _add_default_response_headers(self):
10852
11847
 *         for key, value in self.default_response_headers:
10853
11848
 *             if not self.find_output_header(key):             # <<<<<<<<<<<<<<
10854
11849
 *                 self.add_output_header(key, value)
10855
11850
 * 
10856
11851
 */
10857
 
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__find_output_header); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11852
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__find_output_header); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10858
11853
    __Pyx_GOTREF(__pyx_t_3);
10859
 
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10860
 
    __Pyx_GOTREF(__pyx_t_5);
 
11854
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11855
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
10861
11856
    __Pyx_INCREF(__pyx_v_key);
10862
11857
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key);
10863
11858
    __Pyx_GIVEREF(__pyx_v_key);
10864
 
    __pyx_t_4 = PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11859
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10865
11860
    __Pyx_GOTREF(__pyx_t_4);
10866
11861
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10867
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10868
 
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11862
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
 
11863
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10869
11864
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10870
11865
    __pyx_t_8 = (!__pyx_t_7);
10871
11866
    if (__pyx_t_8) {
10872
11867
 
10873
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":317
 
11868
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":416
10874
11869
 *         for key, value in self.default_response_headers:
10875
11870
 *             if not self.find_output_header(key):
10876
11871
 *                 self.add_output_header(key, value)             # <<<<<<<<<<<<<<
10877
11872
 * 
10878
11873
 *     def send_reply(self, int code, char *reason, object buf):
10879
11874
 */
10880
 
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__add_output_header); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11875
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__add_output_header); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10881
11876
      __Pyx_GOTREF(__pyx_t_4);
10882
 
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10883
 
      __Pyx_GOTREF(__pyx_t_5);
 
11877
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11878
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
10884
11879
      __Pyx_INCREF(__pyx_v_key);
10885
11880
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_key);
10886
11881
      __Pyx_GIVEREF(__pyx_v_key);
10887
11882
      __Pyx_INCREF(__pyx_v_value);
10888
11883
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_value);
10889
11884
      __Pyx_GIVEREF(__pyx_v_value);
10890
 
      __pyx_t_3 = PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
11885
      __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10891
11886
      __Pyx_GOTREF(__pyx_t_3);
10892
11887
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10893
 
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
11888
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
10894
11889
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10895
11890
      goto __pyx_L7;
10896
11891
    }
10911
11906
  __pyx_L0:;
10912
11907
  __Pyx_DECREF(__pyx_v_key);
10913
11908
  __Pyx_DECREF(__pyx_v_value);
10914
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
10915
11909
  __Pyx_XGIVEREF(__pyx_r);
10916
11910
  __Pyx_RefNannyFinishContext();
10917
11911
  return __pyx_r;
10918
11912
}
10919
11913
 
10920
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":319
 
11914
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":418
10921
11915
 *                 self.add_output_header(key, value)
10922
11916
 * 
10923
11917
 *     def send_reply(self, int code, char *reason, object buf):             # <<<<<<<<<<<<<<
10925
11919
 *             raise HttpRequestDeleted
10926
11920
 */
10927
11921
 
10928
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_send_reply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10929
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_send_reply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
11922
static PyObject *__pyx_pf_6gevent_4core_12http_request_3send_reply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
11923
static PyObject *__pyx_pf_6gevent_4core_12http_request_3send_reply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10930
11924
  int __pyx_v_code;
10931
11925
  char *__pyx_v_reason;
10932
11926
  PyObject *__pyx_v_buf = 0;
10936
11930
  PyObject *__pyx_t_2 = NULL;
10937
11931
  PyObject *__pyx_t_3 = NULL;
10938
11932
  char *__pyx_t_4;
10939
 
  Py_ssize_t __pyx_t_5;
 
11933
  char *__pyx_t_5;
 
11934
  Py_ssize_t __pyx_t_6;
10940
11935
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__code,&__pyx_n_s__reason,&__pyx_n_s__buf,0};
10941
11936
  __Pyx_RefNannySetupContext("send_reply");
10942
11937
  if (unlikely(__pyx_kwds)) {
10958
11953
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reason);
10959
11954
      if (likely(values[1])) kw_args--;
10960
11955
      else {
10961
 
        __Pyx_RaiseArgtupleInvalid("send_reply", 1, 3, 3, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11956
        __Pyx_RaiseArgtupleInvalid("send_reply", 1, 3, 3, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10962
11957
      }
10963
11958
      case  2:
10964
11959
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__buf);
10965
11960
      if (likely(values[2])) kw_args--;
10966
11961
      else {
10967
 
        __Pyx_RaiseArgtupleInvalid("send_reply", 1, 3, 3, 2); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11962
        __Pyx_RaiseArgtupleInvalid("send_reply", 1, 3, 3, 2); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10968
11963
      }
10969
11964
    }
10970
11965
    if (unlikely(kw_args > 0)) {
10971
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "send_reply") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11966
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "send_reply") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10972
11967
    }
10973
 
    __pyx_v_code = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10974
 
    __pyx_v_reason = __Pyx_PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_reason) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11968
    __pyx_v_code = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11969
    __pyx_v_reason = PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_reason) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10975
11970
    __pyx_v_buf = values[2];
10976
11971
  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
10977
11972
    goto __pyx_L5_argtuple_error;
10978
11973
  } else {
10979
 
    __pyx_v_code = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10980
 
    __pyx_v_reason = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((!__pyx_v_reason) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11974
    __pyx_v_code = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11975
    __pyx_v_reason = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((!__pyx_v_reason) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10981
11976
    __pyx_v_buf = PyTuple_GET_ITEM(__pyx_args, 2);
10982
11977
  }
10983
11978
  goto __pyx_L4_argument_unpacking_done;
10984
11979
  __pyx_L5_argtuple_error:;
10985
 
  __Pyx_RaiseArgtupleInvalid("send_reply", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
11980
  __Pyx_RaiseArgtupleInvalid("send_reply", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
10986
11981
  __pyx_L3_error:;
10987
11982
  __Pyx_AddTraceback("gevent.core.http_request.send_reply");
 
11983
  __Pyx_RefNannyFinishContext();
10988
11984
  return NULL;
10989
11985
  __pyx_L4_argument_unpacking_done:;
10990
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
10991
 
  __Pyx_INCREF(__pyx_v_buf);
10992
11986
 
10993
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":320
 
11987
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":419
10994
11988
 * 
10995
11989
 *     def send_reply(self, int code, char *reason, object buf):
10996
11990
 *         if not self.__obj:             # <<<<<<<<<<<<<<
10997
11991
 *             raise HttpRequestDeleted
10998
11992
 *         cdef evbuffer* c_buf
10999
11993
 */
11000
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
11994
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx_base.__pyx___obj != 0));
11001
11995
  if (__pyx_t_1) {
11002
11996
 
11003
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":321
 
11997
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":420
11004
11998
 *     def send_reply(self, int code, char *reason, object buf):
11005
11999
 *         if not self.__obj:
11006
12000
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
11007
12001
 *         cdef evbuffer* c_buf
11008
12002
 *         if isinstance(buf, buffer):
11009
12003
 */
11010
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12004
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11011
12005
    __Pyx_GOTREF(__pyx_t_2);
11012
12006
    __Pyx_Raise(__pyx_t_2, 0, 0);
11013
12007
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11014
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12008
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11015
12009
    goto __pyx_L6;
11016
12010
  }
11017
12011
  __pyx_L6:;
11018
12012
 
11019
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":323
 
12013
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":422
11020
12014
 *             raise HttpRequestDeleted
11021
12015
 *         cdef evbuffer* c_buf
11022
12016
 *         if isinstance(buf, buffer):             # <<<<<<<<<<<<<<
11023
12017
 *             self._add_default_response_headers()
11024
12018
 *             evhttp_send_reply(self.__obj, code, reason, (<buffer>buf).__obj)
11025
12019
 */
11026
 
  __pyx_t_1 = PyObject_TypeCheck(__pyx_v_buf, ((PyTypeObject *)((PyObject*)__pyx_ptype_6gevent_4core_buffer))); 
 
12020
  __pyx_t_2 = __pyx_v_buf;
 
12021
  __Pyx_INCREF(__pyx_t_2);
 
12022
  __pyx_t_3 = ((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_buffer));
 
12023
  __Pyx_INCREF(__pyx_t_3);
 
12024
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_t_2, __pyx_t_3); 
 
12025
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
12026
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11027
12027
  if (__pyx_t_1) {
11028
12028
 
11029
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":324
 
12029
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":423
11030
12030
 *         cdef evbuffer* c_buf
11031
12031
 *         if isinstance(buf, buffer):
11032
12032
 *             self._add_default_response_headers()             # <<<<<<<<<<<<<<
11033
12033
 *             evhttp_send_reply(self.__obj, code, reason, (<buffer>buf).__obj)
11034
12034
 *         elif isinstance(buf, str):
11035
12035
 */
11036
 
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_29); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11037
 
    __Pyx_GOTREF(__pyx_t_2);
11038
 
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12036
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_34); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11039
12037
    __Pyx_GOTREF(__pyx_t_3);
11040
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
12038
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12039
    __Pyx_GOTREF(__pyx_t_2);
11041
12040
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
12041
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11042
12042
 
11043
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":325
 
12043
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":424
11044
12044
 *         if isinstance(buf, buffer):
11045
12045
 *             self._add_default_response_headers()
11046
12046
 *             evhttp_send_reply(self.__obj, code, reason, (<buffer>buf).__obj)             # <<<<<<<<<<<<<<
11047
12047
 *         elif isinstance(buf, str):
11048
12048
 *             self._add_default_response_headers()
11049
12049
 */
11050
 
    evhttp_send_reply(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj, __pyx_v_code, __pyx_v_reason, ((struct __pyx_obj_6gevent_4core_buffer *)__pyx_v_buf)->__pyx___obj);
 
12050
    evhttp_send_reply(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx_base.__pyx___obj, __pyx_v_code, __pyx_v_reason, ((struct __pyx_obj_6gevent_4core_buffer *)__pyx_v_buf)->__pyx___obj);
11051
12051
    goto __pyx_L7;
11052
12052
  }
11053
12053
 
11054
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":326
 
12054
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":425
11055
12055
 *             self._add_default_response_headers()
11056
12056
 *             evhttp_send_reply(self.__obj, code, reason, (<buffer>buf).__obj)
11057
12057
 *         elif isinstance(buf, str):             # <<<<<<<<<<<<<<
11058
12058
 *             self._add_default_response_headers()
11059
12059
 *             c_buf = evbuffer_new()
11060
12060
 */
11061
 
  __pyx_t_1 = PyObject_TypeCheck(__pyx_v_buf, ((PyTypeObject *)((PyObject*)&PyString_Type))); 
 
12061
  __pyx_t_2 = __pyx_v_buf;
 
12062
  __Pyx_INCREF(__pyx_t_2);
 
12063
  __pyx_t_3 = ((PyObject *)((PyObject*)(&PyString_Type)));
 
12064
  __Pyx_INCREF(__pyx_t_3);
 
12065
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_t_2, __pyx_t_3); 
 
12066
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
12067
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11062
12068
  if (__pyx_t_1) {
11063
12069
 
11064
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":327
 
12070
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":426
11065
12071
 *             evhttp_send_reply(self.__obj, code, reason, (<buffer>buf).__obj)
11066
12072
 *         elif isinstance(buf, str):
11067
12073
 *             self._add_default_response_headers()             # <<<<<<<<<<<<<<
11068
12074
 *             c_buf = evbuffer_new()
11069
12075
 *             evbuffer_add(c_buf, <char *>buf, len(buf))
11070
12076
 */
11071
 
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_29); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12077
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_34); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11072
12078
    __Pyx_GOTREF(__pyx_t_3);
11073
 
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12079
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11074
12080
    __Pyx_GOTREF(__pyx_t_2);
11075
12081
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11076
12082
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11077
12083
 
11078
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":328
 
12084
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":427
11079
12085
 *         elif isinstance(buf, str):
11080
12086
 *             self._add_default_response_headers()
11081
12087
 *             c_buf = evbuffer_new()             # <<<<<<<<<<<<<<
11084
12090
 */
11085
12091
    __pyx_v_c_buf = evbuffer_new();
11086
12092
 
11087
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":329
 
12093
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":428
11088
12094
 *             self._add_default_response_headers()
11089
12095
 *             c_buf = evbuffer_new()
11090
12096
 *             evbuffer_add(c_buf, <char *>buf, len(buf))             # <<<<<<<<<<<<<<
11091
12097
 *             evhttp_send_reply(self.__obj, code, reason, c_buf)
11092
12098
 *             evbuffer_free(c_buf)
11093
12099
 */
11094
 
    __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_v_buf); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11095
 
    __pyx_t_5 = PyObject_Length(__pyx_v_buf); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11096
 
    evbuffer_add(__pyx_v_c_buf, ((char *)__pyx_t_4), __pyx_t_5);
 
12100
    __pyx_t_4 = PyBytes_AsString(__pyx_v_buf); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12101
    __pyx_t_5 = __pyx_t_4;
 
12102
    __pyx_t_2 = __pyx_v_buf;
 
12103
    __Pyx_INCREF(__pyx_t_2);
 
12104
    __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12105
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
12106
    evbuffer_add(__pyx_v_c_buf, __pyx_t_5, __pyx_t_6);
11097
12107
 
11098
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":330
 
12108
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":429
11099
12109
 *             c_buf = evbuffer_new()
11100
12110
 *             evbuffer_add(c_buf, <char *>buf, len(buf))
11101
12111
 *             evhttp_send_reply(self.__obj, code, reason, c_buf)             # <<<<<<<<<<<<<<
11102
12112
 *             evbuffer_free(c_buf)
11103
12113
 *         else:
11104
12114
 */
11105
 
    evhttp_send_reply(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj, __pyx_v_code, __pyx_v_reason, __pyx_v_c_buf);
 
12115
    evhttp_send_reply(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx_base.__pyx___obj, __pyx_v_code, __pyx_v_reason, __pyx_v_c_buf);
11106
12116
 
11107
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":331
 
12117
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":430
11108
12118
 *             evbuffer_add(c_buf, <char *>buf, len(buf))
11109
12119
 *             evhttp_send_reply(self.__obj, code, reason, c_buf)
11110
12120
 *             evbuffer_free(c_buf)             # <<<<<<<<<<<<<<
11116
12126
  }
11117
12127
  /*else*/ {
11118
12128
 
11119
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":333
 
12129
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":432
11120
12130
 *             evbuffer_free(c_buf)
11121
12131
 *         else:
11122
12132
 *             raise TypeError('Expected str or buffer: %r' % (buf, ))             # <<<<<<<<<<<<<<
11123
12133
 * 
11124
12134
 *     def send_reply_start(self, int code, char *reason):
11125
12135
 */
11126
 
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11127
 
    __Pyx_GOTREF(__pyx_t_2);
 
12136
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12137
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
11128
12138
    __Pyx_INCREF(__pyx_v_buf);
11129
12139
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_buf);
11130
12140
    __Pyx_GIVEREF(__pyx_v_buf);
11131
 
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_30), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11132
 
    __Pyx_GOTREF(__pyx_t_3);
11133
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11134
 
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11135
 
    __Pyx_GOTREF(__pyx_t_2);
11136
 
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
11137
 
    __Pyx_GIVEREF(__pyx_t_3);
 
12141
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_35), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12142
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
12143
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
 
12144
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12145
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
 
12146
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
 
12147
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
11138
12148
    __pyx_t_3 = 0;
11139
 
    __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12149
    __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11140
12150
    __Pyx_GOTREF(__pyx_t_3);
11141
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
12151
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
11142
12152
    __Pyx_Raise(__pyx_t_3, 0, 0);
11143
12153
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11144
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12154
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11145
12155
  }
11146
12156
  __pyx_L7:;
11147
12157
 
11153
12163
  __Pyx_AddTraceback("gevent.core.http_request.send_reply");
11154
12164
  __pyx_r = NULL;
11155
12165
  __pyx_L0:;
11156
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
11157
 
  __Pyx_DECREF(__pyx_v_buf);
11158
12166
  __Pyx_XGIVEREF(__pyx_r);
11159
12167
  __Pyx_RefNannyFinishContext();
11160
12168
  return __pyx_r;
11161
12169
}
11162
12170
 
11163
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":335
 
12171
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":434
11164
12172
 *             raise TypeError('Expected str or buffer: %r' % (buf, ))
11165
12173
 * 
11166
12174
 *     def send_reply_start(self, int code, char *reason):             # <<<<<<<<<<<<<<
11168
12176
 *             raise HttpRequestDeleted
11169
12177
 */
11170
12178
 
11171
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_send_reply_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11172
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_send_reply_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
12179
static PyObject *__pyx_pf_6gevent_4core_12http_request_4send_reply_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
12180
static PyObject *__pyx_pf_6gevent_4core_12http_request_4send_reply_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11173
12181
  int __pyx_v_code;
11174
12182
  char *__pyx_v_reason;
11175
12183
  PyObject *__pyx_r = NULL;
11196
12204
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reason);
11197
12205
      if (likely(values[1])) kw_args--;
11198
12206
      else {
11199
 
        __Pyx_RaiseArgtupleInvalid("send_reply_start", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12207
        __Pyx_RaiseArgtupleInvalid("send_reply_start", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11200
12208
      }
11201
12209
    }
11202
12210
    if (unlikely(kw_args > 0)) {
11203
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "send_reply_start") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12211
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "send_reply_start") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11204
12212
    }
11205
 
    __pyx_v_code = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11206
 
    __pyx_v_reason = __Pyx_PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_reason) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12213
    __pyx_v_code = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12214
    __pyx_v_reason = PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_reason) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11207
12215
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
11208
12216
    goto __pyx_L5_argtuple_error;
11209
12217
  } else {
11210
 
    __pyx_v_code = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11211
 
    __pyx_v_reason = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((!__pyx_v_reason) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12218
    __pyx_v_code = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12219
    __pyx_v_reason = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((!__pyx_v_reason) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11212
12220
  }
11213
12221
  goto __pyx_L4_argument_unpacking_done;
11214
12222
  __pyx_L5_argtuple_error:;
11215
 
  __Pyx_RaiseArgtupleInvalid("send_reply_start", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12223
  __Pyx_RaiseArgtupleInvalid("send_reply_start", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11216
12224
  __pyx_L3_error:;
11217
12225
  __Pyx_AddTraceback("gevent.core.http_request.send_reply_start");
 
12226
  __Pyx_RefNannyFinishContext();
11218
12227
  return NULL;
11219
12228
  __pyx_L4_argument_unpacking_done:;
11220
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
11221
12229
 
11222
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":336
 
12230
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":435
11223
12231
 * 
11224
12232
 *     def send_reply_start(self, int code, char *reason):
11225
12233
 *         if not self.__obj:             # <<<<<<<<<<<<<<
11226
12234
 *             raise HttpRequestDeleted
11227
12235
 *         self._add_default_response_headers()
11228
12236
 */
11229
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
12237
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx_base.__pyx___obj != 0));
11230
12238
  if (__pyx_t_1) {
11231
12239
 
11232
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":337
 
12240
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":436
11233
12241
 *     def send_reply_start(self, int code, char *reason):
11234
12242
 *         if not self.__obj:
11235
12243
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
11236
12244
 *         self._add_default_response_headers()
11237
12245
 *         evhttp_send_reply_start(self.__obj, code, reason)
11238
12246
 */
11239
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12247
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11240
12248
    __Pyx_GOTREF(__pyx_t_2);
11241
12249
    __Pyx_Raise(__pyx_t_2, 0, 0);
11242
12250
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11243
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12251
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11244
12252
    goto __pyx_L6;
11245
12253
  }
11246
12254
  __pyx_L6:;
11247
12255
 
11248
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":338
 
12256
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":437
11249
12257
 *         if not self.__obj:
11250
12258
 *             raise HttpRequestDeleted
11251
12259
 *         self._add_default_response_headers()             # <<<<<<<<<<<<<<
11252
12260
 *         evhttp_send_reply_start(self.__obj, code, reason)
11253
12261
 * 
11254
12262
 */
11255
 
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_29); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12263
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_34); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11256
12264
  __Pyx_GOTREF(__pyx_t_2);
11257
 
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12265
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11258
12266
  __Pyx_GOTREF(__pyx_t_3);
11259
12267
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11260
12268
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11261
12269
 
11262
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":339
 
12270
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":438
11263
12271
 *             raise HttpRequestDeleted
11264
12272
 *         self._add_default_response_headers()
11265
12273
 *         evhttp_send_reply_start(self.__obj, code, reason)             # <<<<<<<<<<<<<<
11266
12274
 * 
11267
12275
 *     def send_reply_chunk(self, object buf):
11268
12276
 */
11269
 
  evhttp_send_reply_start(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj, __pyx_v_code, __pyx_v_reason);
 
12277
  evhttp_send_reply_start(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx_base.__pyx___obj, __pyx_v_code, __pyx_v_reason);
11270
12278
 
11271
12279
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11272
12280
  goto __pyx_L0;
11276
12284
  __Pyx_AddTraceback("gevent.core.http_request.send_reply_start");
11277
12285
  __pyx_r = NULL;
11278
12286
  __pyx_L0:;
11279
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
11280
12287
  __Pyx_XGIVEREF(__pyx_r);
11281
12288
  __Pyx_RefNannyFinishContext();
11282
12289
  return __pyx_r;
11283
12290
}
11284
12291
 
11285
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":341
 
12292
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":440
11286
12293
 *         evhttp_send_reply_start(self.__obj, code, reason)
11287
12294
 * 
11288
12295
 *     def send_reply_chunk(self, object buf):             # <<<<<<<<<<<<<<
11290
12297
 *             raise HttpRequestDeleted
11291
12298
 */
11292
12299
 
11293
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_send_reply_chunk(PyObject *__pyx_v_self, PyObject *__pyx_v_buf); /*proto*/
11294
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_send_reply_chunk(PyObject *__pyx_v_self, PyObject *__pyx_v_buf) {
 
12300
static PyObject *__pyx_pf_6gevent_4core_12http_request_5send_reply_chunk(PyObject *__pyx_v_self, PyObject *__pyx_v_buf); /*proto*/
 
12301
static PyObject *__pyx_pf_6gevent_4core_12http_request_5send_reply_chunk(PyObject *__pyx_v_self, PyObject *__pyx_v_buf) {
11295
12302
  struct evbuffer *__pyx_v_c_buf;
11296
12303
  PyObject *__pyx_r = NULL;
11297
12304
  int __pyx_t_1;
11298
12305
  PyObject *__pyx_t_2 = NULL;
11299
 
  char *__pyx_t_3;
11300
 
  Py_ssize_t __pyx_t_4;
11301
 
  PyObject *__pyx_t_5 = NULL;
 
12306
  PyObject *__pyx_t_3 = NULL;
 
12307
  char *__pyx_t_4;
 
12308
  char *__pyx_t_5;
 
12309
  Py_ssize_t __pyx_t_6;
11302
12310
  __Pyx_RefNannySetupContext("send_reply_chunk");
11303
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
11304
 
  __Pyx_INCREF(__pyx_v_buf);
11305
12311
 
11306
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":342
 
12312
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":441
11307
12313
 * 
11308
12314
 *     def send_reply_chunk(self, object buf):
11309
12315
 *         if not self.__obj:             # <<<<<<<<<<<<<<
11310
12316
 *             raise HttpRequestDeleted
11311
12317
 *         cdef evbuffer* c_buf
11312
12318
 */
11313
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
12319
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx_base.__pyx___obj != 0));
11314
12320
  if (__pyx_t_1) {
11315
12321
 
11316
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":343
 
12322
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":442
11317
12323
 *     def send_reply_chunk(self, object buf):
11318
12324
 *         if not self.__obj:
11319
12325
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
11320
12326
 *         cdef evbuffer* c_buf
11321
12327
 *         if isinstance(buf, buffer):
11322
12328
 */
11323
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12329
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11324
12330
    __Pyx_GOTREF(__pyx_t_2);
11325
12331
    __Pyx_Raise(__pyx_t_2, 0, 0);
11326
12332
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11327
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12333
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11328
12334
    goto __pyx_L5;
11329
12335
  }
11330
12336
  __pyx_L5:;
11331
12337
 
11332
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":345
 
12338
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":444
11333
12339
 *             raise HttpRequestDeleted
11334
12340
 *         cdef evbuffer* c_buf
11335
12341
 *         if isinstance(buf, buffer):             # <<<<<<<<<<<<<<
11336
12342
 *             evhttp_send_reply_chunk(self.__obj, (<buffer>buf).__obj)
11337
12343
 *         elif isinstance(buf, str):
11338
12344
 */
11339
 
  __pyx_t_1 = PyObject_TypeCheck(__pyx_v_buf, ((PyTypeObject *)((PyObject*)__pyx_ptype_6gevent_4core_buffer))); 
 
12345
  __pyx_t_2 = __pyx_v_buf;
 
12346
  __Pyx_INCREF(__pyx_t_2);
 
12347
  __pyx_t_3 = ((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_buffer));
 
12348
  __Pyx_INCREF(__pyx_t_3);
 
12349
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_t_2, __pyx_t_3); 
 
12350
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
12351
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11340
12352
  if (__pyx_t_1) {
11341
12353
 
11342
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":346
 
12354
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":445
11343
12355
 *         cdef evbuffer* c_buf
11344
12356
 *         if isinstance(buf, buffer):
11345
12357
 *             evhttp_send_reply_chunk(self.__obj, (<buffer>buf).__obj)             # <<<<<<<<<<<<<<
11346
12358
 *         elif isinstance(buf, str):
11347
12359
 *             c_buf = evbuffer_new()
11348
12360
 */
11349
 
    evhttp_send_reply_chunk(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj, ((struct __pyx_obj_6gevent_4core_buffer *)__pyx_v_buf)->__pyx___obj);
 
12361
    evhttp_send_reply_chunk(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx_base.__pyx___obj, ((struct __pyx_obj_6gevent_4core_buffer *)__pyx_v_buf)->__pyx___obj);
11350
12362
    goto __pyx_L6;
11351
12363
  }
11352
12364
 
11353
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":347
 
12365
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":446
11354
12366
 *         if isinstance(buf, buffer):
11355
12367
 *             evhttp_send_reply_chunk(self.__obj, (<buffer>buf).__obj)
11356
12368
 *         elif isinstance(buf, str):             # <<<<<<<<<<<<<<
11357
12369
 *             c_buf = evbuffer_new()
11358
12370
 *             evbuffer_add(c_buf, <char *>buf, len(buf))
11359
12371
 */
11360
 
  __pyx_t_1 = PyObject_TypeCheck(__pyx_v_buf, ((PyTypeObject *)((PyObject*)&PyString_Type))); 
 
12372
  __pyx_t_3 = __pyx_v_buf;
 
12373
  __Pyx_INCREF(__pyx_t_3);
 
12374
  __pyx_t_2 = ((PyObject *)((PyObject*)(&PyString_Type)));
 
12375
  __Pyx_INCREF(__pyx_t_2);
 
12376
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_t_3, __pyx_t_2); 
 
12377
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
12378
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11361
12379
  if (__pyx_t_1) {
11362
12380
 
11363
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":348
 
12381
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":447
11364
12382
 *             evhttp_send_reply_chunk(self.__obj, (<buffer>buf).__obj)
11365
12383
 *         elif isinstance(buf, str):
11366
12384
 *             c_buf = evbuffer_new()             # <<<<<<<<<<<<<<
11369
12387
 */
11370
12388
    __pyx_v_c_buf = evbuffer_new();
11371
12389
 
11372
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":349
 
12390
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":448
11373
12391
 *         elif isinstance(buf, str):
11374
12392
 *             c_buf = evbuffer_new()
11375
12393
 *             evbuffer_add(c_buf, <char *>buf, len(buf))             # <<<<<<<<<<<<<<
11376
12394
 *             evhttp_send_reply_chunk(self.__obj, c_buf)
11377
12395
 *             evbuffer_free(c_buf)
11378
12396
 */
11379
 
    __pyx_t_3 = __Pyx_PyBytes_AsString(__pyx_v_buf); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11380
 
    __pyx_t_4 = PyObject_Length(__pyx_v_buf); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11381
 
    evbuffer_add(__pyx_v_c_buf, ((char *)__pyx_t_3), __pyx_t_4);
 
12397
    __pyx_t_4 = PyBytes_AsString(__pyx_v_buf); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12398
    __pyx_t_5 = __pyx_t_4;
 
12399
    __pyx_t_2 = __pyx_v_buf;
 
12400
    __Pyx_INCREF(__pyx_t_2);
 
12401
    __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12402
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
12403
    evbuffer_add(__pyx_v_c_buf, __pyx_t_5, __pyx_t_6);
11382
12404
 
11383
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":350
 
12405
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":449
11384
12406
 *             c_buf = evbuffer_new()
11385
12407
 *             evbuffer_add(c_buf, <char *>buf, len(buf))
11386
12408
 *             evhttp_send_reply_chunk(self.__obj, c_buf)             # <<<<<<<<<<<<<<
11387
12409
 *             evbuffer_free(c_buf)
11388
12410
 *         else:
11389
12411
 */
11390
 
    evhttp_send_reply_chunk(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj, __pyx_v_c_buf);
 
12412
    evhttp_send_reply_chunk(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx_base.__pyx___obj, __pyx_v_c_buf);
11391
12413
 
11392
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":351
 
12414
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":450
11393
12415
 *             evbuffer_add(c_buf, <char *>buf, len(buf))
11394
12416
 *             evhttp_send_reply_chunk(self.__obj, c_buf)
11395
12417
 *             evbuffer_free(c_buf)             # <<<<<<<<<<<<<<
11401
12423
  }
11402
12424
  /*else*/ {
11403
12425
 
11404
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":353
 
12426
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":452
11405
12427
 *             evbuffer_free(c_buf)
11406
12428
 *         else:
11407
12429
 *             raise TypeError('Expected str or buffer: %r' % (buf, ))             # <<<<<<<<<<<<<<
11408
12430
 * 
11409
12431
 *     def send_reply_end(self):
11410
12432
 */
11411
 
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11412
 
    __Pyx_GOTREF(__pyx_t_2);
 
12433
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12434
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
11413
12435
    __Pyx_INCREF(__pyx_v_buf);
11414
12436
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_buf);
11415
12437
    __Pyx_GIVEREF(__pyx_v_buf);
11416
 
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_30), __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11417
 
    __Pyx_GOTREF(__pyx_t_5);
11418
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11419
 
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11420
 
    __Pyx_GOTREF(__pyx_t_2);
11421
 
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
11422
 
    __Pyx_GIVEREF(__pyx_t_5);
11423
 
    __pyx_t_5 = 0;
11424
 
    __pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11425
 
    __Pyx_GOTREF(__pyx_t_5);
11426
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11427
 
    __Pyx_Raise(__pyx_t_5, 0, 0);
11428
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11429
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12438
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_35), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12439
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
12440
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
 
12441
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12442
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
 
12443
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
 
12444
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
 
12445
    __pyx_t_3 = 0;
 
12446
    __pyx_t_3 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12447
    __Pyx_GOTREF(__pyx_t_3);
 
12448
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
 
12449
    __Pyx_Raise(__pyx_t_3, 0, 0);
 
12450
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
12451
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11430
12452
  }
11431
12453
  __pyx_L6:;
11432
12454
 
11434
12456
  goto __pyx_L0;
11435
12457
  __pyx_L1_error:;
11436
12458
  __Pyx_XDECREF(__pyx_t_2);
11437
 
  __Pyx_XDECREF(__pyx_t_5);
 
12459
  __Pyx_XDECREF(__pyx_t_3);
11438
12460
  __Pyx_AddTraceback("gevent.core.http_request.send_reply_chunk");
11439
12461
  __pyx_r = NULL;
11440
12462
  __pyx_L0:;
11441
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
11442
 
  __Pyx_DECREF(__pyx_v_buf);
11443
12463
  __Pyx_XGIVEREF(__pyx_r);
11444
12464
  __Pyx_RefNannyFinishContext();
11445
12465
  return __pyx_r;
11446
12466
}
11447
12467
 
11448
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":355
 
12468
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":454
11449
12469
 *             raise TypeError('Expected str or buffer: %r' % (buf, ))
11450
12470
 * 
11451
12471
 *     def send_reply_end(self):             # <<<<<<<<<<<<<<
11453
12473
 *             raise HttpRequestDeleted
11454
12474
 */
11455
12475
 
11456
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_send_reply_end(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
11457
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_send_reply_end(PyObject *__pyx_v_self, PyObject *unused) {
 
12476
static PyObject *__pyx_pf_6gevent_4core_12http_request_6send_reply_end(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
 
12477
static PyObject *__pyx_pf_6gevent_4core_12http_request_6send_reply_end(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11458
12478
  PyObject *__pyx_r = NULL;
11459
12479
  int __pyx_t_1;
11460
12480
  PyObject *__pyx_t_2 = NULL;
11461
12481
  __Pyx_RefNannySetupContext("send_reply_end");
11462
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
11463
12482
 
11464
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":356
 
12483
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":455
11465
12484
 * 
11466
12485
 *     def send_reply_end(self):
11467
12486
 *         if not self.__obj:             # <<<<<<<<<<<<<<
11468
12487
 *             raise HttpRequestDeleted
11469
12488
 *         evhttp_send_reply_end(self.__obj)
11470
12489
 */
11471
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
12490
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx_base.__pyx___obj != 0));
11472
12491
  if (__pyx_t_1) {
11473
12492
 
11474
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":357
 
12493
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":456
11475
12494
 *     def send_reply_end(self):
11476
12495
 *         if not self.__obj:
11477
12496
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
11478
12497
 *         evhttp_send_reply_end(self.__obj)
11479
12498
 * 
11480
12499
 */
11481
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12500
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11482
12501
    __Pyx_GOTREF(__pyx_t_2);
11483
12502
    __Pyx_Raise(__pyx_t_2, 0, 0);
11484
12503
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11485
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12504
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11486
12505
    goto __pyx_L5;
11487
12506
  }
11488
12507
  __pyx_L5:;
11489
12508
 
11490
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":358
 
12509
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":457
11491
12510
 *         if not self.__obj:
11492
12511
 *             raise HttpRequestDeleted
11493
12512
 *         evhttp_send_reply_end(self.__obj)             # <<<<<<<<<<<<<<
11494
12513
 * 
11495
12514
 *     def send_error(self, int code, char* reason):
11496
12515
 */
11497
 
  evhttp_send_reply_end(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj);
 
12516
  evhttp_send_reply_end(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx_base.__pyx___obj);
11498
12517
 
11499
12518
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11500
12519
  goto __pyx_L0;
11503
12522
  __Pyx_AddTraceback("gevent.core.http_request.send_reply_end");
11504
12523
  __pyx_r = NULL;
11505
12524
  __pyx_L0:;
11506
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
11507
12525
  __Pyx_XGIVEREF(__pyx_r);
11508
12526
  __Pyx_RefNannyFinishContext();
11509
12527
  return __pyx_r;
11510
12528
}
11511
12529
 
11512
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":360
 
12530
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":459
11513
12531
 *         evhttp_send_reply_end(self.__obj)
11514
12532
 * 
11515
12533
 *     def send_error(self, int code, char* reason):             # <<<<<<<<<<<<<<
11517
12535
 *             raise HttpRequestDeleted
11518
12536
 */
11519
12537
 
11520
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_send_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11521
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_send_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
12538
static PyObject *__pyx_pf_6gevent_4core_12http_request_7send_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
12539
static PyObject *__pyx_pf_6gevent_4core_12http_request_7send_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11522
12540
  int __pyx_v_code;
11523
12541
  char *__pyx_v_reason;
11524
12542
  PyObject *__pyx_r = NULL;
11545
12563
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__reason);
11546
12564
      if (likely(values[1])) kw_args--;
11547
12565
      else {
11548
 
        __Pyx_RaiseArgtupleInvalid("send_error", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12566
        __Pyx_RaiseArgtupleInvalid("send_error", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11549
12567
      }
11550
12568
    }
11551
12569
    if (unlikely(kw_args > 0)) {
11552
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "send_error") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12570
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "send_error") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11553
12571
    }
11554
 
    __pyx_v_code = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11555
 
    __pyx_v_reason = __Pyx_PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_reason) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12572
    __pyx_v_code = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12573
    __pyx_v_reason = PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_reason) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11556
12574
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
11557
12575
    goto __pyx_L5_argtuple_error;
11558
12576
  } else {
11559
 
    __pyx_v_code = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11560
 
    __pyx_v_reason = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((!__pyx_v_reason) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12577
    __pyx_v_code = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_code == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12578
    __pyx_v_reason = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((!__pyx_v_reason) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11561
12579
  }
11562
12580
  goto __pyx_L4_argument_unpacking_done;
11563
12581
  __pyx_L5_argtuple_error:;
11564
 
  __Pyx_RaiseArgtupleInvalid("send_error", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12582
  __Pyx_RaiseArgtupleInvalid("send_error", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11565
12583
  __pyx_L3_error:;
11566
12584
  __Pyx_AddTraceback("gevent.core.http_request.send_error");
 
12585
  __Pyx_RefNannyFinishContext();
11567
12586
  return NULL;
11568
12587
  __pyx_L4_argument_unpacking_done:;
11569
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
11570
12588
 
11571
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":361
 
12589
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":460
11572
12590
 * 
11573
12591
 *     def send_error(self, int code, char* reason):
11574
12592
 *         if not self.__obj:             # <<<<<<<<<<<<<<
11575
12593
 *             raise HttpRequestDeleted
11576
12594
 *         self._add_default_response_headers()
11577
12595
 */
11578
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
 
12596
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx_base.__pyx___obj != 0));
11579
12597
  if (__pyx_t_1) {
11580
12598
 
11581
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":362
 
12599
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":461
11582
12600
 *     def send_error(self, int code, char* reason):
11583
12601
 *         if not self.__obj:
11584
12602
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
11585
12603
 *         self._add_default_response_headers()
11586
12604
 *         evhttp_send_error(self.__obj, code, reason)
11587
12605
 */
11588
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12606
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11589
12607
    __Pyx_GOTREF(__pyx_t_2);
11590
12608
    __Pyx_Raise(__pyx_t_2, 0, 0);
11591
12609
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11592
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12610
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11593
12611
    goto __pyx_L6;
11594
12612
  }
11595
12613
  __pyx_L6:;
11596
12614
 
11597
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":363
 
12615
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":462
11598
12616
 *         if not self.__obj:
11599
12617
 *             raise HttpRequestDeleted
11600
12618
 *         self._add_default_response_headers()             # <<<<<<<<<<<<<<
11601
12619
 *         evhttp_send_error(self.__obj, code, reason)
11602
12620
 * 
11603
12621
 */
11604
 
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_29); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12622
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s_34); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11605
12623
  __Pyx_GOTREF(__pyx_t_2);
11606
 
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12624
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11607
12625
  __Pyx_GOTREF(__pyx_t_3);
11608
12626
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11609
12627
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11610
12628
 
11611
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":364
 
12629
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":463
11612
12630
 *             raise HttpRequestDeleted
11613
12631
 *         self._add_default_response_headers()
11614
12632
 *         evhttp_send_error(self.__obj, code, reason)             # <<<<<<<<<<<<<<
11615
12633
 * 
11616
 
 *     def find_input_header(self, char* key):
 
12634
 * 
11617
12635
 */
11618
 
  evhttp_send_error(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj, __pyx_v_code, __pyx_v_reason);
 
12636
  evhttp_send_error(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx_base.__pyx___obj, __pyx_v_code, __pyx_v_reason);
11619
12637
 
11620
12638
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11621
12639
  goto __pyx_L0;
11625
12643
  __Pyx_AddTraceback("gevent.core.http_request.send_error");
11626
12644
  __pyx_r = NULL;
11627
12645
  __pyx_L0:;
11628
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
11629
 
  __Pyx_XGIVEREF(__pyx_r);
11630
 
  __Pyx_RefNannyFinishContext();
11631
 
  return __pyx_r;
11632
 
}
11633
 
 
11634
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":366
11635
 
 *         evhttp_send_error(self.__obj, code, reason)
11636
 
 * 
11637
 
 *     def find_input_header(self, char* key):             # <<<<<<<<<<<<<<
11638
 
 *         if not self.__obj:
11639
 
 *             raise HttpRequestDeleted
11640
 
 */
11641
 
 
11642
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_find_input_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_key); /*proto*/
11643
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_find_input_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_key) {
11644
 
  char *__pyx_v_key;
11645
 
  const char* __pyx_v_val;
11646
 
  PyObject *__pyx_r = NULL;
11647
 
  int __pyx_t_1;
11648
 
  PyObject *__pyx_t_2 = NULL;
11649
 
  __Pyx_RefNannySetupContext("find_input_header");
11650
 
  assert(__pyx_arg_key); {
11651
 
    __pyx_v_key = __Pyx_PyBytes_AsString(__pyx_arg_key); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11652
 
  }
11653
 
  goto __pyx_L4_argument_unpacking_done;
11654
 
  __pyx_L3_error:;
11655
 
  __Pyx_AddTraceback("gevent.core.http_request.find_input_header");
11656
 
  return NULL;
11657
 
  __pyx_L4_argument_unpacking_done:;
11658
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
11659
 
 
11660
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":367
11661
 
 * 
11662
 
 *     def find_input_header(self, char* key):
11663
 
 *         if not self.__obj:             # <<<<<<<<<<<<<<
11664
 
 *             raise HttpRequestDeleted
11665
 
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.input_headers, key)
11666
 
 */
11667
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
11668
 
  if (__pyx_t_1) {
11669
 
 
11670
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":368
11671
 
 *     def find_input_header(self, char* key):
11672
 
 *         if not self.__obj:
11673
 
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
11674
 
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.input_headers, key)
11675
 
 *         if val:
11676
 
 */
11677
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11678
 
    __Pyx_GOTREF(__pyx_t_2);
11679
 
    __Pyx_Raise(__pyx_t_2, 0, 0);
11680
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11681
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11682
 
    goto __pyx_L5;
11683
 
  }
11684
 
  __pyx_L5:;
11685
 
 
11686
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":369
11687
 
 *         if not self.__obj:
11688
 
 *             raise HttpRequestDeleted
11689
 
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.input_headers, key)             # <<<<<<<<<<<<<<
11690
 
 *         if val:
11691
 
 *             return val
11692
 
 */
11693
 
  __pyx_v_val = evhttp_find_header(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->input_headers, __pyx_v_key);
11694
 
 
11695
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":370
11696
 
 *             raise HttpRequestDeleted
11697
 
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.input_headers, key)
11698
 
 *         if val:             # <<<<<<<<<<<<<<
11699
 
 *             return val
11700
 
 * 
11701
 
 */
11702
 
  __pyx_t_1 = (__pyx_v_val != 0);
11703
 
  if (__pyx_t_1) {
11704
 
 
11705
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":371
11706
 
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.input_headers, key)
11707
 
 *         if val:
11708
 
 *             return val             # <<<<<<<<<<<<<<
11709
 
 * 
11710
 
 *     def find_output_header(self, char* key):
11711
 
 */
11712
 
    __Pyx_XDECREF(__pyx_r);
11713
 
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11714
 
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
11715
 
    __pyx_r = ((PyObject *)__pyx_t_2);
11716
 
    __pyx_t_2 = 0;
11717
 
    goto __pyx_L0;
11718
 
    goto __pyx_L6;
11719
 
  }
11720
 
  __pyx_L6:;
11721
 
 
11722
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11723
 
  goto __pyx_L0;
11724
 
  __pyx_L1_error:;
11725
 
  __Pyx_XDECREF(__pyx_t_2);
11726
 
  __Pyx_AddTraceback("gevent.core.http_request.find_input_header");
11727
 
  __pyx_r = NULL;
11728
 
  __pyx_L0:;
11729
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
11730
 
  __Pyx_XGIVEREF(__pyx_r);
11731
 
  __Pyx_RefNannyFinishContext();
11732
 
  return __pyx_r;
11733
 
}
11734
 
 
11735
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":373
11736
 
 *             return val
11737
 
 * 
11738
 
 *     def find_output_header(self, char* key):             # <<<<<<<<<<<<<<
11739
 
 *         if not self.__obj:
11740
 
 *             raise HttpRequestDeleted
11741
 
 */
11742
 
 
11743
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_find_output_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_key); /*proto*/
11744
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_find_output_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_key) {
11745
 
  char *__pyx_v_key;
11746
 
  const char* __pyx_v_val;
11747
 
  PyObject *__pyx_r = NULL;
11748
 
  int __pyx_t_1;
11749
 
  PyObject *__pyx_t_2 = NULL;
11750
 
  __Pyx_RefNannySetupContext("find_output_header");
11751
 
  assert(__pyx_arg_key); {
11752
 
    __pyx_v_key = __Pyx_PyBytes_AsString(__pyx_arg_key); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11753
 
  }
11754
 
  goto __pyx_L4_argument_unpacking_done;
11755
 
  __pyx_L3_error:;
11756
 
  __Pyx_AddTraceback("gevent.core.http_request.find_output_header");
11757
 
  return NULL;
11758
 
  __pyx_L4_argument_unpacking_done:;
11759
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
11760
 
 
11761
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":374
11762
 
 * 
11763
 
 *     def find_output_header(self, char* key):
11764
 
 *         if not self.__obj:             # <<<<<<<<<<<<<<
11765
 
 *             raise HttpRequestDeleted
11766
 
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.output_headers, key)
11767
 
 */
11768
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
11769
 
  if (__pyx_t_1) {
11770
 
 
11771
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":375
11772
 
 *     def find_output_header(self, char* key):
11773
 
 *         if not self.__obj:
11774
 
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
11775
 
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.output_headers, key)
11776
 
 *         if val:
11777
 
 */
11778
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11779
 
    __Pyx_GOTREF(__pyx_t_2);
11780
 
    __Pyx_Raise(__pyx_t_2, 0, 0);
11781
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11782
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11783
 
    goto __pyx_L5;
11784
 
  }
11785
 
  __pyx_L5:;
11786
 
 
11787
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":376
11788
 
 *         if not self.__obj:
11789
 
 *             raise HttpRequestDeleted
11790
 
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.output_headers, key)             # <<<<<<<<<<<<<<
11791
 
 *         if val:
11792
 
 *             return val
11793
 
 */
11794
 
  __pyx_v_val = evhttp_find_header(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->output_headers, __pyx_v_key);
11795
 
 
11796
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":377
11797
 
 *             raise HttpRequestDeleted
11798
 
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.output_headers, key)
11799
 
 *         if val:             # <<<<<<<<<<<<<<
11800
 
 *             return val
11801
 
 * 
11802
 
 */
11803
 
  __pyx_t_1 = (__pyx_v_val != 0);
11804
 
  if (__pyx_t_1) {
11805
 
 
11806
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":378
11807
 
 *         cdef const_char_ptr val = evhttp_find_header(self.__obj.output_headers, key)
11808
 
 *         if val:
11809
 
 *             return val             # <<<<<<<<<<<<<<
11810
 
 * 
11811
 
 *     def add_input_header(self, char* key, char* value):
11812
 
 */
11813
 
    __Pyx_XDECREF(__pyx_r);
11814
 
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_val); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11815
 
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
11816
 
    __pyx_r = ((PyObject *)__pyx_t_2);
11817
 
    __pyx_t_2 = 0;
11818
 
    goto __pyx_L0;
11819
 
    goto __pyx_L6;
11820
 
  }
11821
 
  __pyx_L6:;
11822
 
 
11823
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11824
 
  goto __pyx_L0;
11825
 
  __pyx_L1_error:;
11826
 
  __Pyx_XDECREF(__pyx_t_2);
11827
 
  __Pyx_AddTraceback("gevent.core.http_request.find_output_header");
11828
 
  __pyx_r = NULL;
11829
 
  __pyx_L0:;
11830
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
11831
 
  __Pyx_XGIVEREF(__pyx_r);
11832
 
  __Pyx_RefNannyFinishContext();
11833
 
  return __pyx_r;
11834
 
}
11835
 
 
11836
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":380
11837
 
 *             return val
11838
 
 * 
11839
 
 *     def add_input_header(self, char* key, char* value):             # <<<<<<<<<<<<<<
11840
 
 *         if not self.__obj:
11841
 
 *             raise HttpRequestDeleted
11842
 
 */
11843
 
 
11844
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_add_input_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11845
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_add_input_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11846
 
  char *__pyx_v_key;
11847
 
  char *__pyx_v_value;
11848
 
  PyObject *__pyx_r = NULL;
11849
 
  int __pyx_t_1;
11850
 
  PyObject *__pyx_t_2 = NULL;
11851
 
  int __pyx_t_3;
11852
 
  PyObject *__pyx_t_4 = NULL;
11853
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__value,0};
11854
 
  __Pyx_RefNannySetupContext("add_input_header");
11855
 
  if (unlikely(__pyx_kwds)) {
11856
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
11857
 
    PyObject* values[2] = {0,0};
11858
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
11859
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11860
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11861
 
      case  0: break;
11862
 
      default: goto __pyx_L5_argtuple_error;
11863
 
    }
11864
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
11865
 
      case  0:
11866
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
11867
 
      if (likely(values[0])) kw_args--;
11868
 
      else goto __pyx_L5_argtuple_error;
11869
 
      case  1:
11870
 
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
11871
 
      if (likely(values[1])) kw_args--;
11872
 
      else {
11873
 
        __Pyx_RaiseArgtupleInvalid("add_input_header", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11874
 
      }
11875
 
    }
11876
 
    if (unlikely(kw_args > 0)) {
11877
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add_input_header") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11878
 
    }
11879
 
    __pyx_v_key = __Pyx_PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11880
 
    __pyx_v_value = __Pyx_PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_value) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11881
 
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
11882
 
    goto __pyx_L5_argtuple_error;
11883
 
  } else {
11884
 
    __pyx_v_key = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11885
 
    __pyx_v_value = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((!__pyx_v_value) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11886
 
  }
11887
 
  goto __pyx_L4_argument_unpacking_done;
11888
 
  __pyx_L5_argtuple_error:;
11889
 
  __Pyx_RaiseArgtupleInvalid("add_input_header", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11890
 
  __pyx_L3_error:;
11891
 
  __Pyx_AddTraceback("gevent.core.http_request.add_input_header");
11892
 
  return NULL;
11893
 
  __pyx_L4_argument_unpacking_done:;
11894
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
11895
 
 
11896
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":381
11897
 
 * 
11898
 
 *     def add_input_header(self, char* key, char* value):
11899
 
 *         if not self.__obj:             # <<<<<<<<<<<<<<
11900
 
 *             raise HttpRequestDeleted
11901
 
 *         if evhttp_add_header(self.__obj.input_headers, key, value):
11902
 
 */
11903
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
11904
 
  if (__pyx_t_1) {
11905
 
 
11906
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":382
11907
 
 *     def add_input_header(self, char* key, char* value):
11908
 
 *         if not self.__obj:
11909
 
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
11910
 
 *         if evhttp_add_header(self.__obj.input_headers, key, value):
11911
 
 *             raise RuntimeError('Internal error in evhttp_add_header')
11912
 
 */
11913
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11914
 
    __Pyx_GOTREF(__pyx_t_2);
11915
 
    __Pyx_Raise(__pyx_t_2, 0, 0);
11916
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11917
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11918
 
    goto __pyx_L6;
11919
 
  }
11920
 
  __pyx_L6:;
11921
 
 
11922
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":383
11923
 
 *         if not self.__obj:
11924
 
 *             raise HttpRequestDeleted
11925
 
 *         if evhttp_add_header(self.__obj.input_headers, key, value):             # <<<<<<<<<<<<<<
11926
 
 *             raise RuntimeError('Internal error in evhttp_add_header')
11927
 
 * 
11928
 
 */
11929
 
  __pyx_t_3 = evhttp_add_header(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->input_headers, __pyx_v_key, __pyx_v_value);
11930
 
  if (__pyx_t_3) {
11931
 
 
11932
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":384
11933
 
 *             raise HttpRequestDeleted
11934
 
 *         if evhttp_add_header(self.__obj.input_headers, key, value):
11935
 
 *             raise RuntimeError('Internal error in evhttp_add_header')             # <<<<<<<<<<<<<<
11936
 
 * 
11937
 
 *     def add_output_header(self, char* key, char* value):
11938
 
 */
11939
 
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11940
 
    __Pyx_GOTREF(__pyx_t_2);
11941
 
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_31));
11942
 
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_31));
11943
 
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_31));
11944
 
    __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11945
 
    __Pyx_GOTREF(__pyx_t_4);
11946
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11947
 
    __Pyx_Raise(__pyx_t_4, 0, 0);
11948
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11949
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
11950
 
    goto __pyx_L7;
11951
 
  }
11952
 
  __pyx_L7:;
11953
 
 
11954
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11955
 
  goto __pyx_L0;
11956
 
  __pyx_L1_error:;
11957
 
  __Pyx_XDECREF(__pyx_t_2);
11958
 
  __Pyx_XDECREF(__pyx_t_4);
11959
 
  __Pyx_AddTraceback("gevent.core.http_request.add_input_header");
11960
 
  __pyx_r = NULL;
11961
 
  __pyx_L0:;
11962
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
11963
 
  __Pyx_XGIVEREF(__pyx_r);
11964
 
  __Pyx_RefNannyFinishContext();
11965
 
  return __pyx_r;
11966
 
}
11967
 
 
11968
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":386
11969
 
 *             raise RuntimeError('Internal error in evhttp_add_header')
11970
 
 * 
11971
 
 *     def add_output_header(self, char* key, char* value):             # <<<<<<<<<<<<<<
11972
 
 *         if not self.__obj:
11973
 
 *             raise HttpRequestDeleted
11974
 
 */
11975
 
 
11976
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_add_output_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
11977
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_add_output_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11978
 
  char *__pyx_v_key;
11979
 
  char *__pyx_v_value;
11980
 
  PyObject *__pyx_r = NULL;
11981
 
  int __pyx_t_1;
11982
 
  PyObject *__pyx_t_2 = NULL;
11983
 
  int __pyx_t_3;
11984
 
  PyObject *__pyx_t_4 = NULL;
11985
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__key,&__pyx_n_s__value,0};
11986
 
  __Pyx_RefNannySetupContext("add_output_header");
11987
 
  if (unlikely(__pyx_kwds)) {
11988
 
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
11989
 
    PyObject* values[2] = {0,0};
11990
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
11991
 
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11992
 
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11993
 
      case  0: break;
11994
 
      default: goto __pyx_L5_argtuple_error;
11995
 
    }
11996
 
    switch (PyTuple_GET_SIZE(__pyx_args)) {
11997
 
      case  0:
11998
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__key);
11999
 
      if (likely(values[0])) kw_args--;
12000
 
      else goto __pyx_L5_argtuple_error;
12001
 
      case  1:
12002
 
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
12003
 
      if (likely(values[1])) kw_args--;
12004
 
      else {
12005
 
        __Pyx_RaiseArgtupleInvalid("add_output_header", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12006
 
      }
12007
 
    }
12008
 
    if (unlikely(kw_args > 0)) {
12009
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add_output_header") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12010
 
    }
12011
 
    __pyx_v_key = __Pyx_PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12012
 
    __pyx_v_value = __Pyx_PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_value) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12013
 
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
12014
 
    goto __pyx_L5_argtuple_error;
12015
 
  } else {
12016
 
    __pyx_v_key = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12017
 
    __pyx_v_value = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((!__pyx_v_value) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12018
 
  }
12019
 
  goto __pyx_L4_argument_unpacking_done;
12020
 
  __pyx_L5_argtuple_error:;
12021
 
  __Pyx_RaiseArgtupleInvalid("add_output_header", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12022
 
  __pyx_L3_error:;
12023
 
  __Pyx_AddTraceback("gevent.core.http_request.add_output_header");
12024
 
  return NULL;
12025
 
  __pyx_L4_argument_unpacking_done:;
12026
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
12027
 
 
12028
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":387
12029
 
 * 
12030
 
 *     def add_output_header(self, char* key, char* value):
12031
 
 *         if not self.__obj:             # <<<<<<<<<<<<<<
12032
 
 *             raise HttpRequestDeleted
12033
 
 *         if evhttp_add_header(self.__obj.output_headers, key, value):
12034
 
 */
12035
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
12036
 
  if (__pyx_t_1) {
12037
 
 
12038
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":388
12039
 
 *     def add_output_header(self, char* key, char* value):
12040
 
 *         if not self.__obj:
12041
 
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
12042
 
 *         if evhttp_add_header(self.__obj.output_headers, key, value):
12043
 
 *             raise RuntimeError('Internal error in evhttp_add_header')
12044
 
 */
12045
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12046
 
    __Pyx_GOTREF(__pyx_t_2);
12047
 
    __Pyx_Raise(__pyx_t_2, 0, 0);
12048
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12049
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12050
 
    goto __pyx_L6;
12051
 
  }
12052
 
  __pyx_L6:;
12053
 
 
12054
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":389
12055
 
 *         if not self.__obj:
12056
 
 *             raise HttpRequestDeleted
12057
 
 *         if evhttp_add_header(self.__obj.output_headers, key, value):             # <<<<<<<<<<<<<<
12058
 
 *             raise RuntimeError('Internal error in evhttp_add_header')
12059
 
 * 
12060
 
 */
12061
 
  __pyx_t_3 = evhttp_add_header(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->output_headers, __pyx_v_key, __pyx_v_value);
12062
 
  if (__pyx_t_3) {
12063
 
 
12064
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":390
12065
 
 *             raise HttpRequestDeleted
12066
 
 *         if evhttp_add_header(self.__obj.output_headers, key, value):
12067
 
 *             raise RuntimeError('Internal error in evhttp_add_header')             # <<<<<<<<<<<<<<
12068
 
 * 
12069
 
 *     def remove_input_header(self, char* key):
12070
 
 */
12071
 
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12072
 
    __Pyx_GOTREF(__pyx_t_2);
12073
 
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_31));
12074
 
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_kp_s_31));
12075
 
    __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_31));
12076
 
    __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12077
 
    __Pyx_GOTREF(__pyx_t_4);
12078
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12079
 
    __Pyx_Raise(__pyx_t_4, 0, 0);
12080
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12081
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12082
 
    goto __pyx_L7;
12083
 
  }
12084
 
  __pyx_L7:;
12085
 
 
12086
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12087
 
  goto __pyx_L0;
12088
 
  __pyx_L1_error:;
12089
 
  __Pyx_XDECREF(__pyx_t_2);
12090
 
  __Pyx_XDECREF(__pyx_t_4);
12091
 
  __Pyx_AddTraceback("gevent.core.http_request.add_output_header");
12092
 
  __pyx_r = NULL;
12093
 
  __pyx_L0:;
12094
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
12095
 
  __Pyx_XGIVEREF(__pyx_r);
12096
 
  __Pyx_RefNannyFinishContext();
12097
 
  return __pyx_r;
12098
 
}
12099
 
 
12100
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":392
12101
 
 *             raise RuntimeError('Internal error in evhttp_add_header')
12102
 
 * 
12103
 
 *     def remove_input_header(self, char* key):             # <<<<<<<<<<<<<<
12104
 
 *         """Return True if header was found and removed"""
12105
 
 *         if not self.__obj:
12106
 
 */
12107
 
 
12108
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_remove_input_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_key); /*proto*/
12109
 
static char __pyx_doc_6gevent_4core_12http_request_remove_input_header[] = "Return True if header was found and removed";
12110
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_remove_input_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_key) {
12111
 
  char *__pyx_v_key;
12112
 
  PyObject *__pyx_r = NULL;
12113
 
  int __pyx_t_1;
12114
 
  PyObject *__pyx_t_2 = NULL;
12115
 
  __Pyx_RefNannySetupContext("remove_input_header");
12116
 
  assert(__pyx_arg_key); {
12117
 
    __pyx_v_key = __Pyx_PyBytes_AsString(__pyx_arg_key); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12118
 
  }
12119
 
  goto __pyx_L4_argument_unpacking_done;
12120
 
  __pyx_L3_error:;
12121
 
  __Pyx_AddTraceback("gevent.core.http_request.remove_input_header");
12122
 
  return NULL;
12123
 
  __pyx_L4_argument_unpacking_done:;
12124
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
12125
 
 
12126
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":394
12127
 
 *     def remove_input_header(self, char* key):
12128
 
 *         """Return True if header was found and removed"""
12129
 
 *         if not self.__obj:             # <<<<<<<<<<<<<<
12130
 
 *             raise HttpRequestDeleted
12131
 
 *         return True if 0 == evhttp_remove_header(self.__obj.input_headers, key) else False
12132
 
 */
12133
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
12134
 
  if (__pyx_t_1) {
12135
 
 
12136
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":395
12137
 
 *         """Return True if header was found and removed"""
12138
 
 *         if not self.__obj:
12139
 
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
12140
 
 *         return True if 0 == evhttp_remove_header(self.__obj.input_headers, key) else False
12141
 
 * 
12142
 
 */
12143
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12144
 
    __Pyx_GOTREF(__pyx_t_2);
12145
 
    __Pyx_Raise(__pyx_t_2, 0, 0);
12146
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12147
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12148
 
    goto __pyx_L5;
12149
 
  }
12150
 
  __pyx_L5:;
12151
 
 
12152
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":396
12153
 
 *         if not self.__obj:
12154
 
 *             raise HttpRequestDeleted
12155
 
 *         return True if 0 == evhttp_remove_header(self.__obj.input_headers, key) else False             # <<<<<<<<<<<<<<
12156
 
 * 
12157
 
 *     def remove_output_header(self, char* key):
12158
 
 */
12159
 
  __Pyx_XDECREF(__pyx_r);
12160
 
  if ((0 == evhttp_remove_header(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->input_headers, __pyx_v_key))) {
12161
 
    __pyx_t_1 = 1;
12162
 
  } else {
12163
 
    __pyx_t_1 = 0;
12164
 
  }
12165
 
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12166
 
  __Pyx_GOTREF(__pyx_t_2);
12167
 
  __pyx_r = __pyx_t_2;
12168
 
  __pyx_t_2 = 0;
12169
 
  goto __pyx_L0;
12170
 
 
12171
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12172
 
  goto __pyx_L0;
12173
 
  __pyx_L1_error:;
12174
 
  __Pyx_XDECREF(__pyx_t_2);
12175
 
  __Pyx_AddTraceback("gevent.core.http_request.remove_input_header");
12176
 
  __pyx_r = NULL;
12177
 
  __pyx_L0:;
12178
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
12179
 
  __Pyx_XGIVEREF(__pyx_r);
12180
 
  __Pyx_RefNannyFinishContext();
12181
 
  return __pyx_r;
12182
 
}
12183
 
 
12184
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":398
12185
 
 *         return True if 0 == evhttp_remove_header(self.__obj.input_headers, key) else False
12186
 
 * 
12187
 
 *     def remove_output_header(self, char* key):             # <<<<<<<<<<<<<<
12188
 
 *         """Return True if header was found and removed"""
12189
 
 *         if not self.__obj:
12190
 
 */
12191
 
 
12192
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_remove_output_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_key); /*proto*/
12193
 
static char __pyx_doc_6gevent_4core_12http_request_remove_output_header[] = "Return True if header was found and removed";
12194
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_remove_output_header(PyObject *__pyx_v_self, PyObject *__pyx_arg_key) {
12195
 
  char *__pyx_v_key;
12196
 
  PyObject *__pyx_r = NULL;
12197
 
  int __pyx_t_1;
12198
 
  PyObject *__pyx_t_2 = NULL;
12199
 
  __Pyx_RefNannySetupContext("remove_output_header");
12200
 
  assert(__pyx_arg_key); {
12201
 
    __pyx_v_key = __Pyx_PyBytes_AsString(__pyx_arg_key); if (unlikely((!__pyx_v_key) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12202
 
  }
12203
 
  goto __pyx_L4_argument_unpacking_done;
12204
 
  __pyx_L3_error:;
12205
 
  __Pyx_AddTraceback("gevent.core.http_request.remove_output_header");
12206
 
  return NULL;
12207
 
  __pyx_L4_argument_unpacking_done:;
12208
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
12209
 
 
12210
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":400
12211
 
 *     def remove_output_header(self, char* key):
12212
 
 *         """Return True if header was found and removed"""
12213
 
 *         if not self.__obj:             # <<<<<<<<<<<<<<
12214
 
 *             raise HttpRequestDeleted
12215
 
 *         return True if 0 == evhttp_remove_header(self.__obj.output_headers, key) else False
12216
 
 */
12217
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
12218
 
  if (__pyx_t_1) {
12219
 
 
12220
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":401
12221
 
 *         """Return True if header was found and removed"""
12222
 
 *         if not self.__obj:
12223
 
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
12224
 
 *         return True if 0 == evhttp_remove_header(self.__obj.output_headers, key) else False
12225
 
 * 
12226
 
 */
12227
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12228
 
    __Pyx_GOTREF(__pyx_t_2);
12229
 
    __Pyx_Raise(__pyx_t_2, 0, 0);
12230
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12231
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12232
 
    goto __pyx_L5;
12233
 
  }
12234
 
  __pyx_L5:;
12235
 
 
12236
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":402
12237
 
 *         if not self.__obj:
12238
 
 *             raise HttpRequestDeleted
12239
 
 *         return True if 0 == evhttp_remove_header(self.__obj.output_headers, key) else False             # <<<<<<<<<<<<<<
12240
 
 * 
12241
 
 *     def clear_input_headers(self):
12242
 
 */
12243
 
  __Pyx_XDECREF(__pyx_r);
12244
 
  if ((0 == evhttp_remove_header(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->output_headers, __pyx_v_key))) {
12245
 
    __pyx_t_1 = 1;
12246
 
  } else {
12247
 
    __pyx_t_1 = 0;
12248
 
  }
12249
 
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12250
 
  __Pyx_GOTREF(__pyx_t_2);
12251
 
  __pyx_r = __pyx_t_2;
12252
 
  __pyx_t_2 = 0;
12253
 
  goto __pyx_L0;
12254
 
 
12255
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12256
 
  goto __pyx_L0;
12257
 
  __pyx_L1_error:;
12258
 
  __Pyx_XDECREF(__pyx_t_2);
12259
 
  __Pyx_AddTraceback("gevent.core.http_request.remove_output_header");
12260
 
  __pyx_r = NULL;
12261
 
  __pyx_L0:;
12262
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
12263
 
  __Pyx_XGIVEREF(__pyx_r);
12264
 
  __Pyx_RefNannyFinishContext();
12265
 
  return __pyx_r;
12266
 
}
12267
 
 
12268
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":404
12269
 
 *         return True if 0 == evhttp_remove_header(self.__obj.output_headers, key) else False
12270
 
 * 
12271
 
 *     def clear_input_headers(self):             # <<<<<<<<<<<<<<
12272
 
 *         if not self.__obj:
12273
 
 *             raise HttpRequestDeleted
12274
 
 */
12275
 
 
12276
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_clear_input_headers(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
12277
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_clear_input_headers(PyObject *__pyx_v_self, PyObject *unused) {
12278
 
  PyObject *__pyx_r = NULL;
12279
 
  int __pyx_t_1;
12280
 
  PyObject *__pyx_t_2 = NULL;
12281
 
  __Pyx_RefNannySetupContext("clear_input_headers");
12282
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
12283
 
 
12284
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":405
12285
 
 * 
12286
 
 *     def clear_input_headers(self):
12287
 
 *         if not self.__obj:             # <<<<<<<<<<<<<<
12288
 
 *             raise HttpRequestDeleted
12289
 
 *         evhttp_clear_headers(self.__obj.input_headers)
12290
 
 */
12291
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
12292
 
  if (__pyx_t_1) {
12293
 
 
12294
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":406
12295
 
 *     def clear_input_headers(self):
12296
 
 *         if not self.__obj:
12297
 
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
12298
 
 *         evhttp_clear_headers(self.__obj.input_headers)
12299
 
 * 
12300
 
 */
12301
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12302
 
    __Pyx_GOTREF(__pyx_t_2);
12303
 
    __Pyx_Raise(__pyx_t_2, 0, 0);
12304
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12305
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12306
 
    goto __pyx_L5;
12307
 
  }
12308
 
  __pyx_L5:;
12309
 
 
12310
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":407
12311
 
 *         if not self.__obj:
12312
 
 *             raise HttpRequestDeleted
12313
 
 *         evhttp_clear_headers(self.__obj.input_headers)             # <<<<<<<<<<<<<<
12314
 
 * 
12315
 
 *     def clear_output_headers(self):
12316
 
 */
12317
 
  evhttp_clear_headers(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->input_headers);
12318
 
 
12319
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12320
 
  goto __pyx_L0;
12321
 
  __pyx_L1_error:;
12322
 
  __Pyx_XDECREF(__pyx_t_2);
12323
 
  __Pyx_AddTraceback("gevent.core.http_request.clear_input_headers");
12324
 
  __pyx_r = NULL;
12325
 
  __pyx_L0:;
12326
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
12327
 
  __Pyx_XGIVEREF(__pyx_r);
12328
 
  __Pyx_RefNannyFinishContext();
12329
 
  return __pyx_r;
12330
 
}
12331
 
 
12332
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":409
12333
 
 *         evhttp_clear_headers(self.__obj.input_headers)
12334
 
 * 
12335
 
 *     def clear_output_headers(self):             # <<<<<<<<<<<<<<
12336
 
 *         if not self.__obj:
12337
 
 *             raise HttpRequestDeleted
12338
 
 */
12339
 
 
12340
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_clear_output_headers(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
12341
 
static PyObject *__pyx_pf_6gevent_4core_12http_request_clear_output_headers(PyObject *__pyx_v_self, PyObject *unused) {
12342
 
  PyObject *__pyx_r = NULL;
12343
 
  int __pyx_t_1;
12344
 
  PyObject *__pyx_t_2 = NULL;
12345
 
  __Pyx_RefNannySetupContext("clear_output_headers");
12346
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
12347
 
 
12348
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":410
12349
 
 * 
12350
 
 *     def clear_output_headers(self):
12351
 
 *         if not self.__obj:             # <<<<<<<<<<<<<<
12352
 
 *             raise HttpRequestDeleted
12353
 
 *         evhttp_clear_headers(self.__obj.output_headers)
12354
 
 */
12355
 
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj != 0));
12356
 
  if (__pyx_t_1) {
12357
 
 
12358
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":411
12359
 
 *     def clear_output_headers(self):
12360
 
 *         if not self.__obj:
12361
 
 *             raise HttpRequestDeleted             # <<<<<<<<<<<<<<
12362
 
 *         evhttp_clear_headers(self.__obj.output_headers)
12363
 
 * 
12364
 
 */
12365
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__HttpRequestDeleted); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12366
 
    __Pyx_GOTREF(__pyx_t_2);
12367
 
    __Pyx_Raise(__pyx_t_2, 0, 0);
12368
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12369
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12370
 
    goto __pyx_L5;
12371
 
  }
12372
 
  __pyx_L5:;
12373
 
 
12374
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":412
12375
 
 *         if not self.__obj:
12376
 
 *             raise HttpRequestDeleted
12377
 
 *         evhttp_clear_headers(self.__obj.output_headers)             # <<<<<<<<<<<<<<
12378
 
 * 
12379
 
 * 
12380
 
 */
12381
 
  evhttp_clear_headers(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->__pyx___obj->output_headers);
12382
 
 
12383
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12384
 
  goto __pyx_L0;
12385
 
  __pyx_L1_error:;
12386
 
  __Pyx_XDECREF(__pyx_t_2);
12387
 
  __Pyx_AddTraceback("gevent.core.http_request.clear_output_headers");
12388
 
  __pyx_r = NULL;
12389
 
  __pyx_L0:;
12390
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
12391
 
  __Pyx_XGIVEREF(__pyx_r);
12392
 
  __Pyx_RefNannyFinishContext();
12393
 
  return __pyx_r;
12394
 
}
12395
 
 
12396
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":419
12397
 
 *     cdef evhttp_connection* __obj
12398
 
 * 
12399
 
 *     def __init__(self, size_t _obj):             # <<<<<<<<<<<<<<
12400
 
 *         self.__obj = <evhttp_connection*>_obj
12401
 
 * 
 
12646
  __Pyx_XGIVEREF(__pyx_r);
 
12647
  __Pyx_RefNannyFinishContext();
 
12648
  return __pyx_r;
 
12649
}
 
12650
 
 
12651
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":401
 
12652
 *     # prefer gevent.http and gevent.wsgi which should be safe
 
12653
 * 
 
12654
 *     cdef public object default_response_headers             # <<<<<<<<<<<<<<
 
12655
 * 
 
12656
 *     def __init__(self, size_t obj, object default_response_headers=[]):
 
12657
 */
 
12658
 
 
12659
static PyObject *__pyx_pf_6gevent_4core_12http_request_24default_response_headers___get__(PyObject *__pyx_v_self); /*proto*/
 
12660
static PyObject *__pyx_pf_6gevent_4core_12http_request_24default_response_headers___get__(PyObject *__pyx_v_self) {
 
12661
  PyObject *__pyx_r = NULL;
 
12662
  __Pyx_RefNannySetupContext("__get__");
 
12663
  __Pyx_XDECREF(__pyx_r);
 
12664
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers);
 
12665
  __pyx_r = ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers;
 
12666
  goto __pyx_L0;
 
12667
 
 
12668
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
12669
  __pyx_L0:;
 
12670
  __Pyx_XGIVEREF(__pyx_r);
 
12671
  __Pyx_RefNannyFinishContext();
 
12672
  return __pyx_r;
 
12673
}
 
12674
 
 
12675
static int __pyx_pf_6gevent_4core_12http_request_24default_response_headers_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
 
12676
static int __pyx_pf_6gevent_4core_12http_request_24default_response_headers_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
 
12677
  int __pyx_r;
 
12678
  __Pyx_RefNannySetupContext("__set__");
 
12679
  __Pyx_INCREF(__pyx_v_value);
 
12680
  __Pyx_GIVEREF(__pyx_v_value);
 
12681
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers);
 
12682
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers);
 
12683
  ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers = __pyx_v_value;
 
12684
 
 
12685
  __pyx_r = 0;
 
12686
  __Pyx_RefNannyFinishContext();
 
12687
  return __pyx_r;
 
12688
}
 
12689
 
 
12690
static int __pyx_pf_6gevent_4core_12http_request_24default_response_headers_2__del__(PyObject *__pyx_v_self); /*proto*/
 
12691
static int __pyx_pf_6gevent_4core_12http_request_24default_response_headers_2__del__(PyObject *__pyx_v_self) {
 
12692
  int __pyx_r;
 
12693
  __Pyx_RefNannySetupContext("__del__");
 
12694
  __Pyx_INCREF(Py_None);
 
12695
  __Pyx_GIVEREF(Py_None);
 
12696
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers);
 
12697
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers);
 
12698
  ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_v_self)->default_response_headers = Py_None;
 
12699
 
 
12700
  __pyx_r = 0;
 
12701
  __Pyx_RefNannyFinishContext();
 
12702
  return __pyx_r;
 
12703
}
 
12704
 
 
12705
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":473
 
12706
 *     cdef int _incref
 
12707
 * 
 
12708
 *     def __init__(self, object callback=None, size_t obj=0):             # <<<<<<<<<<<<<<
 
12709
 *         self._incref = 0
 
12710
 *         self.callback = callback
 
12711
 */
 
12712
 
 
12713
static int __pyx_pf_6gevent_4core_19http_request_client___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
12714
static int __pyx_pf_6gevent_4core_19http_request_client___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
12715
  PyObject *__pyx_v_callback = 0;
 
12716
  size_t __pyx_v_obj;
 
12717
  int __pyx_r;
 
12718
  int __pyx_t_1;
 
12719
  PyObject *__pyx_t_2 = NULL;
 
12720
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__callback,&__pyx_n_s__obj,0};
 
12721
  __Pyx_RefNannySetupContext("__init__");
 
12722
  if (unlikely(__pyx_kwds)) {
 
12723
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
 
12724
    PyObject* values[2] = {0,0};
 
12725
    values[0] = ((PyObject *)Py_None);
 
12726
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
12727
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
 
12728
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
 
12729
      case  0: break;
 
12730
      default: goto __pyx_L5_argtuple_error;
 
12731
    }
 
12732
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
12733
      case  0:
 
12734
      if (kw_args > 0) {
 
12735
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__callback);
 
12736
        if (value) { values[0] = value; kw_args--; }
 
12737
      }
 
12738
      case  1:
 
12739
      if (kw_args > 0) {
 
12740
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__obj);
 
12741
        if (value) { values[1] = value; kw_args--; }
 
12742
      }
 
12743
    }
 
12744
    if (unlikely(kw_args > 0)) {
 
12745
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12746
    }
 
12747
    __pyx_v_callback = values[0];
 
12748
    if (values[1]) {
 
12749
      __pyx_v_obj = __Pyx_PyInt_AsSize_t(values[1]); if (unlikely((__pyx_v_obj == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12750
    } else {
 
12751
      __pyx_v_obj = ((size_t)0);
 
12752
    }
 
12753
  } else {
 
12754
    __pyx_v_callback = ((PyObject *)Py_None);
 
12755
    __pyx_v_obj = ((size_t)0);
 
12756
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
12757
      case  2: __pyx_v_obj = __Pyx_PyInt_AsSize_t(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_obj == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12758
      case  1: __pyx_v_callback = PyTuple_GET_ITEM(__pyx_args, 0);
 
12759
      case  0: break;
 
12760
      default: goto __pyx_L5_argtuple_error;
 
12761
    }
 
12762
  }
 
12763
  goto __pyx_L4_argument_unpacking_done;
 
12764
  __pyx_L5_argtuple_error:;
 
12765
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
12766
  __pyx_L3_error:;
 
12767
  __Pyx_AddTraceback("gevent.core.http_request_client.__init__");
 
12768
  __Pyx_RefNannyFinishContext();
 
12769
  return -1;
 
12770
  __pyx_L4_argument_unpacking_done:;
 
12771
 
 
12772
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":474
 
12773
 * 
 
12774
 *     def __init__(self, object callback=None, size_t obj=0):
 
12775
 *         self._incref = 0             # <<<<<<<<<<<<<<
 
12776
 *         self.callback = callback
 
12777
 *         if obj:
 
12778
 */
 
12779
  ((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->_incref = 0;
 
12780
 
 
12781
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":475
 
12782
 *     def __init__(self, object callback=None, size_t obj=0):
 
12783
 *         self._incref = 0
 
12784
 *         self.callback = callback             # <<<<<<<<<<<<<<
 
12785
 *         if obj:
 
12786
 *             self.__obj = <evhttp_request*>obj
 
12787
 */
 
12788
  __Pyx_INCREF(__pyx_v_callback);
 
12789
  __Pyx_GIVEREF(__pyx_v_callback);
 
12790
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->callback);
 
12791
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->callback);
 
12792
  ((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->callback = __pyx_v_callback;
 
12793
 
 
12794
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":476
 
12795
 *         self._incref = 0
 
12796
 *         self.callback = callback
 
12797
 *         if obj:             # <<<<<<<<<<<<<<
 
12798
 *             self.__obj = <evhttp_request*>obj
 
12799
 *             self._owned = 0
 
12800
 */
 
12801
  if (__pyx_v_obj) {
 
12802
 
 
12803
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":477
 
12804
 *         self.callback = callback
 
12805
 *         if obj:
 
12806
 *             self.__obj = <evhttp_request*>obj             # <<<<<<<<<<<<<<
 
12807
 *             self._owned = 0
 
12808
 *         else:
 
12809
 */
 
12810
    ((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->__pyx_base.__pyx___obj = ((struct evhttp_request *)__pyx_v_obj);
 
12811
 
 
12812
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":478
 
12813
 *         if obj:
 
12814
 *             self.__obj = <evhttp_request*>obj
 
12815
 *             self._owned = 0             # <<<<<<<<<<<<<<
 
12816
 *         else:
 
12817
 *             self.__obj = evhttp_request_new(_http_request_cb_handler, <void*>self)
 
12818
 */
 
12819
    ((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->_owned = 0;
 
12820
    goto __pyx_L6;
 
12821
  }
 
12822
  /*else*/ {
 
12823
 
 
12824
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":480
 
12825
 *             self._owned = 0
 
12826
 *         else:
 
12827
 *             self.__obj = evhttp_request_new(_http_request_cb_handler, <void*>self)             # <<<<<<<<<<<<<<
 
12828
 *             if not self.__obj:
 
12829
 *                 raise IOError('evhttp_request_new() failed')
 
12830
 */
 
12831
    ((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->__pyx_base.__pyx___obj = evhttp_request_new(__pyx_f_6gevent_4core__http_request_cb_handler, ((void *)__pyx_v_self));
 
12832
 
 
12833
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":481
 
12834
 *         else:
 
12835
 *             self.__obj = evhttp_request_new(_http_request_cb_handler, <void*>self)
 
12836
 *             if not self.__obj:             # <<<<<<<<<<<<<<
 
12837
 *                 raise IOError('evhttp_request_new() failed')
 
12838
 *             self._owned = 1
 
12839
 */
 
12840
    __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->__pyx_base.__pyx___obj != 0));
 
12841
    if (__pyx_t_1) {
 
12842
 
 
12843
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":482
 
12844
 *             self.__obj = evhttp_request_new(_http_request_cb_handler, <void*>self)
 
12845
 *             if not self.__obj:
 
12846
 *                 raise IOError('evhttp_request_new() failed')             # <<<<<<<<<<<<<<
 
12847
 *             self._owned = 1
 
12848
 *             self._addref()
 
12849
 */
 
12850
      __pyx_t_2 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_k_tuple_37), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12851
      __Pyx_GOTREF(__pyx_t_2);
 
12852
      __Pyx_Raise(__pyx_t_2, 0, 0);
 
12853
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
12854
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12855
      goto __pyx_L7;
 
12856
    }
 
12857
    __pyx_L7:;
 
12858
 
 
12859
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":483
 
12860
 *             if not self.__obj:
 
12861
 *                 raise IOError('evhttp_request_new() failed')
 
12862
 *             self._owned = 1             # <<<<<<<<<<<<<<
 
12863
 *             self._addref()
 
12864
 * 
 
12865
 */
 
12866
    ((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->_owned = 1;
 
12867
 
 
12868
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":484
 
12869
 *                 raise IOError('evhttp_request_new() failed')
 
12870
 *             self._owned = 1
 
12871
 *             self._addref()             # <<<<<<<<<<<<<<
 
12872
 * 
 
12873
 *     cdef _addref(self):
 
12874
 */
 
12875
    __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_4core_http_request_client *)((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->__pyx_vtab)->_addref(((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
12876
    __Pyx_GOTREF(__pyx_t_2);
 
12877
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
12878
  }
 
12879
  __pyx_L6:;
 
12880
 
 
12881
  __pyx_r = 0;
 
12882
  goto __pyx_L0;
 
12883
  __pyx_L1_error:;
 
12884
  __Pyx_XDECREF(__pyx_t_2);
 
12885
  __Pyx_AddTraceback("gevent.core.http_request_client.__init__");
 
12886
  __pyx_r = -1;
 
12887
  __pyx_L0:;
 
12888
  __Pyx_RefNannyFinishContext();
 
12889
  return __pyx_r;
 
12890
}
 
12891
 
 
12892
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":486
 
12893
 *             self._addref()
 
12894
 * 
 
12895
 *     cdef _addref(self):             # <<<<<<<<<<<<<<
 
12896
 *         if self._incref <= 0:
 
12897
 *             Py_INCREF(<PyObjectPtr>self)
 
12898
 */
 
12899
 
 
12900
static  PyObject *__pyx_f_6gevent_4core_19http_request_client__addref(struct __pyx_obj_6gevent_4core_http_request_client *__pyx_v_self) {
 
12901
  PyObject *__pyx_r = NULL;
 
12902
  int __pyx_t_1;
 
12903
  __Pyx_RefNannySetupContext("_addref");
 
12904
 
 
12905
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":487
 
12906
 * 
 
12907
 *     cdef _addref(self):
 
12908
 *         if self._incref <= 0:             # <<<<<<<<<<<<<<
 
12909
 *             Py_INCREF(<PyObjectPtr>self)
 
12910
 *             self._incref += 1
 
12911
 */
 
12912
  __pyx_t_1 = (__pyx_v_self->_incref <= 0);
 
12913
  if (__pyx_t_1) {
 
12914
 
 
12915
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":488
 
12916
 *     cdef _addref(self):
 
12917
 *         if self._incref <= 0:
 
12918
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 
12919
 *             self._incref += 1
 
12920
 * 
 
12921
 */
 
12922
    Py_INCREF(((PyObject*)__pyx_v_self));
 
12923
 
 
12924
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":489
 
12925
 *         if self._incref <= 0:
 
12926
 *             Py_INCREF(<PyObjectPtr>self)
 
12927
 *             self._incref += 1             # <<<<<<<<<<<<<<
 
12928
 * 
 
12929
 *     cdef _delref(self):
 
12930
 */
 
12931
    __pyx_v_self->_incref = (__pyx_v_self->_incref + 1);
 
12932
    goto __pyx_L3;
 
12933
  }
 
12934
  __pyx_L3:;
 
12935
 
 
12936
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
12937
  __Pyx_XGIVEREF(__pyx_r);
 
12938
  __Pyx_RefNannyFinishContext();
 
12939
  return __pyx_r;
 
12940
}
 
12941
 
 
12942
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":491
 
12943
 *             self._incref += 1
 
12944
 * 
 
12945
 *     cdef _delref(self):             # <<<<<<<<<<<<<<
 
12946
 *         if self._incref > 0:
 
12947
 *             Py_DECREF(<PyObjectPtr>self)
 
12948
 */
 
12949
 
 
12950
static  PyObject *__pyx_f_6gevent_4core_19http_request_client__delref(struct __pyx_obj_6gevent_4core_http_request_client *__pyx_v_self) {
 
12951
  PyObject *__pyx_r = NULL;
 
12952
  int __pyx_t_1;
 
12953
  __Pyx_RefNannySetupContext("_delref");
 
12954
 
 
12955
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":492
 
12956
 * 
 
12957
 *     cdef _delref(self):
 
12958
 *         if self._incref > 0:             # <<<<<<<<<<<<<<
 
12959
 *             Py_DECREF(<PyObjectPtr>self)
 
12960
 *             self._incref -= 1
 
12961
 */
 
12962
  __pyx_t_1 = (__pyx_v_self->_incref > 0);
 
12963
  if (__pyx_t_1) {
 
12964
 
 
12965
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":493
 
12966
 *     cdef _delref(self):
 
12967
 *         if self._incref > 0:
 
12968
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 
12969
 *             self._incref -= 1
 
12970
 *         self.callback = None
 
12971
 */
 
12972
    Py_DECREF(((PyObject*)__pyx_v_self));
 
12973
 
 
12974
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":494
 
12975
 *         if self._incref > 0:
 
12976
 *             Py_DECREF(<PyObjectPtr>self)
 
12977
 *             self._incref -= 1             # <<<<<<<<<<<<<<
 
12978
 *         self.callback = None
 
12979
 * 
 
12980
 */
 
12981
    __pyx_v_self->_incref = (__pyx_v_self->_incref - 1);
 
12982
    goto __pyx_L3;
 
12983
  }
 
12984
  __pyx_L3:;
 
12985
 
 
12986
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":495
 
12987
 *             Py_DECREF(<PyObjectPtr>self)
 
12988
 *             self._incref -= 1
 
12989
 *         self.callback = None             # <<<<<<<<<<<<<<
 
12990
 * 
 
12991
 *     def __dealloc__(self):
 
12992
 */
 
12993
  __Pyx_INCREF(Py_None);
 
12994
  __Pyx_GIVEREF(Py_None);
 
12995
  __Pyx_GOTREF(__pyx_v_self->callback);
 
12996
  __Pyx_DECREF(__pyx_v_self->callback);
 
12997
  __pyx_v_self->callback = Py_None;
 
12998
 
 
12999
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
13000
  __Pyx_XGIVEREF(__pyx_r);
 
13001
  __Pyx_RefNannyFinishContext();
 
13002
  return __pyx_r;
 
13003
}
 
13004
 
 
13005
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":497
 
13006
 *         self.callback = None
 
13007
 * 
 
13008
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 
13009
 *         cdef evhttp_request* obj = self.__obj
 
13010
 *         if obj != NULL:
 
13011
 */
 
13012
 
 
13013
static void __pyx_pf_6gevent_4core_19http_request_client_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
 
13014
static void __pyx_pf_6gevent_4core_19http_request_client_1__dealloc__(PyObject *__pyx_v_self) {
 
13015
  struct evhttp_request *__pyx_v_obj;
 
13016
  int __pyx_t_1;
 
13017
  PyObject *__pyx_t_2 = NULL;
 
13018
  PyObject *__pyx_t_3 = NULL;
 
13019
  __Pyx_RefNannySetupContext("__dealloc__");
 
13020
 
 
13021
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":498
 
13022
 * 
 
13023
 *     def __dealloc__(self):
 
13024
 *         cdef evhttp_request* obj = self.__obj             # <<<<<<<<<<<<<<
 
13025
 *         if obj != NULL:
 
13026
 *             self.detach()
 
13027
 */
 
13028
  __pyx_v_obj = ((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->__pyx_base.__pyx___obj;
 
13029
 
 
13030
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":499
 
13031
 *     def __dealloc__(self):
 
13032
 *         cdef evhttp_request* obj = self.__obj
 
13033
 *         if obj != NULL:             # <<<<<<<<<<<<<<
 
13034
 *             self.detach()
 
13035
 *             if self._owned:
 
13036
 */
 
13037
  __pyx_t_1 = (__pyx_v_obj != NULL);
 
13038
  if (__pyx_t_1) {
 
13039
 
 
13040
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":500
 
13041
 *         cdef evhttp_request* obj = self.__obj
 
13042
 *         if obj != NULL:
 
13043
 *             self.detach()             # <<<<<<<<<<<<<<
 
13044
 *             if self._owned:
 
13045
 *                 evhttp_request_free(obj)
 
13046
 */
 
13047
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__detach); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13048
    __Pyx_GOTREF(__pyx_t_2);
 
13049
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13050
    __Pyx_GOTREF(__pyx_t_3);
 
13051
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
13052
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
13053
 
 
13054
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":501
 
13055
 *         if obj != NULL:
 
13056
 *             self.detach()
 
13057
 *             if self._owned:             # <<<<<<<<<<<<<<
 
13058
 *                 evhttp_request_free(obj)
 
13059
 * 
 
13060
 */
 
13061
    if (((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->_owned) {
 
13062
 
 
13063
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":502
 
13064
 *             self.detach()
 
13065
 *             if self._owned:
 
13066
 *                 evhttp_request_free(obj)             # <<<<<<<<<<<<<<
 
13067
 * 
 
13068
 * 
 
13069
 */
 
13070
      evhttp_request_free(__pyx_v_obj);
 
13071
      goto __pyx_L6;
 
13072
    }
 
13073
    __pyx_L6:;
 
13074
    goto __pyx_L5;
 
13075
  }
 
13076
  __pyx_L5:;
 
13077
 
 
13078
  goto __pyx_L0;
 
13079
  __pyx_L1_error:;
 
13080
  __Pyx_XDECREF(__pyx_t_2);
 
13081
  __Pyx_XDECREF(__pyx_t_3);
 
13082
  __Pyx_AddTraceback("gevent.core.http_request_client.__dealloc__");
 
13083
  __pyx_L0:;
 
13084
  __Pyx_RefNannyFinishContext();
 
13085
}
 
13086
 
 
13087
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":469
 
13088
 *     """Wrapper around libevent's :class:`evhttp_request` structure."""
 
13089
 * 
 
13090
 *     cdef public int _owned             # <<<<<<<<<<<<<<
 
13091
 *     cdef public callback
 
13092
 *     cdef int _incref
 
13093
 */
 
13094
 
 
13095
static PyObject *__pyx_pf_6gevent_4core_19http_request_client_6_owned___get__(PyObject *__pyx_v_self); /*proto*/
 
13096
static PyObject *__pyx_pf_6gevent_4core_19http_request_client_6_owned___get__(PyObject *__pyx_v_self) {
 
13097
  PyObject *__pyx_r = NULL;
 
13098
  PyObject *__pyx_t_1 = NULL;
 
13099
  __Pyx_RefNannySetupContext("__get__");
 
13100
  __Pyx_XDECREF(__pyx_r);
 
13101
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->_owned); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13102
  __Pyx_GOTREF(__pyx_t_1);
 
13103
  __pyx_r = __pyx_t_1;
 
13104
  __pyx_t_1 = 0;
 
13105
  goto __pyx_L0;
 
13106
 
 
13107
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
13108
  goto __pyx_L0;
 
13109
  __pyx_L1_error:;
 
13110
  __Pyx_XDECREF(__pyx_t_1);
 
13111
  __Pyx_AddTraceback("gevent.core.http_request_client._owned.__get__");
 
13112
  __pyx_r = NULL;
 
13113
  __pyx_L0:;
 
13114
  __Pyx_XGIVEREF(__pyx_r);
 
13115
  __Pyx_RefNannyFinishContext();
 
13116
  return __pyx_r;
 
13117
}
 
13118
 
 
13119
static int __pyx_pf_6gevent_4core_19http_request_client_6_owned_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
 
13120
static int __pyx_pf_6gevent_4core_19http_request_client_6_owned_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
 
13121
  int __pyx_r;
 
13122
  int __pyx_t_1;
 
13123
  __Pyx_RefNannySetupContext("__set__");
 
13124
  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13125
  ((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->_owned = __pyx_t_1;
 
13126
 
 
13127
  __pyx_r = 0;
 
13128
  goto __pyx_L0;
 
13129
  __pyx_L1_error:;
 
13130
  __Pyx_AddTraceback("gevent.core.http_request_client._owned.__set__");
 
13131
  __pyx_r = -1;
 
13132
  __pyx_L0:;
 
13133
  __Pyx_RefNannyFinishContext();
 
13134
  return __pyx_r;
 
13135
}
 
13136
 
 
13137
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":470
 
13138
 * 
 
13139
 *     cdef public int _owned
 
13140
 *     cdef public callback             # <<<<<<<<<<<<<<
 
13141
 *     cdef int _incref
 
13142
 * 
 
13143
 */
 
13144
 
 
13145
static PyObject *__pyx_pf_6gevent_4core_19http_request_client_8callback___get__(PyObject *__pyx_v_self); /*proto*/
 
13146
static PyObject *__pyx_pf_6gevent_4core_19http_request_client_8callback___get__(PyObject *__pyx_v_self) {
 
13147
  PyObject *__pyx_r = NULL;
 
13148
  __Pyx_RefNannySetupContext("__get__");
 
13149
  __Pyx_XDECREF(__pyx_r);
 
13150
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->callback);
 
13151
  __pyx_r = ((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->callback;
 
13152
  goto __pyx_L0;
 
13153
 
 
13154
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
13155
  __pyx_L0:;
 
13156
  __Pyx_XGIVEREF(__pyx_r);
 
13157
  __Pyx_RefNannyFinishContext();
 
13158
  return __pyx_r;
 
13159
}
 
13160
 
 
13161
static int __pyx_pf_6gevent_4core_19http_request_client_8callback_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
 
13162
static int __pyx_pf_6gevent_4core_19http_request_client_8callback_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
 
13163
  int __pyx_r;
 
13164
  __Pyx_RefNannySetupContext("__set__");
 
13165
  __Pyx_INCREF(__pyx_v_value);
 
13166
  __Pyx_GIVEREF(__pyx_v_value);
 
13167
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->callback);
 
13168
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->callback);
 
13169
  ((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->callback = __pyx_v_value;
 
13170
 
 
13171
  __pyx_r = 0;
 
13172
  __Pyx_RefNannyFinishContext();
 
13173
  return __pyx_r;
 
13174
}
 
13175
 
 
13176
static int __pyx_pf_6gevent_4core_19http_request_client_8callback_2__del__(PyObject *__pyx_v_self); /*proto*/
 
13177
static int __pyx_pf_6gevent_4core_19http_request_client_8callback_2__del__(PyObject *__pyx_v_self) {
 
13178
  int __pyx_r;
 
13179
  __Pyx_RefNannySetupContext("__del__");
 
13180
  __Pyx_INCREF(Py_None);
 
13181
  __Pyx_GIVEREF(Py_None);
 
13182
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->callback);
 
13183
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->callback);
 
13184
  ((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_self)->callback = Py_None;
 
13185
 
 
13186
  __pyx_r = 0;
 
13187
  __Pyx_RefNannyFinishContext();
 
13188
  return __pyx_r;
 
13189
}
 
13190
 
 
13191
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":510
 
13192
 *     cdef public int _owned
 
13193
 * 
 
13194
 *     def __init__(self, size_t obj, owned=0):             # <<<<<<<<<<<<<<
 
13195
 *         self.__obj = <evhttp_connection*>obj
 
13196
 *         self._owned = owned
12402
13197
 */
12403
13198
 
12404
13199
static int __pyx_pf_6gevent_4core_15http_connection___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12405
13200
static int __pyx_pf_6gevent_4core_15http_connection___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12406
 
  size_t __pyx_v__obj;
 
13201
  size_t __pyx_v_obj;
 
13202
  PyObject *__pyx_v_owned = 0;
12407
13203
  int __pyx_r;
12408
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s___obj,0};
 
13204
  int __pyx_t_1;
 
13205
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__obj,&__pyx_n_s__owned,0};
12409
13206
  __Pyx_RefNannySetupContext("__init__");
12410
13207
  if (unlikely(__pyx_kwds)) {
12411
13208
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
12412
 
    PyObject* values[1] = {0};
 
13209
    PyObject* values[2] = {0,0};
 
13210
    values[1] = ((PyObject *)__pyx_int_0);
12413
13211
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
13212
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12414
13213
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12415
13214
      case  0: break;
12416
13215
      default: goto __pyx_L5_argtuple_error;
12417
13216
    }
12418
13217
    switch (PyTuple_GET_SIZE(__pyx_args)) {
12419
13218
      case  0:
12420
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s___obj);
 
13219
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__obj);
12421
13220
      if (likely(values[0])) kw_args--;
12422
13221
      else goto __pyx_L5_argtuple_error;
 
13222
      case  1:
 
13223
      if (kw_args > 0) {
 
13224
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__owned);
 
13225
        if (value) { values[1] = value; kw_args--; }
 
13226
      }
12423
13227
    }
12424
13228
    if (unlikely(kw_args > 0)) {
12425
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
13229
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12426
13230
    }
12427
 
    __pyx_v__obj = __Pyx_PyInt_AsSize_t(values[0]); if (unlikely((__pyx_v__obj == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12428
 
  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
12429
 
    goto __pyx_L5_argtuple_error;
 
13231
    __pyx_v_obj = __Pyx_PyInt_AsSize_t(values[0]); if (unlikely((__pyx_v_obj == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
13232
    __pyx_v_owned = values[1];
12430
13233
  } else {
12431
 
    __pyx_v__obj = __Pyx_PyInt_AsSize_t(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v__obj == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
13234
    __pyx_v_owned = ((PyObject *)__pyx_int_0);
 
13235
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
13236
      case  2: __pyx_v_owned = PyTuple_GET_ITEM(__pyx_args, 1);
 
13237
      case  1: __pyx_v_obj = __Pyx_PyInt_AsSize_t(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_obj == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
13238
      break;
 
13239
      default: goto __pyx_L5_argtuple_error;
 
13240
    }
12432
13241
  }
12433
13242
  goto __pyx_L4_argument_unpacking_done;
12434
13243
  __pyx_L5_argtuple_error:;
12435
 
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
13244
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
12436
13245
  __pyx_L3_error:;
12437
13246
  __Pyx_AddTraceback("gevent.core.http_connection.__init__");
 
13247
  __Pyx_RefNannyFinishContext();
12438
13248
  return -1;
12439
13249
  __pyx_L4_argument_unpacking_done:;
12440
13250
 
12441
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":420
12442
 
 * 
12443
 
 *     def __init__(self, size_t _obj):
12444
 
 *         self.__obj = <evhttp_connection*>_obj             # <<<<<<<<<<<<<<
12445
 
 * 
12446
 
 *     property _obj:
12447
 
 */
12448
 
  ((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->__pyx___obj = ((struct evhttp_connection *)__pyx_v__obj);
 
13251
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":511
 
13252
 * 
 
13253
 *     def __init__(self, size_t obj, owned=0):
 
13254
 *         self.__obj = <evhttp_connection*>obj             # <<<<<<<<<<<<<<
 
13255
 *         self._owned = owned
 
13256
 * 
 
13257
 */
 
13258
  ((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->__pyx___obj = ((struct evhttp_connection *)__pyx_v_obj);
 
13259
 
 
13260
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":512
 
13261
 *     def __init__(self, size_t obj, owned=0):
 
13262
 *         self.__obj = <evhttp_connection*>obj
 
13263
 *         self._owned = owned             # <<<<<<<<<<<<<<
 
13264
 * 
 
13265
 *     @classmethod
 
13266
 */
 
13267
  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_owned); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13268
  ((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->_owned = __pyx_t_1;
12449
13269
 
12450
13270
  __pyx_r = 0;
12451
 
  __Pyx_RefNannyFinishContext();
12452
 
  return __pyx_r;
12453
 
}
12454
 
 
12455
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":424
 
13271
  goto __pyx_L0;
 
13272
  __pyx_L1_error:;
 
13273
  __Pyx_AddTraceback("gevent.core.http_connection.__init__");
 
13274
  __pyx_r = -1;
 
13275
  __pyx_L0:;
 
13276
  __Pyx_RefNannyFinishContext();
 
13277
  return __pyx_r;
 
13278
}
 
13279
 
 
13280
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":515
 
13281
 * 
 
13282
 *     @classmethod
 
13283
 *     def new(cls, char* address, unsigned short port):             # <<<<<<<<<<<<<<
 
13284
 *         cdef void* ptr = evhttp_connection_new(address, port)
 
13285
 *         if ptr != NULL:
 
13286
 */
 
13287
 
 
13288
static PyObject *__pyx_pf_6gevent_4core_15http_connection_1new(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
13289
static PyObject *__pyx_pf_6gevent_4core_15http_connection_1new(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
13290
  char *__pyx_v_address;
 
13291
  unsigned short __pyx_v_port;
 
13292
  void *__pyx_v_ptr;
 
13293
  PyObject *__pyx_r = NULL;
 
13294
  int __pyx_t_1;
 
13295
  PyObject *__pyx_t_2 = NULL;
 
13296
  PyObject *__pyx_t_3 = NULL;
 
13297
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__address,&__pyx_n_s__port,0};
 
13298
  __Pyx_RefNannySetupContext("new");
 
13299
  if (unlikely(__pyx_kwds)) {
 
13300
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
 
13301
    PyObject* values[2] = {0,0};
 
13302
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
13303
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
 
13304
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
 
13305
      case  0: break;
 
13306
      default: goto __pyx_L5_argtuple_error;
 
13307
    }
 
13308
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
13309
      case  0:
 
13310
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__address);
 
13311
      if (likely(values[0])) kw_args--;
 
13312
      else goto __pyx_L5_argtuple_error;
 
13313
      case  1:
 
13314
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__port);
 
13315
      if (likely(values[1])) kw_args--;
 
13316
      else {
 
13317
        __Pyx_RaiseArgtupleInvalid("new", 1, 2, 2, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
13318
      }
 
13319
    }
 
13320
    if (unlikely(kw_args > 0)) {
 
13321
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "new") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
13322
    }
 
13323
    __pyx_v_address = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_address) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
13324
    __pyx_v_port = __Pyx_PyInt_AsUnsignedShort(values[1]); if (unlikely((__pyx_v_port == (unsigned short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
13325
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
 
13326
    goto __pyx_L5_argtuple_error;
 
13327
  } else {
 
13328
    __pyx_v_address = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_address) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
13329
    __pyx_v_port = __Pyx_PyInt_AsUnsignedShort(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_port == (unsigned short)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
13330
  }
 
13331
  goto __pyx_L4_argument_unpacking_done;
 
13332
  __pyx_L5_argtuple_error:;
 
13333
  __Pyx_RaiseArgtupleInvalid("new", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
13334
  __pyx_L3_error:;
 
13335
  __Pyx_AddTraceback("gevent.core.http_connection.new");
 
13336
  __Pyx_RefNannyFinishContext();
 
13337
  return NULL;
 
13338
  __pyx_L4_argument_unpacking_done:;
 
13339
 
 
13340
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":516
 
13341
 *     @classmethod
 
13342
 *     def new(cls, char* address, unsigned short port):
 
13343
 *         cdef void* ptr = evhttp_connection_new(address, port)             # <<<<<<<<<<<<<<
 
13344
 *         if ptr != NULL:
 
13345
 *             return cls(<size_t>ptr, 1)
 
13346
 */
 
13347
  __pyx_v_ptr = evhttp_connection_new(__pyx_v_address, __pyx_v_port);
 
13348
 
 
13349
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":517
 
13350
 *     def new(cls, char* address, unsigned short port):
 
13351
 *         cdef void* ptr = evhttp_connection_new(address, port)
 
13352
 *         if ptr != NULL:             # <<<<<<<<<<<<<<
 
13353
 *             return cls(<size_t>ptr, 1)
 
13354
 * 
 
13355
 */
 
13356
  __pyx_t_1 = (__pyx_v_ptr != NULL);
 
13357
  if (__pyx_t_1) {
 
13358
 
 
13359
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":518
 
13360
 *         cdef void* ptr = evhttp_connection_new(address, port)
 
13361
 *         if ptr != NULL:
 
13362
 *             return cls(<size_t>ptr, 1)             # <<<<<<<<<<<<<<
 
13363
 * 
 
13364
 *     def __dealloc__(self):
 
13365
 */
 
13366
    __Pyx_XDECREF(__pyx_r);
 
13367
    __pyx_t_2 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13368
    __Pyx_GOTREF(__pyx_t_2);
 
13369
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13370
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
13371
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
 
13372
    __Pyx_GIVEREF(__pyx_t_2);
 
13373
    __Pyx_INCREF(__pyx_int_1);
 
13374
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_1);
 
13375
    __Pyx_GIVEREF(__pyx_int_1);
 
13376
    __pyx_t_2 = 0;
 
13377
    __pyx_t_2 = PyObject_Call(__pyx_v_cls, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13378
    __Pyx_GOTREF(__pyx_t_2);
 
13379
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
 
13380
    __pyx_r = __pyx_t_2;
 
13381
    __pyx_t_2 = 0;
 
13382
    goto __pyx_L0;
 
13383
    goto __pyx_L6;
 
13384
  }
 
13385
  __pyx_L6:;
 
13386
 
 
13387
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
13388
  goto __pyx_L0;
 
13389
  __pyx_L1_error:;
 
13390
  __Pyx_XDECREF(__pyx_t_2);
 
13391
  __Pyx_XDECREF(__pyx_t_3);
 
13392
  __Pyx_AddTraceback("gevent.core.http_connection.new");
 
13393
  __pyx_r = NULL;
 
13394
  __pyx_L0:;
 
13395
  __Pyx_XGIVEREF(__pyx_r);
 
13396
  __Pyx_RefNannyFinishContext();
 
13397
  return __pyx_r;
 
13398
}
 
13399
 
 
13400
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":520
 
13401
 *             return cls(<size_t>ptr, 1)
 
13402
 * 
 
13403
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 
13404
 *         cdef evhttp_connection* obj = self.__obj
 
13405
 *         if obj != NULL:
 
13406
 */
 
13407
 
 
13408
static void __pyx_pf_6gevent_4core_15http_connection_2__dealloc__(PyObject *__pyx_v_self); /*proto*/
 
13409
static void __pyx_pf_6gevent_4core_15http_connection_2__dealloc__(PyObject *__pyx_v_self) {
 
13410
  struct evhttp_connection *__pyx_v_obj;
 
13411
  int __pyx_t_1;
 
13412
  __Pyx_RefNannySetupContext("__dealloc__");
 
13413
 
 
13414
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":521
 
13415
 * 
 
13416
 *     def __dealloc__(self):
 
13417
 *         cdef evhttp_connection* obj = self.__obj             # <<<<<<<<<<<<<<
 
13418
 *         if obj != NULL:
 
13419
 *             self.__obj = NULL
 
13420
 */
 
13421
  __pyx_v_obj = ((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->__pyx___obj;
 
13422
 
 
13423
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":522
 
13424
 *     def __dealloc__(self):
 
13425
 *         cdef evhttp_connection* obj = self.__obj
 
13426
 *         if obj != NULL:             # <<<<<<<<<<<<<<
 
13427
 *             self.__obj = NULL
 
13428
 *             if self._owned:
 
13429
 */
 
13430
  __pyx_t_1 = (__pyx_v_obj != NULL);
 
13431
  if (__pyx_t_1) {
 
13432
 
 
13433
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":523
 
13434
 *         cdef evhttp_connection* obj = self.__obj
 
13435
 *         if obj != NULL:
 
13436
 *             self.__obj = NULL             # <<<<<<<<<<<<<<
 
13437
 *             if self._owned:
 
13438
 *                 evhttp_connection_free(obj)
 
13439
 */
 
13440
    ((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->__pyx___obj = NULL;
 
13441
 
 
13442
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":524
 
13443
 *         if obj != NULL:
 
13444
 *             self.__obj = NULL
 
13445
 *             if self._owned:             # <<<<<<<<<<<<<<
 
13446
 *                 evhttp_connection_free(obj)
 
13447
 * 
 
13448
 */
 
13449
    if (((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->_owned) {
 
13450
 
 
13451
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":525
 
13452
 *             self.__obj = NULL
 
13453
 *             if self._owned:
 
13454
 *                 evhttp_connection_free(obj)             # <<<<<<<<<<<<<<
 
13455
 * 
 
13456
 *     property _obj:
 
13457
 */
 
13458
      evhttp_connection_free(__pyx_v_obj);
 
13459
      goto __pyx_L6;
 
13460
    }
 
13461
    __pyx_L6:;
 
13462
    goto __pyx_L5;
 
13463
  }
 
13464
  __pyx_L5:;
 
13465
 
 
13466
  __Pyx_RefNannyFinishContext();
 
13467
}
 
13468
 
 
13469
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":529
12456
13470
 *     property _obj:
12457
13471
 * 
12458
13472
 *         def __get__(self):             # <<<<<<<<<<<<<<
12466
13480
  PyObject *__pyx_t_1 = NULL;
12467
13481
  __Pyx_RefNannySetupContext("__get__");
12468
13482
 
12469
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":425
 
13483
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":530
12470
13484
 * 
12471
13485
 *         def __get__(self):
12472
13486
 *             return <size_t>(self.__obj)             # <<<<<<<<<<<<<<
12474
13488
 *     def __nonzero__(self):
12475
13489
 */
12476
13490
  __Pyx_XDECREF(__pyx_r);
12477
 
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->__pyx___obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13491
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->__pyx___obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12478
13492
  __Pyx_GOTREF(__pyx_t_1);
12479
13493
  __pyx_r = __pyx_t_1;
12480
13494
  __pyx_t_1 = 0;
12492
13506
  return __pyx_r;
12493
13507
}
12494
13508
 
12495
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":427
 
13509
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":532
12496
13510
 *             return <size_t>(self.__obj)
12497
13511
 * 
12498
13512
 *     def __nonzero__(self):             # <<<<<<<<<<<<<<
12500
13514
 *             return True
12501
13515
 */
12502
13516
 
12503
 
static int __pyx_pf_6gevent_4core_15http_connection___nonzero__(PyObject *__pyx_v_self); /*proto*/
12504
 
static int __pyx_pf_6gevent_4core_15http_connection___nonzero__(PyObject *__pyx_v_self) {
 
13517
static int __pyx_pf_6gevent_4core_15http_connection_3__nonzero__(PyObject *__pyx_v_self); /*proto*/
 
13518
static int __pyx_pf_6gevent_4core_15http_connection_3__nonzero__(PyObject *__pyx_v_self) {
12505
13519
  int __pyx_r;
12506
13520
  int __pyx_t_1;
12507
13521
  __Pyx_RefNannySetupContext("__nonzero__");
12508
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
12509
13522
 
12510
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":428
 
13523
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":533
12511
13524
 * 
12512
13525
 *     def __nonzero__(self):
12513
13526
 *         if self.__obj:             # <<<<<<<<<<<<<<
12517
13530
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->__pyx___obj != 0);
12518
13531
  if (__pyx_t_1) {
12519
13532
 
12520
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":429
 
13533
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":534
12521
13534
 *     def __nonzero__(self):
12522
13535
 *         if self.__obj:
12523
13536
 *             return True             # <<<<<<<<<<<<<<
12530
13543
  }
12531
13544
  /*else*/ {
12532
13545
 
12533
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":431
 
13546
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":536
12534
13547
 *             return True
12535
13548
 *         else:
12536
13549
 *             return False             # <<<<<<<<<<<<<<
12544
13557
 
12545
13558
  __pyx_r = 0;
12546
13559
  __pyx_L0:;
12547
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
12548
13560
  __Pyx_RefNannyFinishContext();
12549
13561
  return __pyx_r;
12550
13562
}
12551
13563
 
12552
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":433
 
13564
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":538
12553
13565
 *             return False
12554
13566
 * 
12555
13567
 *     def __str__(self):             # <<<<<<<<<<<<<<
12557
13569
 *             peer = self.peer
12558
13570
 */
12559
13571
 
12560
 
static PyObject *__pyx_pf_6gevent_4core_15http_connection___str__(PyObject *__pyx_v_self); /*proto*/
12561
 
static PyObject *__pyx_pf_6gevent_4core_15http_connection___str__(PyObject *__pyx_v_self) {
 
13572
static PyObject *__pyx_pf_6gevent_4core_15http_connection_4__str__(PyObject *__pyx_v_self); /*proto*/
 
13573
static PyObject *__pyx_pf_6gevent_4core_15http_connection_4__str__(PyObject *__pyx_v_self) {
12562
13574
  PyObject *__pyx_v_peer;
12563
13575
  PyObject *__pyx_r = NULL;
12564
13576
  PyObject *__pyx_t_1 = NULL;
12566
13578
  PyObject *__pyx_t_3 = NULL;
12567
13579
  PyObject *__pyx_t_4 = NULL;
12568
13580
  __Pyx_RefNannySetupContext("__str__");
12569
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
12570
13581
  __pyx_v_peer = Py_None; __Pyx_INCREF(Py_None);
12571
13582
 
12572
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":434
 
13583
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":539
12573
13584
 * 
12574
13585
 *     def __str__(self):
12575
13586
 *         try:             # <<<<<<<<<<<<<<
12584
13595
    __Pyx_XGOTREF(__pyx_save_exc_tb);
12585
13596
    /*try:*/ {
12586
13597
 
12587
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":435
 
13598
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":540
12588
13599
 *     def __str__(self):
12589
13600
 *         try:
12590
13601
 *             peer = self.peer             # <<<<<<<<<<<<<<
12591
13602
 *         except HttpConnectionDeleted:
12592
13603
 *             peer = 'deleted'
12593
13604
 */
12594
 
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__peer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
 
13605
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__peer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
12595
13606
      __Pyx_GOTREF(__pyx_t_1);
12596
13607
      __Pyx_DECREF(__pyx_v_peer);
12597
13608
      __pyx_v_peer = __pyx_t_1;
12604
13615
    __pyx_L5_error:;
12605
13616
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12606
13617
 
12607
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":436
 
13618
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":541
12608
13619
 *         try:
12609
13620
 *             peer = self.peer
12610
13621
 *         except HttpConnectionDeleted:             # <<<<<<<<<<<<<<
12611
13622
 *             peer = 'deleted'
12612
13623
 *         return '<%s %s>' % (self.__class__.__name__, peer)
12613
13624
 */
12614
 
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
13625
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_38); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
12615
13626
    __Pyx_GOTREF(__pyx_t_1);
12616
13627
    __pyx_t_2 = PyErr_ExceptionMatches(__pyx_t_1);
12617
13628
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12618
13629
    if (__pyx_t_2) {
12619
13630
      __Pyx_AddTraceback("gevent.core.http_connection.__str__");
12620
 
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
13631
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
12621
13632
      __Pyx_GOTREF(__pyx_t_1);
12622
13633
      __Pyx_GOTREF(__pyx_t_3);
12623
13634
      __Pyx_GOTREF(__pyx_t_4);
12624
13635
 
12625
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":437
 
13636
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":542
12626
13637
 *             peer = self.peer
12627
13638
 *         except HttpConnectionDeleted:
12628
13639
 *             peer = 'deleted'             # <<<<<<<<<<<<<<
12651
13662
    __pyx_L12_try_end:;
12652
13663
  }
12653
13664
 
12654
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":438
 
13665
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":543
12655
13666
 *         except HttpConnectionDeleted:
12656
13667
 *             peer = 'deleted'
12657
13668
 *         return '<%s %s>' % (self.__class__.__name__, peer)             # <<<<<<<<<<<<<<
12659
13670
 *     def __repr__(self):
12660
13671
 */
12661
13672
  __Pyx_XDECREF(__pyx_r);
12662
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____class__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13673
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____class__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12663
13674
  __Pyx_GOTREF(__pyx_t_4);
12664
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s____name__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13675
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s____name__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12665
13676
  __Pyx_GOTREF(__pyx_t_3);
12666
13677
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12667
 
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12668
 
  __Pyx_GOTREF(__pyx_t_4);
 
13678
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13679
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
12669
13680
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
12670
13681
  __Pyx_GIVEREF(__pyx_t_3);
12671
13682
  __Pyx_INCREF(__pyx_v_peer);
12672
13683
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_peer);
12673
13684
  __Pyx_GIVEREF(__pyx_v_peer);
12674
13685
  __pyx_t_3 = 0;
12675
 
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_27), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12676
 
  __Pyx_GOTREF(__pyx_t_3);
12677
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12678
 
  __pyx_r = __pyx_t_3;
 
13686
  __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_27), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13687
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
13688
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
 
13689
  __pyx_r = ((PyObject *)__pyx_t_3);
12679
13690
  __pyx_t_3 = 0;
12680
13691
  goto __pyx_L0;
12681
13692
 
12689
13700
  __pyx_r = NULL;
12690
13701
  __pyx_L0:;
12691
13702
  __Pyx_DECREF(__pyx_v_peer);
12692
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
12693
13703
  __Pyx_XGIVEREF(__pyx_r);
12694
13704
  __Pyx_RefNannyFinishContext();
12695
13705
  return __pyx_r;
12696
13706
}
12697
13707
 
12698
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":440
 
13708
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":545
12699
13709
 *         return '<%s %s>' % (self.__class__.__name__, peer)
12700
13710
 * 
12701
13711
 *     def __repr__(self):             # <<<<<<<<<<<<<<
12703
13713
 *             peer = ' %s' % (self.peer, )
12704
13714
 */
12705
13715
 
12706
 
static PyObject *__pyx_pf_6gevent_4core_15http_connection___repr__(PyObject *__pyx_v_self); /*proto*/
12707
 
static PyObject *__pyx_pf_6gevent_4core_15http_connection___repr__(PyObject *__pyx_v_self) {
 
13716
static PyObject *__pyx_pf_6gevent_4core_15http_connection_5__repr__(PyObject *__pyx_v_self); /*proto*/
 
13717
static PyObject *__pyx_pf_6gevent_4core_15http_connection_5__repr__(PyObject *__pyx_v_self) {
12708
13718
  PyObject *__pyx_v_peer;
12709
13719
  PyObject *__pyx_r = NULL;
12710
13720
  PyObject *__pyx_t_1 = NULL;
12712
13722
  int __pyx_t_3;
12713
13723
  PyObject *__pyx_t_4 = NULL;
12714
13724
  __Pyx_RefNannySetupContext("__repr__");
12715
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
12716
13725
  __pyx_v_peer = Py_None; __Pyx_INCREF(Py_None);
12717
13726
 
12718
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":441
 
13727
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":546
12719
13728
 * 
12720
13729
 *     def __repr__(self):
12721
13730
 *         try:             # <<<<<<<<<<<<<<
12730
13739
    __Pyx_XGOTREF(__pyx_save_exc_tb);
12731
13740
    /*try:*/ {
12732
13741
 
12733
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":442
 
13742
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":547
12734
13743
 *     def __repr__(self):
12735
13744
 *         try:
12736
13745
 *             peer = ' %s' % (self.peer, )             # <<<<<<<<<<<<<<
12737
13746
 *         except HttpConnectionDeleted:
12738
13747
 *             peer = ''
12739
13748
 */
12740
 
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__peer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
 
13749
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__peer); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
12741
13750
      __Pyx_GOTREF(__pyx_t_1);
12742
 
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
12743
 
      __Pyx_GOTREF(__pyx_t_2);
 
13751
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
 
13752
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
12744
13753
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
12745
13754
      __Pyx_GIVEREF(__pyx_t_1);
12746
13755
      __pyx_t_1 = 0;
12747
 
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
12748
 
      __Pyx_GOTREF(__pyx_t_1);
12749
 
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
13756
      __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
 
13757
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
13758
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
12750
13759
      __Pyx_DECREF(__pyx_v_peer);
12751
 
      __pyx_v_peer = __pyx_t_1;
 
13760
      __pyx_v_peer = ((PyObject *)__pyx_t_1);
12752
13761
      __pyx_t_1 = 0;
12753
13762
    }
12754
13763
    __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
12759
13768
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12760
13769
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12761
13770
 
12762
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":443
 
13771
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":548
12763
13772
 *         try:
12764
13773
 *             peer = ' %s' % (self.peer, )
12765
13774
 *         except HttpConnectionDeleted:             # <<<<<<<<<<<<<<
12766
13775
 *             peer = ''
12767
13776
 *         return '<%s _obj=0x%x%s>' % (self.__class__.__name__, self._obj, peer)
12768
13777
 */
12769
 
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
13778
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s_38); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
12770
13779
    __Pyx_GOTREF(__pyx_t_1);
12771
13780
    __pyx_t_3 = PyErr_ExceptionMatches(__pyx_t_1);
12772
13781
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12773
13782
    if (__pyx_t_3) {
12774
13783
      __Pyx_AddTraceback("gevent.core.http_connection.__repr__");
12775
 
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
 
13784
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
12776
13785
      __Pyx_GOTREF(__pyx_t_1);
12777
13786
      __Pyx_GOTREF(__pyx_t_2);
12778
13787
      __Pyx_GOTREF(__pyx_t_4);
12779
13788
 
12780
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":444
 
13789
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":549
12781
13790
 *             peer = ' %s' % (self.peer, )
12782
13791
 *         except HttpConnectionDeleted:
12783
13792
 *             peer = ''             # <<<<<<<<<<<<<<
12806
13815
    __pyx_L12_try_end:;
12807
13816
  }
12808
13817
 
12809
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":445
 
13818
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":550
12810
13819
 *         except HttpConnectionDeleted:
12811
13820
 *             peer = ''
12812
13821
 *         return '<%s _obj=0x%x%s>' % (self.__class__.__name__, self._obj, peer)             # <<<<<<<<<<<<<<
12814
13823
 *     property peer:
12815
13824
 */
12816
13825
  __Pyx_XDECREF(__pyx_r);
12817
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____class__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13826
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____class__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12818
13827
  __Pyx_GOTREF(__pyx_t_4);
12819
 
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s____name__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13828
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s____name__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12820
13829
  __Pyx_GOTREF(__pyx_t_2);
12821
13830
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12822
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___obj); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13831
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___obj); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12823
13832
  __Pyx_GOTREF(__pyx_t_4);
12824
 
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12825
 
  __Pyx_GOTREF(__pyx_t_1);
 
13833
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13834
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
12826
13835
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
12827
13836
  __Pyx_GIVEREF(__pyx_t_2);
12828
13837
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
12832
13841
  __Pyx_GIVEREF(__pyx_v_peer);
12833
13842
  __pyx_t_2 = 0;
12834
13843
  __pyx_t_4 = 0;
12835
 
  __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_33), __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12836
 
  __Pyx_GOTREF(__pyx_t_4);
12837
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12838
 
  __pyx_r = __pyx_t_4;
 
13844
  __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_39), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13845
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
 
13846
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
13847
  __pyx_r = ((PyObject *)__pyx_t_4);
12839
13848
  __pyx_t_4 = 0;
12840
13849
  goto __pyx_L0;
12841
13850
 
12849
13858
  __pyx_r = NULL;
12850
13859
  __pyx_L0:;
12851
13860
  __Pyx_DECREF(__pyx_v_peer);
12852
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
12853
13861
  __Pyx_XGIVEREF(__pyx_r);
12854
13862
  __Pyx_RefNannyFinishContext();
12855
13863
  return __pyx_r;
12856
13864
}
12857
13865
 
12858
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":449
 
13866
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":554
12859
13867
 *     property peer:
12860
13868
 * 
12861
13869
 *         def __get__(self):             # <<<<<<<<<<<<<<
12873
13881
  PyObject *__pyx_t_2 = NULL;
12874
13882
  PyObject *__pyx_t_3 = NULL;
12875
13883
  __Pyx_RefNannySetupContext("__get__");
12876
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
12877
13884
  __pyx_v_addr = Py_None; __Pyx_INCREF(Py_None);
12878
13885
 
12879
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":450
 
13886
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":555
12880
13887
 * 
12881
13888
 *         def __get__(self):
12882
13889
 *             if not self.__obj:             # <<<<<<<<<<<<<<
12886
13893
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->__pyx___obj != 0));
12887
13894
  if (__pyx_t_1) {
12888
13895
 
12889
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":451
 
13896
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":556
12890
13897
 *         def __get__(self):
12891
13898
 *             if not self.__obj:
12892
13899
 *                 raise HttpConnectionDeleted             # <<<<<<<<<<<<<<
12893
13900
 *             cdef char* address = NULL
12894
13901
 *             cdef ev_uint16_t port = 0
12895
13902
 */
12896
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13903
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_38); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12897
13904
    __Pyx_GOTREF(__pyx_t_2);
12898
13905
    __Pyx_Raise(__pyx_t_2, 0, 0);
12899
13906
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12900
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13907
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12901
13908
    goto __pyx_L5;
12902
13909
  }
12903
13910
  __pyx_L5:;
12904
13911
 
12905
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":452
 
13912
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":557
12906
13913
 *             if not self.__obj:
12907
13914
 *                 raise HttpConnectionDeleted
12908
13915
 *             cdef char* address = NULL             # <<<<<<<<<<<<<<
12911
13918
 */
12912
13919
  __pyx_v_address = NULL;
12913
13920
 
12914
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":453
 
13921
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":558
12915
13922
 *                 raise HttpConnectionDeleted
12916
13923
 *             cdef char* address = NULL
12917
13924
 *             cdef ev_uint16_t port = 0             # <<<<<<<<<<<<<<
12920
13927
 */
12921
13928
  __pyx_v_port = 0;
12922
13929
 
12923
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":454
 
13930
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":559
12924
13931
 *             cdef char* address = NULL
12925
13932
 *             cdef ev_uint16_t port = 0
12926
13933
 *             evhttp_connection_get_peer(self.__obj, &address, &port)             # <<<<<<<<<<<<<<
12929
13936
 */
12930
13937
  evhttp_connection_get_peer(((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->__pyx___obj, (&__pyx_v_address), (&__pyx_v_port));
12931
13938
 
12932
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":455
 
13939
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":560
12933
13940
 *             cdef ev_uint16_t port = 0
12934
13941
 *             evhttp_connection_get_peer(self.__obj, &address, &port)
12935
13942
 *             if address:             # <<<<<<<<<<<<<<
12939
13946
  __pyx_t_1 = (__pyx_v_address != 0);
12940
13947
  if (__pyx_t_1) {
12941
13948
 
12942
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":456
 
13949
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":561
12943
13950
 *             evhttp_connection_get_peer(self.__obj, &address, &port)
12944
13951
 *             if address:
12945
13952
 *                 addr = <str>address             # <<<<<<<<<<<<<<
12946
13953
 *             else:
12947
13954
 *                 addr = None
12948
13955
 */
12949
 
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_address); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13956
    __pyx_t_2 = PyBytes_FromString(__pyx_v_address); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12950
13957
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
12951
 
    __Pyx_INCREF(((PyObject *)__pyx_t_2));
 
13958
    __Pyx_INCREF(((PyObject*)__pyx_t_2));
12952
13959
    __Pyx_DECREF(__pyx_v_addr);
12953
13960
    __pyx_v_addr = ((PyObject *)__pyx_t_2);
12954
13961
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
12956
13963
  }
12957
13964
  /*else*/ {
12958
13965
 
12959
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":458
 
13966
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":563
12960
13967
 *                 addr = <str>address
12961
13968
 *             else:
12962
13969
 *                 addr = None             # <<<<<<<<<<<<<<
12969
13976
  }
12970
13977
  __pyx_L6:;
12971
13978
 
12972
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":459
 
13979
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":564
12973
13980
 *             else:
12974
13981
 *                 addr = None
12975
13982
 *             return (addr, port)             # <<<<<<<<<<<<<<
12976
13983
 * 
12977
 
 * 
 
13984
 *     def set_local_address(self, char *addr):
12978
13985
 */
12979
13986
  __Pyx_XDECREF(__pyx_r);
12980
 
  __pyx_t_2 = __Pyx_PyInt_to_py_ev_uint16_t(__pyx_v_port); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13987
  __pyx_t_2 = __Pyx_PyInt_to_py_ev_uint16_t(__pyx_v_port); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12981
13988
  __Pyx_GOTREF(__pyx_t_2);
12982
 
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12983
 
  __Pyx_GOTREF(__pyx_t_3);
 
13989
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
13990
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
12984
13991
  __Pyx_INCREF(__pyx_v_addr);
12985
13992
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_addr);
12986
13993
  __Pyx_GIVEREF(__pyx_v_addr);
12987
13994
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
12988
13995
  __Pyx_GIVEREF(__pyx_t_2);
12989
13996
  __pyx_t_2 = 0;
12990
 
  __pyx_r = __pyx_t_3;
 
13997
  __pyx_r = ((PyObject *)__pyx_t_3);
12991
13998
  __pyx_t_3 = 0;
12992
13999
  goto __pyx_L0;
12993
14000
 
13000
14007
  __pyx_r = NULL;
13001
14008
  __pyx_L0:;
13002
14009
  __Pyx_DECREF(__pyx_v_addr);
13003
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
13004
 
  __Pyx_XGIVEREF(__pyx_r);
13005
 
  __Pyx_RefNannyFinishContext();
13006
 
  return __pyx_r;
13007
 
}
13008
 
 
13009
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":462
 
14010
  __Pyx_XGIVEREF(__pyx_r);
 
14011
  __Pyx_RefNannyFinishContext();
 
14012
  return __pyx_r;
 
14013
}
 
14014
 
 
14015
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":566
 
14016
 *             return (addr, port)
 
14017
 * 
 
14018
 *     def set_local_address(self, char *addr):             # <<<<<<<<<<<<<<
 
14019
 *         if not self.__obj:
 
14020
 *             raise HttpConnectionDeleted
 
14021
 */
 
14022
 
 
14023
static PyObject *__pyx_pf_6gevent_4core_15http_connection_6set_local_address(PyObject *__pyx_v_self, PyObject *__pyx_arg_addr); /*proto*/
 
14024
static PyObject *__pyx_pf_6gevent_4core_15http_connection_6set_local_address(PyObject *__pyx_v_self, PyObject *__pyx_arg_addr) {
 
14025
  char *__pyx_v_addr;
 
14026
  PyObject *__pyx_r = NULL;
 
14027
  int __pyx_t_1;
 
14028
  PyObject *__pyx_t_2 = NULL;
 
14029
  __Pyx_RefNannySetupContext("set_local_address");
 
14030
  assert(__pyx_arg_addr); {
 
14031
    __pyx_v_addr = PyBytes_AsString(__pyx_arg_addr); if (unlikely((!__pyx_v_addr) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14032
  }
 
14033
  goto __pyx_L4_argument_unpacking_done;
 
14034
  __pyx_L3_error:;
 
14035
  __Pyx_AddTraceback("gevent.core.http_connection.set_local_address");
 
14036
  __Pyx_RefNannyFinishContext();
 
14037
  return NULL;
 
14038
  __pyx_L4_argument_unpacking_done:;
 
14039
 
 
14040
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":567
 
14041
 * 
 
14042
 *     def set_local_address(self, char *addr):
 
14043
 *         if not self.__obj:             # <<<<<<<<<<<<<<
 
14044
 *             raise HttpConnectionDeleted
 
14045
 *         evhttp_connection_set_local_address(self.__obj, addr)
 
14046
 */
 
14047
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->__pyx___obj != 0));
 
14048
  if (__pyx_t_1) {
 
14049
 
 
14050
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":568
 
14051
 *     def set_local_address(self, char *addr):
 
14052
 *         if not self.__obj:
 
14053
 *             raise HttpConnectionDeleted             # <<<<<<<<<<<<<<
 
14054
 *         evhttp_connection_set_local_address(self.__obj, addr)
 
14055
 * 
 
14056
 */
 
14057
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_38); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
14058
    __Pyx_GOTREF(__pyx_t_2);
 
14059
    __Pyx_Raise(__pyx_t_2, 0, 0);
 
14060
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
14061
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
14062
    goto __pyx_L5;
 
14063
  }
 
14064
  __pyx_L5:;
 
14065
 
 
14066
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":569
 
14067
 *         if not self.__obj:
 
14068
 *             raise HttpConnectionDeleted
 
14069
 *         evhttp_connection_set_local_address(self.__obj, addr)             # <<<<<<<<<<<<<<
 
14070
 * 
 
14071
 *     def set_timeout(self, int secs):
 
14072
 */
 
14073
  evhttp_connection_set_local_address(((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->__pyx___obj, __pyx_v_addr);
 
14074
 
 
14075
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
14076
  goto __pyx_L0;
 
14077
  __pyx_L1_error:;
 
14078
  __Pyx_XDECREF(__pyx_t_2);
 
14079
  __Pyx_AddTraceback("gevent.core.http_connection.set_local_address");
 
14080
  __pyx_r = NULL;
 
14081
  __pyx_L0:;
 
14082
  __Pyx_XGIVEREF(__pyx_r);
 
14083
  __Pyx_RefNannyFinishContext();
 
14084
  return __pyx_r;
 
14085
}
 
14086
 
 
14087
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":571
 
14088
 *         evhttp_connection_set_local_address(self.__obj, addr)
 
14089
 * 
 
14090
 *     def set_timeout(self, int secs):             # <<<<<<<<<<<<<<
 
14091
 *         if not self.__obj:
 
14092
 *             raise HttpConnectionDeleted
 
14093
 */
 
14094
 
 
14095
static PyObject *__pyx_pf_6gevent_4core_15http_connection_7set_timeout(PyObject *__pyx_v_self, PyObject *__pyx_arg_secs); /*proto*/
 
14096
static PyObject *__pyx_pf_6gevent_4core_15http_connection_7set_timeout(PyObject *__pyx_v_self, PyObject *__pyx_arg_secs) {
 
14097
  int __pyx_v_secs;
 
14098
  PyObject *__pyx_r = NULL;
 
14099
  int __pyx_t_1;
 
14100
  PyObject *__pyx_t_2 = NULL;
 
14101
  __Pyx_RefNannySetupContext("set_timeout");
 
14102
  assert(__pyx_arg_secs); {
 
14103
    __pyx_v_secs = __Pyx_PyInt_AsInt(__pyx_arg_secs); if (unlikely((__pyx_v_secs == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14104
  }
 
14105
  goto __pyx_L4_argument_unpacking_done;
 
14106
  __pyx_L3_error:;
 
14107
  __Pyx_AddTraceback("gevent.core.http_connection.set_timeout");
 
14108
  __Pyx_RefNannyFinishContext();
 
14109
  return NULL;
 
14110
  __pyx_L4_argument_unpacking_done:;
 
14111
 
 
14112
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":572
 
14113
 * 
 
14114
 *     def set_timeout(self, int secs):
 
14115
 *         if not self.__obj:             # <<<<<<<<<<<<<<
 
14116
 *             raise HttpConnectionDeleted
 
14117
 *         evhttp_connection_set_timeout(self.__obj, secs)
 
14118
 */
 
14119
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->__pyx___obj != 0));
 
14120
  if (__pyx_t_1) {
 
14121
 
 
14122
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":573
 
14123
 *     def set_timeout(self, int secs):
 
14124
 *         if not self.__obj:
 
14125
 *             raise HttpConnectionDeleted             # <<<<<<<<<<<<<<
 
14126
 *         evhttp_connection_set_timeout(self.__obj, secs)
 
14127
 * 
 
14128
 */
 
14129
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_38); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
14130
    __Pyx_GOTREF(__pyx_t_2);
 
14131
    __Pyx_Raise(__pyx_t_2, 0, 0);
 
14132
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
14133
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
14134
    goto __pyx_L5;
 
14135
  }
 
14136
  __pyx_L5:;
 
14137
 
 
14138
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":574
 
14139
 *         if not self.__obj:
 
14140
 *             raise HttpConnectionDeleted
 
14141
 *         evhttp_connection_set_timeout(self.__obj, secs)             # <<<<<<<<<<<<<<
 
14142
 * 
 
14143
 *     def set_retries(self, int retry_max):
 
14144
 */
 
14145
  evhttp_connection_set_timeout(((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->__pyx___obj, __pyx_v_secs);
 
14146
 
 
14147
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
14148
  goto __pyx_L0;
 
14149
  __pyx_L1_error:;
 
14150
  __Pyx_XDECREF(__pyx_t_2);
 
14151
  __Pyx_AddTraceback("gevent.core.http_connection.set_timeout");
 
14152
  __pyx_r = NULL;
 
14153
  __pyx_L0:;
 
14154
  __Pyx_XGIVEREF(__pyx_r);
 
14155
  __Pyx_RefNannyFinishContext();
 
14156
  return __pyx_r;
 
14157
}
 
14158
 
 
14159
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":576
 
14160
 *         evhttp_connection_set_timeout(self.__obj, secs)
 
14161
 * 
 
14162
 *     def set_retries(self, int retry_max):             # <<<<<<<<<<<<<<
 
14163
 *         if not self.__obj:
 
14164
 *             raise HttpConnectionDeleted
 
14165
 */
 
14166
 
 
14167
static PyObject *__pyx_pf_6gevent_4core_15http_connection_8set_retries(PyObject *__pyx_v_self, PyObject *__pyx_arg_retry_max); /*proto*/
 
14168
static PyObject *__pyx_pf_6gevent_4core_15http_connection_8set_retries(PyObject *__pyx_v_self, PyObject *__pyx_arg_retry_max) {
 
14169
  int __pyx_v_retry_max;
 
14170
  PyObject *__pyx_r = NULL;
 
14171
  int __pyx_t_1;
 
14172
  PyObject *__pyx_t_2 = NULL;
 
14173
  __Pyx_RefNannySetupContext("set_retries");
 
14174
  assert(__pyx_arg_retry_max); {
 
14175
    __pyx_v_retry_max = __Pyx_PyInt_AsInt(__pyx_arg_retry_max); if (unlikely((__pyx_v_retry_max == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14176
  }
 
14177
  goto __pyx_L4_argument_unpacking_done;
 
14178
  __pyx_L3_error:;
 
14179
  __Pyx_AddTraceback("gevent.core.http_connection.set_retries");
 
14180
  __Pyx_RefNannyFinishContext();
 
14181
  return NULL;
 
14182
  __pyx_L4_argument_unpacking_done:;
 
14183
 
 
14184
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":577
 
14185
 * 
 
14186
 *     def set_retries(self, int retry_max):
 
14187
 *         if not self.__obj:             # <<<<<<<<<<<<<<
 
14188
 *             raise HttpConnectionDeleted
 
14189
 *         evhttp_connection_set_retries(self.__obj, retry_max)
 
14190
 */
 
14191
  __pyx_t_1 = (!(((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->__pyx___obj != 0));
 
14192
  if (__pyx_t_1) {
 
14193
 
 
14194
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":578
 
14195
 *     def set_retries(self, int retry_max):
 
14196
 *         if not self.__obj:
 
14197
 *             raise HttpConnectionDeleted             # <<<<<<<<<<<<<<
 
14198
 *         evhttp_connection_set_retries(self.__obj, retry_max)
 
14199
 * 
 
14200
 */
 
14201
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s_38); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
14202
    __Pyx_GOTREF(__pyx_t_2);
 
14203
    __Pyx_Raise(__pyx_t_2, 0, 0);
 
14204
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
14205
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
14206
    goto __pyx_L5;
 
14207
  }
 
14208
  __pyx_L5:;
 
14209
 
 
14210
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":579
 
14211
 *         if not self.__obj:
 
14212
 *             raise HttpConnectionDeleted
 
14213
 *         evhttp_connection_set_retries(self.__obj, retry_max)             # <<<<<<<<<<<<<<
 
14214
 * 
 
14215
 *     def make_request(self, http_request_client req, int type, char* uri):
 
14216
 */
 
14217
  evhttp_connection_set_retries(((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->__pyx___obj, __pyx_v_retry_max);
 
14218
 
 
14219
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
14220
  goto __pyx_L0;
 
14221
  __pyx_L1_error:;
 
14222
  __Pyx_XDECREF(__pyx_t_2);
 
14223
  __Pyx_AddTraceback("gevent.core.http_connection.set_retries");
 
14224
  __pyx_r = NULL;
 
14225
  __pyx_L0:;
 
14226
  __Pyx_XGIVEREF(__pyx_r);
 
14227
  __Pyx_RefNannyFinishContext();
 
14228
  return __pyx_r;
 
14229
}
 
14230
 
 
14231
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":581
 
14232
 *         evhttp_connection_set_retries(self.__obj, retry_max)
 
14233
 * 
 
14234
 *     def make_request(self, http_request_client req, int type, char* uri):             # <<<<<<<<<<<<<<
 
14235
 *         req._owned = 0
 
14236
 *         cdef int result = evhttp_make_request(self.__obj, req.__obj, type, uri)
 
14237
 */
 
14238
 
 
14239
static PyObject *__pyx_pf_6gevent_4core_15http_connection_9make_request(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
14240
static PyObject *__pyx_pf_6gevent_4core_15http_connection_9make_request(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
14241
  struct __pyx_obj_6gevent_4core_http_request_client *__pyx_v_req = 0;
 
14242
  int __pyx_v_type;
 
14243
  char *__pyx_v_uri;
 
14244
  int __pyx_v_result;
 
14245
  PyObject *__pyx_r = NULL;
 
14246
  int __pyx_t_1;
 
14247
  PyObject *__pyx_t_2 = NULL;
 
14248
  PyObject *__pyx_t_3 = NULL;
 
14249
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__req,&__pyx_n_s__type,&__pyx_n_s__uri,0};
 
14250
  __Pyx_RefNannySetupContext("make_request");
 
14251
  if (unlikely(__pyx_kwds)) {
 
14252
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
 
14253
    PyObject* values[3] = {0,0,0};
 
14254
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
14255
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
 
14256
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
 
14257
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
 
14258
      case  0: break;
 
14259
      default: goto __pyx_L5_argtuple_error;
 
14260
    }
 
14261
    switch (PyTuple_GET_SIZE(__pyx_args)) {
 
14262
      case  0:
 
14263
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__req);
 
14264
      if (likely(values[0])) kw_args--;
 
14265
      else goto __pyx_L5_argtuple_error;
 
14266
      case  1:
 
14267
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__type);
 
14268
      if (likely(values[1])) kw_args--;
 
14269
      else {
 
14270
        __Pyx_RaiseArgtupleInvalid("make_request", 1, 3, 3, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14271
      }
 
14272
      case  2:
 
14273
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__uri);
 
14274
      if (likely(values[2])) kw_args--;
 
14275
      else {
 
14276
        __Pyx_RaiseArgtupleInvalid("make_request", 1, 3, 3, 2); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14277
      }
 
14278
    }
 
14279
    if (unlikely(kw_args > 0)) {
 
14280
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "make_request") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14281
    }
 
14282
    __pyx_v_req = ((struct __pyx_obj_6gevent_4core_http_request_client *)values[0]);
 
14283
    __pyx_v_type = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14284
    __pyx_v_uri = PyBytes_AsString(values[2]); if (unlikely((!__pyx_v_uri) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14285
  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
 
14286
    goto __pyx_L5_argtuple_error;
 
14287
  } else {
 
14288
    __pyx_v_req = ((struct __pyx_obj_6gevent_4core_http_request_client *)PyTuple_GET_ITEM(__pyx_args, 0));
 
14289
    __pyx_v_type = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_type == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14290
    __pyx_v_uri = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((!__pyx_v_uri) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14291
  }
 
14292
  goto __pyx_L4_argument_unpacking_done;
 
14293
  __pyx_L5_argtuple_error:;
 
14294
  __Pyx_RaiseArgtupleInvalid("make_request", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14295
  __pyx_L3_error:;
 
14296
  __Pyx_AddTraceback("gevent.core.http_connection.make_request");
 
14297
  __Pyx_RefNannyFinishContext();
 
14298
  return NULL;
 
14299
  __pyx_L4_argument_unpacking_done:;
 
14300
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_req), __pyx_ptype_6gevent_4core_http_request_client, 1, "req", 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
14301
 
 
14302
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":582
 
14303
 * 
 
14304
 *     def make_request(self, http_request_client req, int type, char* uri):
 
14305
 *         req._owned = 0             # <<<<<<<<<<<<<<
 
14306
 *         cdef int result = evhttp_make_request(self.__obj, req.__obj, type, uri)
 
14307
 *         if result != 0:
 
14308
 */
 
14309
  __pyx_v_req->_owned = 0;
 
14310
 
 
14311
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":583
 
14312
 *     def make_request(self, http_request_client req, int type, char* uri):
 
14313
 *         req._owned = 0
 
14314
 *         cdef int result = evhttp_make_request(self.__obj, req.__obj, type, uri)             # <<<<<<<<<<<<<<
 
14315
 *         if result != 0:
 
14316
 *             req.detach()
 
14317
 */
 
14318
  __pyx_v_result = evhttp_make_request(((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->__pyx___obj, __pyx_v_req->__pyx_base.__pyx___obj, __pyx_v_type, __pyx_v_uri);
 
14319
 
 
14320
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":584
 
14321
 *         req._owned = 0
 
14322
 *         cdef int result = evhttp_make_request(self.__obj, req.__obj, type, uri)
 
14323
 *         if result != 0:             # <<<<<<<<<<<<<<
 
14324
 *             req.detach()
 
14325
 *         return result
 
14326
 */
 
14327
  __pyx_t_1 = (__pyx_v_result != 0);
 
14328
  if (__pyx_t_1) {
 
14329
 
 
14330
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":585
 
14331
 *         cdef int result = evhttp_make_request(self.__obj, req.__obj, type, uri)
 
14332
 *         if result != 0:
 
14333
 *             req.detach()             # <<<<<<<<<<<<<<
 
14334
 *         return result
 
14335
 * 
 
14336
 */
 
14337
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_req), __pyx_n_s__detach); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
14338
    __Pyx_GOTREF(__pyx_t_2);
 
14339
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
14340
    __Pyx_GOTREF(__pyx_t_3);
 
14341
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
14342
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
14343
    goto __pyx_L6;
 
14344
  }
 
14345
  __pyx_L6:;
 
14346
 
 
14347
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":586
 
14348
 *         if result != 0:
 
14349
 *             req.detach()
 
14350
 *         return result             # <<<<<<<<<<<<<<
 
14351
 * 
 
14352
 * 
 
14353
 */
 
14354
  __Pyx_XDECREF(__pyx_r);
 
14355
  __pyx_t_3 = PyInt_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
14356
  __Pyx_GOTREF(__pyx_t_3);
 
14357
  __pyx_r = __pyx_t_3;
 
14358
  __pyx_t_3 = 0;
 
14359
  goto __pyx_L0;
 
14360
 
 
14361
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
14362
  goto __pyx_L0;
 
14363
  __pyx_L1_error:;
 
14364
  __Pyx_XDECREF(__pyx_t_2);
 
14365
  __Pyx_XDECREF(__pyx_t_3);
 
14366
  __Pyx_AddTraceback("gevent.core.http_connection.make_request");
 
14367
  __pyx_r = NULL;
 
14368
  __pyx_L0:;
 
14369
  __Pyx_XGIVEREF(__pyx_r);
 
14370
  __Pyx_RefNannyFinishContext();
 
14371
  return __pyx_r;
 
14372
}
 
14373
 
 
14374
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":508
 
14375
 * 
 
14376
 *     cdef evhttp_connection* __obj
 
14377
 *     cdef public int _owned             # <<<<<<<<<<<<<<
 
14378
 * 
 
14379
 *     def __init__(self, size_t obj, owned=0):
 
14380
 */
 
14381
 
 
14382
static PyObject *__pyx_pf_6gevent_4core_15http_connection_6_owned___get__(PyObject *__pyx_v_self); /*proto*/
 
14383
static PyObject *__pyx_pf_6gevent_4core_15http_connection_6_owned___get__(PyObject *__pyx_v_self) {
 
14384
  PyObject *__pyx_r = NULL;
 
14385
  PyObject *__pyx_t_1 = NULL;
 
14386
  __Pyx_RefNannySetupContext("__get__");
 
14387
  __Pyx_XDECREF(__pyx_r);
 
14388
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->_owned); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
14389
  __Pyx_GOTREF(__pyx_t_1);
 
14390
  __pyx_r = __pyx_t_1;
 
14391
  __pyx_t_1 = 0;
 
14392
  goto __pyx_L0;
 
14393
 
 
14394
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
14395
  goto __pyx_L0;
 
14396
  __pyx_L1_error:;
 
14397
  __Pyx_XDECREF(__pyx_t_1);
 
14398
  __Pyx_AddTraceback("gevent.core.http_connection._owned.__get__");
 
14399
  __pyx_r = NULL;
 
14400
  __pyx_L0:;
 
14401
  __Pyx_XGIVEREF(__pyx_r);
 
14402
  __Pyx_RefNannyFinishContext();
 
14403
  return __pyx_r;
 
14404
}
 
14405
 
 
14406
static int __pyx_pf_6gevent_4core_15http_connection_6_owned_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
 
14407
static int __pyx_pf_6gevent_4core_15http_connection_6_owned_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
 
14408
  int __pyx_r;
 
14409
  int __pyx_t_1;
 
14410
  __Pyx_RefNannySetupContext("__set__");
 
14411
  __pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
14412
  ((struct __pyx_obj_6gevent_4core_http_connection *)__pyx_v_self)->_owned = __pyx_t_1;
 
14413
 
 
14414
  __pyx_r = 0;
 
14415
  goto __pyx_L0;
 
14416
  __pyx_L1_error:;
 
14417
  __Pyx_AddTraceback("gevent.core.http_connection._owned.__set__");
 
14418
  __pyx_r = -1;
 
14419
  __pyx_L0:;
 
14420
  __Pyx_RefNannyFinishContext();
 
14421
  return __pyx_r;
 
14422
}
 
14423
 
 
14424
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":589
 
14425
 * 
 
14426
 * 
 
14427
 * cdef void _http_request_cb_handler(evhttp_request* c_request, void *arg) with gil:             # <<<<<<<<<<<<<<
 
14428
 *     if arg == NULL:
 
14429
 *         return
 
14430
 */
 
14431
 
 
14432
static  void __pyx_f_6gevent_4core__http_request_cb_handler(struct evhttp_request *__pyx_v_c_request, void *__pyx_v_arg) {
 
14433
  struct __pyx_obj_6gevent_4core_http_request_client *__pyx_v_obj = 0;
 
14434
  int __pyx_t_1;
 
14435
  PyObject *__pyx_t_2 = NULL;
 
14436
  PyObject *__pyx_t_3 = NULL;
 
14437
  PyObject *__pyx_t_4 = NULL;
 
14438
  PyObject *__pyx_t_5 = NULL;
 
14439
  PyObject *__pyx_t_6 = NULL;
 
14440
  #ifdef WITH_THREAD
 
14441
  PyGILState_STATE _save = PyGILState_Ensure();
 
14442
  #endif
 
14443
  __Pyx_RefNannySetupContext("_http_request_cb_handler");
 
14444
 
 
14445
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":590
 
14446
 * 
 
14447
 * cdef void _http_request_cb_handler(evhttp_request* c_request, void *arg) with gil:
 
14448
 *     if arg == NULL:             # <<<<<<<<<<<<<<
 
14449
 *         return
 
14450
 *     cdef http_request_client obj = <http_request_client>(arg)
 
14451
 */
 
14452
  __pyx_t_1 = (__pyx_v_arg == NULL);
 
14453
  if (__pyx_t_1) {
 
14454
 
 
14455
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":591
 
14456
 * cdef void _http_request_cb_handler(evhttp_request* c_request, void *arg) with gil:
 
14457
 *     if arg == NULL:
 
14458
 *         return             # <<<<<<<<<<<<<<
 
14459
 *     cdef http_request_client obj = <http_request_client>(arg)
 
14460
 *     try:
 
14461
 */
 
14462
    goto __pyx_L0;
 
14463
    goto __pyx_L3;
 
14464
  }
 
14465
  __pyx_L3:;
 
14466
 
 
14467
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":592
 
14468
 *     if arg == NULL:
 
14469
 *         return
 
14470
 *     cdef http_request_client obj = <http_request_client>(arg)             # <<<<<<<<<<<<<<
 
14471
 *     try:
 
14472
 *         if obj.__obj != NULL:
 
14473
 */
 
14474
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_arg)));
 
14475
  __pyx_v_obj = ((struct __pyx_obj_6gevent_4core_http_request_client *)__pyx_v_arg);
 
14476
 
 
14477
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":593
 
14478
 *         return
 
14479
 *     cdef http_request_client obj = <http_request_client>(arg)
 
14480
 *     try:             # <<<<<<<<<<<<<<
 
14481
 *         if obj.__obj != NULL:
 
14482
 *             if obj.__obj != c_request:
 
14483
 */
 
14484
  /*try:*/ {
 
14485
    {
 
14486
      PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
 
14487
      __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
 
14488
      __Pyx_XGOTREF(__pyx_save_exc_type);
 
14489
      __Pyx_XGOTREF(__pyx_save_exc_value);
 
14490
      __Pyx_XGOTREF(__pyx_save_exc_tb);
 
14491
      /*try:*/ {
 
14492
 
 
14493
        /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":594
 
14494
 *     cdef http_request_client obj = <http_request_client>(arg)
 
14495
 *     try:
 
14496
 *         if obj.__obj != NULL:             # <<<<<<<<<<<<<<
 
14497
 *             if obj.__obj != c_request:
 
14498
 *                 # sometimes this happens, don't know why
 
14499
 */
 
14500
        __pyx_t_1 = (__pyx_v_obj->__pyx_base.__pyx___obj != NULL);
 
14501
        if (__pyx_t_1) {
 
14502
 
 
14503
          /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":595
 
14504
 *     try:
 
14505
 *         if obj.__obj != NULL:
 
14506
 *             if obj.__obj != c_request:             # <<<<<<<<<<<<<<
 
14507
 *                 # sometimes this happens, don't know why
 
14508
 *                 sys.stderr.write("Internal error in evhttp\n")
 
14509
 */
 
14510
          __pyx_t_1 = (__pyx_v_obj->__pyx_base.__pyx___obj != __pyx_v_c_request);
 
14511
          if (__pyx_t_1) {
 
14512
 
 
14513
            /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":597
 
14514
 *             if obj.__obj != c_request:
 
14515
 *                 # sometimes this happens, don't know why
 
14516
 *                 sys.stderr.write("Internal error in evhttp\n")             # <<<<<<<<<<<<<<
 
14517
 *             if obj.callback is not None:
 
14518
 *                 # preferring c_request to obj.__obj because the latter sometimes causes crashes
 
14519
 */
 
14520
            __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
 
14521
            __Pyx_GOTREF(__pyx_t_2);
 
14522
            __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__stderr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
 
14523
            __Pyx_GOTREF(__pyx_t_3);
 
14524
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
14525
            __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__write); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
 
14526
            __Pyx_GOTREF(__pyx_t_2);
 
14527
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
14528
            __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_41), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
 
14529
            __Pyx_GOTREF(__pyx_t_3);
 
14530
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
14531
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
14532
            goto __pyx_L16;
 
14533
          }
 
14534
          __pyx_L16:;
 
14535
 
 
14536
          /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":598
 
14537
 *                 # sometimes this happens, don't know why
 
14538
 *                 sys.stderr.write("Internal error in evhttp\n")
 
14539
 *             if obj.callback is not None:             # <<<<<<<<<<<<<<
 
14540
 *                 # preferring c_request to obj.__obj because the latter sometimes causes crashes
 
14541
 *                 obj.callback(http_request_client(obj=<size_t>c_request))
 
14542
 */
 
14543
          __pyx_t_1 = (__pyx_v_obj->callback != Py_None);
 
14544
          if (__pyx_t_1) {
 
14545
 
 
14546
            /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":600
 
14547
 *             if obj.callback is not None:
 
14548
 *                 # preferring c_request to obj.__obj because the latter sometimes causes crashes
 
14549
 *                 obj.callback(http_request_client(obj=<size_t>c_request))             # <<<<<<<<<<<<<<
 
14550
 *             obj.detach()
 
14551
 *     except:
 
14552
 */
 
14553
            __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
 
14554
            __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
14555
            __pyx_t_2 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_c_request)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
 
14556
            __Pyx_GOTREF(__pyx_t_2);
 
14557
            if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__obj), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
 
14558
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
14559
            __pyx_t_2 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_http_request_client)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
 
14560
            __Pyx_GOTREF(__pyx_t_2);
 
14561
            __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
 
14562
            __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
 
14563
            __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
14564
            PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
 
14565
            __Pyx_GIVEREF(__pyx_t_2);
 
14566
            __pyx_t_2 = 0;
 
14567
            __pyx_t_2 = PyObject_Call(__pyx_v_obj->callback, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
 
14568
            __Pyx_GOTREF(__pyx_t_2);
 
14569
            __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
 
14570
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
14571
            goto __pyx_L17;
 
14572
          }
 
14573
          __pyx_L17:;
 
14574
 
 
14575
          /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":601
 
14576
 *                 # preferring c_request to obj.__obj because the latter sometimes causes crashes
 
14577
 *                 obj.callback(http_request_client(obj=<size_t>c_request))
 
14578
 *             obj.detach()             # <<<<<<<<<<<<<<
 
14579
 *     except:
 
14580
 *         traceback.print_exc()
 
14581
 */
 
14582
          __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_obj), __pyx_n_s__detach); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
 
14583
          __Pyx_GOTREF(__pyx_t_2);
 
14584
          __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L7_error;}
 
14585
          __Pyx_GOTREF(__pyx_t_3);
 
14586
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
14587
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
14588
          goto __pyx_L15;
 
14589
        }
 
14590
        __pyx_L15:;
 
14591
      }
 
14592
      __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
 
14593
      __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
 
14594
      __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
 
14595
      goto __pyx_L14_try_end;
 
14596
      __pyx_L7_error:;
 
14597
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
 
14598
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
14599
 
 
14600
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":602
 
14601
 *                 obj.callback(http_request_client(obj=<size_t>c_request))
 
14602
 *             obj.detach()
 
14603
 *     except:             # <<<<<<<<<<<<<<
 
14604
 *         traceback.print_exc()
 
14605
 *         try:
 
14606
 */
 
14607
      /*except:*/ {
 
14608
        __Pyx_AddTraceback("gevent.core._http_request_cb_handler");
 
14609
        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
 
14610
        __Pyx_GOTREF(__pyx_t_3);
 
14611
        __Pyx_GOTREF(__pyx_t_2);
 
14612
        __Pyx_GOTREF(__pyx_t_4);
 
14613
 
 
14614
        /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":603
 
14615
 *             obj.detach()
 
14616
 *     except:
 
14617
 *         traceback.print_exc()             # <<<<<<<<<<<<<<
 
14618
 *         try:
 
14619
 *             sys.stderr.write('Failed to execute callback for evhttp request.\n')
 
14620
 */
 
14621
        __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
 
14622
        __Pyx_GOTREF(__pyx_t_5);
 
14623
        __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
 
14624
        __Pyx_GOTREF(__pyx_t_6);
 
14625
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
14626
        __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L9_except_error;}
 
14627
        __Pyx_GOTREF(__pyx_t_5);
 
14628
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
14629
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
14630
 
 
14631
        /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":604
 
14632
 *     except:
 
14633
 *         traceback.print_exc()
 
14634
 *         try:             # <<<<<<<<<<<<<<
 
14635
 *             sys.stderr.write('Failed to execute callback for evhttp request.\n')
 
14636
 *         except:
 
14637
 */
 
14638
        {
 
14639
          PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
 
14640
          __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
 
14641
          __Pyx_XGOTREF(__pyx_save_exc_type);
 
14642
          __Pyx_XGOTREF(__pyx_save_exc_value);
 
14643
          __Pyx_XGOTREF(__pyx_save_exc_tb);
 
14644
          /*try:*/ {
 
14645
 
 
14646
            /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":605
 
14647
 *         traceback.print_exc()
 
14648
 *         try:
 
14649
 *             sys.stderr.write('Failed to execute callback for evhttp request.\n')             # <<<<<<<<<<<<<<
 
14650
 *         except:
 
14651
 *             pass
 
14652
 */
 
14653
            __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L20_error;}
 
14654
            __Pyx_GOTREF(__pyx_t_5);
 
14655
            __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__stderr); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L20_error;}
 
14656
            __Pyx_GOTREF(__pyx_t_6);
 
14657
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
14658
            __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L20_error;}
 
14659
            __Pyx_GOTREF(__pyx_t_5);
 
14660
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
14661
            __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_43), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L20_error;}
 
14662
            __Pyx_GOTREF(__pyx_t_6);
 
14663
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
14664
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
14665
          }
 
14666
          __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
 
14667
          __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
 
14668
          __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
 
14669
          goto __pyx_L27_try_end;
 
14670
          __pyx_L20_error:;
 
14671
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
14672
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
 
14673
 
 
14674
          /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":606
 
14675
 *         try:
 
14676
 *             sys.stderr.write('Failed to execute callback for evhttp request.\n')
 
14677
 *         except:             # <<<<<<<<<<<<<<
 
14678
 *             pass
 
14679
 *     finally:
 
14680
 */
 
14681
          /*except:*/ {
 
14682
            PyErr_Restore(0,0,0);
 
14683
            goto __pyx_L21_exception_handled;
 
14684
          }
 
14685
          __pyx_L21_exception_handled:;
 
14686
          __Pyx_XGIVEREF(__pyx_save_exc_type);
 
14687
          __Pyx_XGIVEREF(__pyx_save_exc_value);
 
14688
          __Pyx_XGIVEREF(__pyx_save_exc_tb);
 
14689
          __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
 
14690
          __pyx_L27_try_end:;
 
14691
        }
 
14692
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
14693
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
14694
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
14695
        goto __pyx_L8_exception_handled;
 
14696
      }
 
14697
      __pyx_L9_except_error:;
 
14698
      __Pyx_XGIVEREF(__pyx_save_exc_type);
 
14699
      __Pyx_XGIVEREF(__pyx_save_exc_value);
 
14700
      __Pyx_XGIVEREF(__pyx_save_exc_tb);
 
14701
      __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
 
14702
      goto __pyx_L5;
 
14703
      __pyx_L8_exception_handled:;
 
14704
      __Pyx_XGIVEREF(__pyx_save_exc_type);
 
14705
      __Pyx_XGIVEREF(__pyx_save_exc_value);
 
14706
      __Pyx_XGIVEREF(__pyx_save_exc_tb);
 
14707
      __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
 
14708
      __pyx_L14_try_end:;
 
14709
    }
 
14710
  }
 
14711
 
 
14712
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":609
 
14713
 *             pass
 
14714
 *     finally:
 
14715
 *         obj._delref()             # <<<<<<<<<<<<<<
 
14716
 * 
 
14717
 * 
 
14718
 */
 
14719
  /*finally:*/ {
 
14720
    int __pyx_why;
 
14721
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
 
14722
    int __pyx_exc_lineno;
 
14723
    __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
 
14724
    __pyx_why = 0; goto __pyx_L6;
 
14725
    __pyx_L5: {
 
14726
      __pyx_why = 4;
 
14727
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
14728
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
 
14729
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
14730
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
 
14731
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
 
14732
      __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
 
14733
      __pyx_exc_lineno = __pyx_lineno;
 
14734
      goto __pyx_L6;
 
14735
    }
 
14736
    __pyx_L6:;
 
14737
    __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_4core_http_request_client *)__pyx_v_obj->__pyx_vtab)->_delref(__pyx_v_obj); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L28_error;}
 
14738
    __Pyx_GOTREF(__pyx_t_4);
 
14739
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
14740
    goto __pyx_L29;
 
14741
    __pyx_L28_error:;
 
14742
    if (__pyx_why == 4) {
 
14743
      Py_XDECREF(__pyx_exc_type);
 
14744
      Py_XDECREF(__pyx_exc_value);
 
14745
      Py_XDECREF(__pyx_exc_tb);
 
14746
    }
 
14747
    goto __pyx_L1_error;
 
14748
    __pyx_L29:;
 
14749
    switch (__pyx_why) {
 
14750
      case 4: {
 
14751
        __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
 
14752
        __pyx_lineno = __pyx_exc_lineno;
 
14753
        __pyx_exc_type = 0;
 
14754
        __pyx_exc_value = 0;
 
14755
        __pyx_exc_tb = 0;
 
14756
        goto __pyx_L1_error;
 
14757
      }
 
14758
    }
 
14759
  }
 
14760
 
 
14761
  goto __pyx_L0;
 
14762
  __pyx_L1_error:;
 
14763
  __Pyx_XDECREF(__pyx_t_2);
 
14764
  __Pyx_XDECREF(__pyx_t_3);
 
14765
  __Pyx_XDECREF(__pyx_t_4);
 
14766
  __Pyx_XDECREF(__pyx_t_5);
 
14767
  __Pyx_XDECREF(__pyx_t_6);
 
14768
  __Pyx_WriteUnraisable("gevent.core._http_request_cb_handler");
 
14769
  __pyx_L0:;
 
14770
  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
 
14771
  __Pyx_RefNannyFinishContext();
 
14772
  #ifdef WITH_THREAD
 
14773
  PyGILState_Release(_save);
 
14774
  #endif
 
14775
}
 
14776
 
 
14777
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":612
13010
14778
 * 
13011
14779
 * 
13012
14780
 * cdef void _http_cb_handler(evhttp_request* request, void *arg) with gil:             # <<<<<<<<<<<<<<
13023
14791
  PyObject *__pyx_t_2 = NULL;
13024
14792
  PyObject *__pyx_t_3 = NULL;
13025
14793
  int __pyx_t_4;
13026
 
  size_t __pyx_t_5;
 
14794
  PyObject *__pyx_t_5 = NULL;
13027
14795
  PyObject *__pyx_t_6 = NULL;
13028
14796
  PyObject *__pyx_t_7 = NULL;
13029
14797
  PyObject *__pyx_t_8 = NULL;
13030
14798
  PyObject *__pyx_t_9 = NULL;
13031
 
  PyObject *__pyx_t_10 = NULL;
 
14799
  #ifdef WITH_THREAD
13032
14800
  PyGILState_STATE _save = PyGILState_Ensure();
 
14801
  #endif
13033
14802
  __Pyx_RefNannySetupContext("_http_cb_handler");
13034
14803
  __pyx_v_requests = Py_None; __Pyx_INCREF(Py_None);
13035
14804
 
13036
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":463
 
14805
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":613
13037
14806
 * 
13038
14807
 * cdef void _http_cb_handler(evhttp_request* request, void *arg) with gil:
13039
14808
 *     cdef http server = <object>arg             # <<<<<<<<<<<<<<
13040
14809
 *     cdef http_request req = http_request(<size_t>request, server.default_response_headers)
13041
14810
 *     cdef evhttp_connection* conn = request.evcon
13042
14811
 */
13043
 
  if (!(likely(((((PyObject *)__pyx_v_arg)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_arg), __pyx_ptype_6gevent_4core_http))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
14812
  if (!(likely(((((PyObject *)__pyx_v_arg)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_arg), __pyx_ptype_6gevent_4core_http))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13044
14813
  __Pyx_INCREF(((PyObject *)__pyx_v_arg));
13045
14814
  __pyx_v_server = ((struct __pyx_obj_6gevent_4core_http *)((PyObject *)__pyx_v_arg));
13046
14815
 
13047
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":464
 
14816
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":614
13048
14817
 * cdef void _http_cb_handler(evhttp_request* request, void *arg) with gil:
13049
14818
 *     cdef http server = <object>arg
13050
14819
 *     cdef http_request req = http_request(<size_t>request, server.default_response_headers)             # <<<<<<<<<<<<<<
13051
14820
 *     cdef evhttp_connection* conn = request.evcon
13052
14821
 *     cdef object requests
13053
14822
 */
13054
 
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_request)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
14823
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_request)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13055
14824
  __Pyx_GOTREF(__pyx_t_1);
13056
 
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13057
 
  __Pyx_GOTREF(__pyx_t_2);
 
14825
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
14826
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
13058
14827
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13059
14828
  __Pyx_GIVEREF(__pyx_t_1);
13060
14829
  __Pyx_INCREF(__pyx_v_server->default_response_headers);
13061
14830
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_server->default_response_headers);
13062
14831
  __Pyx_GIVEREF(__pyx_v_server->default_response_headers);
13063
14832
  __pyx_t_1 = 0;
13064
 
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_http_request)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
14833
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_http_request)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13065
14834
  __Pyx_GOTREF(__pyx_t_1);
13066
 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
14835
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
13067
14836
  __pyx_v_req = ((struct __pyx_obj_6gevent_4core_http_request *)__pyx_t_1);
13068
14837
  __pyx_t_1 = 0;
13069
14838
 
13070
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":465
 
14839
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":615
13071
14840
 *     cdef http server = <object>arg
13072
14841
 *     cdef http_request req = http_request(<size_t>request, server.default_response_headers)
13073
14842
 *     cdef evhttp_connection* conn = request.evcon             # <<<<<<<<<<<<<<
13076
14845
 */
13077
14846
  __pyx_v_conn = __pyx_v_request->evcon;
13078
14847
 
13079
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":467
 
14848
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":617
13080
14849
 *     cdef evhttp_connection* conn = request.evcon
13081
14850
 *     cdef object requests
13082
14851
 *     try:             # <<<<<<<<<<<<<<
13091
14860
    __Pyx_XGOTREF(__pyx_save_exc_tb);
13092
14861
    /*try:*/ {
13093
14862
 
13094
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":468
 
14863
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":618
13095
14864
 *     cdef object requests
13096
14865
 *     try:
13097
14866
 *         evhttp_connection_set_closecb(conn, _http_closecb_handler, arg)             # <<<<<<<<<<<<<<
13100
14869
 */
13101
14870
      evhttp_connection_set_closecb(__pyx_v_conn, __pyx_f_6gevent_4core__http_closecb_handler, __pyx_v_arg);
13102
14871
 
13103
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":469
 
14872
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":619
13104
14873
 *     try:
13105
14874
 *         evhttp_connection_set_closecb(conn, _http_closecb_handler, arg)
13106
14875
 *         requests = server._requests.pop(<size_t>conn, None)             # <<<<<<<<<<<<<<
13107
14876
 *         if requests is None:
13108
14877
 *             requests = weakref.WeakKeyDictionary()
13109
14878
 */
13110
 
      __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_server->_requests), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14879
      __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_server->_requests), __pyx_n_s__pop); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13111
14880
      __Pyx_GOTREF(__pyx_t_1);
13112
 
      __pyx_t_2 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_conn)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14881
      __pyx_t_2 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_conn)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13113
14882
      __Pyx_GOTREF(__pyx_t_2);
13114
 
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13115
 
      __Pyx_GOTREF(__pyx_t_3);
 
14883
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14884
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
13116
14885
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
13117
14886
      __Pyx_GIVEREF(__pyx_t_2);
13118
14887
      __Pyx_INCREF(Py_None);
13119
14888
      PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None);
13120
14889
      __Pyx_GIVEREF(Py_None);
13121
14890
      __pyx_t_2 = 0;
13122
 
      __pyx_t_2 = PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14891
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13123
14892
      __Pyx_GOTREF(__pyx_t_2);
13124
14893
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13125
 
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
14894
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
13126
14895
      __Pyx_DECREF(__pyx_v_requests);
13127
14896
      __pyx_v_requests = __pyx_t_2;
13128
14897
      __pyx_t_2 = 0;
13129
14898
 
13130
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":470
 
14899
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":620
13131
14900
 *         evhttp_connection_set_closecb(conn, _http_closecb_handler, arg)
13132
14901
 *         requests = server._requests.pop(<size_t>conn, None)
13133
14902
 *         if requests is None:             # <<<<<<<<<<<<<<
13137
14906
      __pyx_t_4 = (__pyx_v_requests == Py_None);
13138
14907
      if (__pyx_t_4) {
13139
14908
 
13140
 
        /* "/home/denis/work/gevent/gevent/evhttp.pxi":471
 
14909
        /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":621
13141
14910
 *         requests = server._requests.pop(<size_t>conn, None)
13142
14911
 *         if requests is None:
13143
14912
 *             requests = weakref.WeakKeyDictionary()             # <<<<<<<<<<<<<<
13144
14913
 *             server._requests[<size_t>conn] = requests
13145
14914
 *         requests[req] = True
13146
14915
 */
13147
 
        __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__weakref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14916
        __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__weakref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13148
14917
        __Pyx_GOTREF(__pyx_t_2);
13149
 
        __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__WeakKeyDictionary); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14918
        __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__WeakKeyDictionary); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13150
14919
        __Pyx_GOTREF(__pyx_t_3);
13151
14920
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13152
 
        __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14921
        __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13153
14922
        __Pyx_GOTREF(__pyx_t_2);
13154
14923
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13155
14924
        __Pyx_DECREF(__pyx_v_requests);
13156
14925
        __pyx_v_requests = __pyx_t_2;
13157
14926
        __pyx_t_2 = 0;
13158
14927
 
13159
 
        /* "/home/denis/work/gevent/gevent/evhttp.pxi":472
 
14928
        /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":622
13160
14929
 *         if requests is None:
13161
14930
 *             requests = weakref.WeakKeyDictionary()
13162
14931
 *             server._requests[<size_t>conn] = requests             # <<<<<<<<<<<<<<
13163
14932
 *         requests[req] = True
13164
14933
 *         server.handle(req)
13165
14934
 */
13166
 
        __pyx_t_5 = ((size_t)__pyx_v_conn);
13167
 
        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_server->_requests), __pyx_t_5, __pyx_v_requests, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14935
        if (__Pyx_SetItemInt(((PyObject *)__pyx_v_server->_requests), ((size_t)__pyx_v_conn), __pyx_v_requests, sizeof(size_t)+1, __Pyx_PyInt_FromSize_t) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13168
14936
        goto __pyx_L11;
13169
14937
      }
13170
14938
      __pyx_L11:;
13171
14939
 
13172
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":473
 
14940
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":623
13173
14941
 *             requests = weakref.WeakKeyDictionary()
13174
14942
 *             server._requests[<size_t>conn] = requests
13175
14943
 *         requests[req] = True             # <<<<<<<<<<<<<<
13176
14944
 *         server.handle(req)
13177
14945
 *     except:
13178
14946
 */
13179
 
      __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14947
      __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13180
14948
      __Pyx_GOTREF(__pyx_t_2);
13181
 
      if (PyObject_SetItem(__pyx_v_requests, ((PyObject *)__pyx_v_req), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14949
      if (PyObject_SetItem(__pyx_v_requests, ((PyObject *)__pyx_v_req), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13182
14950
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13183
14951
 
13184
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":474
 
14952
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":624
13185
14953
 *             server._requests[<size_t>conn] = requests
13186
14954
 *         requests[req] = True
13187
14955
 *         server.handle(req)             # <<<<<<<<<<<<<<
13188
14956
 *     except:
13189
14957
 *         traceback.print_exc()
13190
14958
 */
13191
 
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13192
 
      __Pyx_GOTREF(__pyx_t_2);
 
14959
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14960
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
13193
14961
      __Pyx_INCREF(((PyObject *)__pyx_v_req));
13194
14962
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_req));
13195
14963
      __Pyx_GIVEREF(((PyObject *)__pyx_v_req));
13196
 
      __pyx_t_3 = PyObject_Call(__pyx_v_server->handle, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
14964
      __pyx_t_3 = PyObject_Call(__pyx_v_server->handle, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13197
14965
      __Pyx_GOTREF(__pyx_t_3);
13198
 
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
14966
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
13199
14967
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13200
14968
    }
13201
14969
    __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
13207
14975
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
13208
14976
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
13209
14977
 
13210
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":475
 
14978
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":625
13211
14979
 *         requests[req] = True
13212
14980
 *         server.handle(req)
13213
14981
 *     except:             # <<<<<<<<<<<<<<
13216
14984
 */
13217
14985
    /*except:*/ {
13218
14986
      __Pyx_AddTraceback("gevent.core._http_cb_handler");
13219
 
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
 
14987
      if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
13220
14988
      __Pyx_GOTREF(__pyx_t_3);
13221
14989
      __Pyx_GOTREF(__pyx_t_2);
13222
14990
      __Pyx_GOTREF(__pyx_t_1);
13223
14991
 
13224
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":476
 
14992
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":626
13225
14993
 *         server.handle(req)
13226
14994
 *     except:
13227
14995
 *         traceback.print_exc()             # <<<<<<<<<<<<<<
13228
14996
 *         try:
13229
14997
 *             sys.stderr.write('%s: Failed to handle request: %s\n\n' % (server, req, ))
13230
14998
 */
13231
 
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
13232
 
      __Pyx_GOTREF(__pyx_t_6);
13233
 
      __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
13234
 
      __Pyx_GOTREF(__pyx_t_7);
13235
 
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13236
 
      __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
13237
 
      __Pyx_GOTREF(__pyx_t_6);
13238
 
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13239
 
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
14999
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
 
15000
      __Pyx_GOTREF(__pyx_t_5);
 
15001
      __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
 
15002
      __Pyx_GOTREF(__pyx_t_6);
 
15003
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
15004
      __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
 
15005
      __Pyx_GOTREF(__pyx_t_5);
 
15006
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
15007
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13240
15008
 
13241
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":477
 
15009
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":627
13242
15010
 *     except:
13243
15011
 *         traceback.print_exc()
13244
15012
 *         try:             # <<<<<<<<<<<<<<
13253
15021
        __Pyx_XGOTREF(__pyx_save_exc_tb);
13254
15022
        /*try:*/ {
13255
15023
 
13256
 
          /* "/home/denis/work/gevent/gevent/evhttp.pxi":478
 
15024
          /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":628
13257
15025
 *         traceback.print_exc()
13258
15026
 *         try:
13259
15027
 *             sys.stderr.write('%s: Failed to handle request: %s\n\n' % (server, req, ))             # <<<<<<<<<<<<<<
13260
15028
 *         except:
13261
15029
 *             traceback.print_exc()
13262
15030
 */
13263
 
          __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
 
15031
          __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
 
15032
          __Pyx_GOTREF(__pyx_t_5);
 
15033
          __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__stderr); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
13264
15034
          __Pyx_GOTREF(__pyx_t_6);
13265
 
          __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__stderr); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
13266
 
          __Pyx_GOTREF(__pyx_t_7);
 
15035
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
15036
          __pyx_t_5 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
 
15037
          __Pyx_GOTREF(__pyx_t_5);
13267
15038
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13268
 
          __pyx_t_6 = PyObject_GetAttr(__pyx_t_7, __pyx_n_s__write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
13269
 
          __Pyx_GOTREF(__pyx_t_6);
13270
 
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13271
 
          __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
13272
 
          __Pyx_GOTREF(__pyx_t_7);
 
15039
          __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
 
15040
          __Pyx_GOTREF(((PyObject *)__pyx_t_6));
13273
15041
          __Pyx_INCREF(((PyObject *)__pyx_v_server));
13274
 
          PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_server));
 
15042
          PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_server));
13275
15043
          __Pyx_GIVEREF(((PyObject *)__pyx_v_server));
13276
15044
          __Pyx_INCREF(((PyObject *)__pyx_v_req));
13277
 
          PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_req));
 
15045
          PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_req));
13278
15046
          __Pyx_GIVEREF(((PyObject *)__pyx_v_req));
13279
 
          __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_34), __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
13280
 
          __Pyx_GOTREF(__pyx_t_8);
13281
 
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13282
 
          __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
 
15047
          __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_44), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
 
15048
          __Pyx_GOTREF(((PyObject *)__pyx_t_7));
 
15049
          __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
 
15050
          __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
 
15051
          __Pyx_GOTREF(((PyObject *)__pyx_t_6));
 
15052
          PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_7));
 
15053
          __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
 
15054
          __pyx_t_7 = 0;
 
15055
          __pyx_t_7 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
13283
15056
          __Pyx_GOTREF(__pyx_t_7);
13284
 
          PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
13285
 
          __Pyx_GIVEREF(__pyx_t_8);
13286
 
          __pyx_t_8 = 0;
13287
 
          __pyx_t_8 = PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L14_error;}
13288
 
          __Pyx_GOTREF(__pyx_t_8);
13289
 
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
15057
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
15058
          __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
13290
15059
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13291
 
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13292
15060
        }
13293
15061
        __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
13294
15062
        __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
13295
15063
        __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
13296
15064
        goto __pyx_L21_try_end;
13297
15065
        __pyx_L14_error:;
 
15066
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13298
15067
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
13299
15068
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
13300
 
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
13301
15069
 
13302
 
        /* "/home/denis/work/gevent/gevent/evhttp.pxi":479
 
15070
        /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":629
13303
15071
 *         try:
13304
15072
 *             sys.stderr.write('%s: Failed to handle request: %s\n\n' % (server, req, ))
13305
15073
 *         except:             # <<<<<<<<<<<<<<
13308
15076
 */
13309
15077
        /*except:*/ {
13310
15078
          __Pyx_AddTraceback("gevent.core._http_cb_handler");
13311
 
          if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
13312
 
          __Pyx_GOTREF(__pyx_t_8);
 
15079
          if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 629; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
13313
15080
          __Pyx_GOTREF(__pyx_t_7);
13314
15081
          __Pyx_GOTREF(__pyx_t_6);
 
15082
          __Pyx_GOTREF(__pyx_t_5);
13315
15083
 
13316
 
          /* "/home/denis/work/gevent/gevent/evhttp.pxi":480
 
15084
          /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":630
13317
15085
 *             sys.stderr.write('%s: Failed to handle request: %s\n\n' % (server, req, ))
13318
15086
 *         except:
13319
15087
 *             traceback.print_exc()             # <<<<<<<<<<<<<<
13320
15088
 *         # without clearing exc_info a reference to the request is somehow leaked
13321
15089
 *         sys.exc_clear()
13322
15090
 */
13323
 
          __pyx_t_9 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
13324
 
          __Pyx_GOTREF(__pyx_t_9);
13325
 
          __pyx_t_10 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
13326
 
          __Pyx_GOTREF(__pyx_t_10);
13327
 
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13328
 
          __pyx_t_9 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
13329
 
          __Pyx_GOTREF(__pyx_t_9);
13330
 
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
 
15091
          __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s__traceback); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
 
15092
          __Pyx_GOTREF(__pyx_t_8);
 
15093
          __pyx_t_9 = PyObject_GetAttr(__pyx_t_8, __pyx_n_s__print_exc); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
 
15094
          __Pyx_GOTREF(__pyx_t_9);
 
15095
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
15096
          __pyx_t_8 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L16_except_error;}
 
15097
          __Pyx_GOTREF(__pyx_t_8);
13331
15098
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
13332
15099
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
13333
15100
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13334
15101
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
15102
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13335
15103
          goto __pyx_L15_exception_handled;
13336
15104
        }
13337
15105
        __pyx_L16_except_error:;
13348
15116
        __pyx_L21_try_end:;
13349
15117
      }
13350
15118
 
13351
 
      /* "/home/denis/work/gevent/gevent/evhttp.pxi":482
 
15119
      /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":632
13352
15120
 *             traceback.print_exc()
13353
15121
 *         # without clearing exc_info a reference to the request is somehow leaked
13354
15122
 *         sys.exc_clear()             # <<<<<<<<<<<<<<
13355
15123
 * 
13356
15124
 * 
13357
15125
 */
13358
 
      __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
13359
 
      __Pyx_GOTREF(__pyx_t_6);
13360
 
      __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__exc_clear); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
13361
 
      __Pyx_GOTREF(__pyx_t_7);
13362
 
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13363
 
      __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
13364
 
      __Pyx_GOTREF(__pyx_t_6);
13365
 
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
13366
 
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
15126
      __pyx_t_5 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
 
15127
      __Pyx_GOTREF(__pyx_t_5);
 
15128
      __pyx_t_6 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__exc_clear); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
 
15129
      __Pyx_GOTREF(__pyx_t_6);
 
15130
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
15131
      __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
 
15132
      __Pyx_GOTREF(__pyx_t_5);
 
15133
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
15134
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13367
15135
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13368
15136
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13369
15137
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13388
15156
  __Pyx_XDECREF(__pyx_t_1);
13389
15157
  __Pyx_XDECREF(__pyx_t_2);
13390
15158
  __Pyx_XDECREF(__pyx_t_3);
 
15159
  __Pyx_XDECREF(__pyx_t_5);
13391
15160
  __Pyx_XDECREF(__pyx_t_6);
13392
15161
  __Pyx_XDECREF(__pyx_t_7);
13393
15162
  __Pyx_XDECREF(__pyx_t_8);
13394
15163
  __Pyx_XDECREF(__pyx_t_9);
13395
 
  __Pyx_XDECREF(__pyx_t_10);
13396
15164
  __Pyx_WriteUnraisable("gevent.core._http_cb_handler");
13397
15165
  __pyx_L0:;
13398
15166
  __Pyx_XDECREF((PyObject *)__pyx_v_server);
13399
15167
  __Pyx_XDECREF((PyObject *)__pyx_v_req);
13400
15168
  __Pyx_DECREF(__pyx_v_requests);
13401
15169
  __Pyx_RefNannyFinishContext();
 
15170
  #ifdef WITH_THREAD
13402
15171
  PyGILState_Release(_save);
 
15172
  #endif
13403
15173
}
13404
15174
 
13405
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":485
 
15175
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":635
13406
15176
 * 
13407
15177
 * 
13408
15178
 * cdef void _http_closecb_handler(evhttp_connection* connection, void *arg) with gil:             # <<<<<<<<<<<<<<
13418
15188
  PyObject *__pyx_t_3 = NULL;
13419
15189
  PyObject *__pyx_t_4 = NULL;
13420
15190
  PyObject *__pyx_t_5 = NULL;
 
15191
  #ifdef WITH_THREAD
13421
15192
  PyGILState_STATE _save = PyGILState_Ensure();
 
15193
  #endif
13422
15194
  __Pyx_RefNannySetupContext("_http_closecb_handler");
13423
15195
  __pyx_v_request = Py_None; __Pyx_INCREF(Py_None);
13424
15196
 
13425
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":486
 
15197
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":636
13426
15198
 * 
13427
15199
 * cdef void _http_closecb_handler(evhttp_connection* connection, void *arg) with gil:
13428
15200
 *     cdef http server = <object>arg             # <<<<<<<<<<<<<<
13429
15201
 *     cdef object requests
13430
15202
 *     for request in server._requests.pop(<size_t>connection, {}).keys():
13431
15203
 */
13432
 
  if (!(likely(((((PyObject *)__pyx_v_arg)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_arg), __pyx_ptype_6gevent_4core_http))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15204
  if (!(likely(((((PyObject *)__pyx_v_arg)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_arg), __pyx_ptype_6gevent_4core_http))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13433
15205
  __Pyx_INCREF(((PyObject *)__pyx_v_arg));
13434
15206
  __pyx_v_server = ((struct __pyx_obj_6gevent_4core_http *)((PyObject *)__pyx_v_arg));
13435
15207
 
13436
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":488
 
15208
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":638
13437
15209
 *     cdef http server = <object>arg
13438
15210
 *     cdef object requests
13439
15211
 *     for request in server._requests.pop(<size_t>connection, {}).keys():             # <<<<<<<<<<<<<<
13440
15212
 *         request.detach()
13441
15213
 * 
13442
15214
 */
13443
 
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_server->_requests), __pyx_n_s__pop); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15215
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_server->_requests), __pyx_n_s__pop); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13444
15216
  __Pyx_GOTREF(__pyx_t_2);
13445
 
  __pyx_t_3 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_connection)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15217
  __pyx_t_3 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_connection)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13446
15218
  __Pyx_GOTREF(__pyx_t_3);
13447
 
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15219
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13448
15220
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
13449
 
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13450
 
  __Pyx_GOTREF(__pyx_t_5);
 
15221
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15222
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
13451
15223
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
13452
15224
  __Pyx_GIVEREF(__pyx_t_3);
13453
15225
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_4));
13454
15226
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
13455
15227
  __pyx_t_3 = 0;
13456
15228
  __pyx_t_4 = 0;
13457
 
  __pyx_t_4 = PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15229
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13458
15230
  __Pyx_GOTREF(__pyx_t_4);
13459
15231
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13460
 
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13461
 
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__keys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15232
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
 
15233
  __pyx_t_5 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__keys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13462
15234
  __Pyx_GOTREF(__pyx_t_5);
13463
15235
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13464
 
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15236
  __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13465
15237
  __Pyx_GOTREF(__pyx_t_4);
13466
15238
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
13467
15239
  if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) {
13468
15240
    __pyx_t_1 = 0; __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5);
13469
15241
  } else {
13470
 
    __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15242
    __pyx_t_1 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13471
15243
    __Pyx_GOTREF(__pyx_t_5);
13472
15244
  }
13473
15245
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13481
15253
    } else {
13482
15254
      __pyx_t_4 = PyIter_Next(__pyx_t_5);
13483
15255
      if (!__pyx_t_4) {
13484
 
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15256
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13485
15257
        break;
13486
15258
      }
13487
15259
      __Pyx_GOTREF(__pyx_t_4);
13490
15262
    __pyx_v_request = __pyx_t_4;
13491
15263
    __pyx_t_4 = 0;
13492
15264
 
13493
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":489
 
15265
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":639
13494
15266
 *     cdef object requests
13495
15267
 *     for request in server._requests.pop(<size_t>connection, {}).keys():
13496
15268
 *         request.detach()             # <<<<<<<<<<<<<<
13497
15269
 * 
13498
15270
 * 
13499
15271
 */
13500
 
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_request, __pyx_n_s__detach); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15272
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_request, __pyx_n_s__detach); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13501
15273
    __Pyx_GOTREF(__pyx_t_4);
13502
 
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15274
    __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13503
15275
    __Pyx_GOTREF(__pyx_t_2);
13504
15276
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13505
15277
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13517
15289
  __Pyx_XDECREF((PyObject *)__pyx_v_server);
13518
15290
  __Pyx_DECREF(__pyx_v_request);
13519
15291
  __Pyx_RefNannyFinishContext();
 
15292
  #ifdef WITH_THREAD
13520
15293
  PyGILState_Release(_save);
 
15294
  #endif
13521
15295
}
13522
15296
 
13523
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":492
 
15297
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":642
13524
15298
 * 
13525
15299
 * 
13526
15300
 * cdef void _http_cb_reply_error(evhttp_request* request, void *arg):             # <<<<<<<<<<<<<<
13531
15305
static  void __pyx_f_6gevent_4core__http_cb_reply_error(struct evhttp_request *__pyx_v_request, void *__pyx_v_arg) {
13532
15306
  __Pyx_RefNannySetupContext("_http_cb_reply_error");
13533
15307
 
13534
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":493
 
15308
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":643
13535
15309
 * 
13536
15310
 * cdef void _http_cb_reply_error(evhttp_request* request, void *arg):
13537
15311
 *     report_internal_error(request)             # <<<<<<<<<<<<<<
13543
15317
  __Pyx_RefNannyFinishContext();
13544
15318
}
13545
15319
 
13546
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":496
 
15320
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":646
13547
15321
 * 
13548
15322
 * 
13549
15323
 * cdef void report_internal_error(evhttp_request* request):             # <<<<<<<<<<<<<<
13558
15332
  int __pyx_t_3;
13559
15333
  __Pyx_RefNannySetupContext("report_internal_error");
13560
15334
 
13561
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":498
 
15335
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":648
13562
15336
 * cdef void report_internal_error(evhttp_request* request):
13563
15337
 *     cdef evbuffer* c_buf
13564
15338
 *     if request != NULL and request.response_code == 0:             # <<<<<<<<<<<<<<
13574
15348
  }
13575
15349
  if (__pyx_t_3) {
13576
15350
 
13577
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":499
 
15351
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":649
13578
15352
 *     cdef evbuffer* c_buf
13579
15353
 *     if request != NULL and request.response_code == 0:
13580
15354
 *         evhttp_add_header(request.output_headers, "Connection", "close")             # <<<<<<<<<<<<<<
13583
15357
 */
13584
15358
    evhttp_add_header(__pyx_v_request->output_headers, __pyx_k__Connection, __pyx_k__close);
13585
15359
 
13586
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":500
 
15360
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":650
13587
15361
 *     if request != NULL and request.response_code == 0:
13588
15362
 *         evhttp_add_header(request.output_headers, "Connection", "close")
13589
15363
 *         evhttp_add_header(request.output_headers, "Content-type", "text/plain")             # <<<<<<<<<<<<<<
13590
15364
 *         c_buf = evbuffer_new()
13591
15365
 *         evhttp_add_header(request.output_headers, "Content-length", "21")
13592
15366
 */
13593
 
    evhttp_add_header(__pyx_v_request->output_headers, __pyx_k_35, __pyx_k_36);
 
15367
    evhttp_add_header(__pyx_v_request->output_headers, __pyx_k_45, __pyx_k_46);
13594
15368
 
13595
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":501
 
15369
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":651
13596
15370
 *         evhttp_add_header(request.output_headers, "Connection", "close")
13597
15371
 *         evhttp_add_header(request.output_headers, "Content-type", "text/plain")
13598
15372
 *         c_buf = evbuffer_new()             # <<<<<<<<<<<<<<
13601
15375
 */
13602
15376
    __pyx_v_c_buf = evbuffer_new();
13603
15377
 
13604
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":502
 
15378
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":652
13605
15379
 *         evhttp_add_header(request.output_headers, "Content-type", "text/plain")
13606
15380
 *         c_buf = evbuffer_new()
13607
15381
 *         evhttp_add_header(request.output_headers, "Content-length", "21")             # <<<<<<<<<<<<<<
13608
15382
 *         evbuffer_add(c_buf, "Internal Server Error", 21)
13609
15383
 *         evhttp_send_reply(request, 500, "Internal Server Error", c_buf)
13610
15384
 */
13611
 
    evhttp_add_header(__pyx_v_request->output_headers, __pyx_k_37, __pyx_k__21);
 
15385
    evhttp_add_header(__pyx_v_request->output_headers, __pyx_k_47, __pyx_k__21);
13612
15386
 
13613
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":503
 
15387
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":653
13614
15388
 *         c_buf = evbuffer_new()
13615
15389
 *         evhttp_add_header(request.output_headers, "Content-length", "21")
13616
15390
 *         evbuffer_add(c_buf, "Internal Server Error", 21)             # <<<<<<<<<<<<<<
13617
15391
 *         evhttp_send_reply(request, 500, "Internal Server Error", c_buf)
13618
15392
 *         evbuffer_free(c_buf)
13619
15393
 */
13620
 
    evbuffer_add(__pyx_v_c_buf, __pyx_k_38, 21);
 
15394
    evbuffer_add(__pyx_v_c_buf, __pyx_k_48, 21);
13621
15395
 
13622
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":504
 
15396
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":654
13623
15397
 *         evhttp_add_header(request.output_headers, "Content-length", "21")
13624
15398
 *         evbuffer_add(c_buf, "Internal Server Error", 21)
13625
15399
 *         evhttp_send_reply(request, 500, "Internal Server Error", c_buf)             # <<<<<<<<<<<<<<
13626
15400
 *         evbuffer_free(c_buf)
13627
15401
 * 
13628
15402
 */
13629
 
    evhttp_send_reply(__pyx_v_request, 500, __pyx_k_38, __pyx_v_c_buf);
 
15403
    evhttp_send_reply(__pyx_v_request, 500, __pyx_k_48, __pyx_v_c_buf);
13630
15404
 
13631
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":505
 
15405
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":655
13632
15406
 *         evbuffer_add(c_buf, "Internal Server Error", 21)
13633
15407
 *         evhttp_send_reply(request, 500, "Internal Server Error", c_buf)
13634
15408
 *         evbuffer_free(c_buf)             # <<<<<<<<<<<<<<
13643
15417
  __Pyx_RefNannyFinishContext();
13644
15418
}
13645
15419
 
13646
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":514
13647
 
 *     cdef dict _requests
 
15420
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":664
 
15421
 *     cdef public dict _requests
13648
15422
 * 
13649
15423
 *     def __init__(self, object handle, object default_response_headers=None):             # <<<<<<<<<<<<<<
13650
15424
 *         self.handle = handle
13658
15432
  int __pyx_r;
13659
15433
  int __pyx_t_1;
13660
15434
  PyObject *__pyx_t_2 = NULL;
13661
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__handle,&__pyx_n_s_21,0};
 
15435
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__handle,&__pyx_n_s_32,0};
13662
15436
  __Pyx_RefNannySetupContext("__init__");
13663
15437
  if (unlikely(__pyx_kwds)) {
13664
15438
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
13676
15450
      if (likely(values[0])) kw_args--;
13677
15451
      else goto __pyx_L5_argtuple_error;
13678
15452
      case  1:
13679
 
      if (kw_args > 1) {
13680
 
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_21);
13681
 
        if (unlikely(value)) { values[1] = value; kw_args--; }
 
15453
      if (kw_args > 0) {
 
15454
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_32);
 
15455
        if (value) { values[1] = value; kw_args--; }
13682
15456
      }
13683
15457
    }
13684
15458
    if (unlikely(kw_args > 0)) {
13685
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
15459
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13686
15460
    }
13687
15461
    __pyx_v_handle = values[0];
13688
15462
    __pyx_v_default_response_headers = values[1];
13697
15471
  }
13698
15472
  goto __pyx_L4_argument_unpacking_done;
13699
15473
  __pyx_L5_argtuple_error:;
13700
 
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
15474
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
13701
15475
  __pyx_L3_error:;
13702
15476
  __Pyx_AddTraceback("gevent.core.http.__init__");
 
15477
  __Pyx_RefNannyFinishContext();
13703
15478
  return -1;
13704
15479
  __pyx_L4_argument_unpacking_done:;
13705
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
13706
 
  __Pyx_INCREF(__pyx_v_handle);
13707
 
  __Pyx_INCREF(__pyx_v_default_response_headers);
13708
15480
 
13709
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":515
 
15481
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":665
13710
15482
 * 
13711
15483
 *     def __init__(self, object handle, object default_response_headers=None):
13712
15484
 *         self.handle = handle             # <<<<<<<<<<<<<<
13719
15491
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->handle);
13720
15492
  ((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->handle = __pyx_v_handle;
13721
15493
 
13722
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":516
 
15494
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":666
13723
15495
 *     def __init__(self, object handle, object default_response_headers=None):
13724
15496
 *         self.handle = handle
13725
15497
 *         if default_response_headers is None:             # <<<<<<<<<<<<<<
13729
15501
  __pyx_t_1 = (__pyx_v_default_response_headers == Py_None);
13730
15502
  if (__pyx_t_1) {
13731
15503
 
13732
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":517
 
15504
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":667
13733
15505
 *         self.handle = handle
13734
15506
 *         if default_response_headers is None:
13735
15507
 *             self.default_response_headers = []             # <<<<<<<<<<<<<<
13736
15508
 *         else:
13737
15509
 *             self.default_response_headers = default_response_headers
13738
15510
 */
13739
 
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15511
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13740
15512
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
13741
15513
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
13742
15514
    __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->default_response_headers);
13747
15519
  }
13748
15520
  /*else*/ {
13749
15521
 
13750
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":519
 
15522
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":669
13751
15523
 *             self.default_response_headers = []
13752
15524
 *         else:
13753
15525
 *             self.default_response_headers = default_response_headers             # <<<<<<<<<<<<<<
13762
15534
  }
13763
15535
  __pyx_L6:;
13764
15536
 
13765
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":520
 
15537
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":670
13766
15538
 *         else:
13767
15539
 *             self.default_response_headers = default_response_headers
13768
15540
 *         self._requests = {} # maps connection id to WeakKeyDictionary which holds requests             # <<<<<<<<<<<<<<
13769
15541
 *         self.__obj = evhttp_new(current_base)
13770
15542
 *         evhttp_set_gencb(self.__obj, _http_cb_handler, <void *>self)
13771
15543
 */
13772
 
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15544
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13773
15545
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
13774
15546
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
13775
15547
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->_requests);
13777
15549
  ((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->_requests = __pyx_t_2;
13778
15550
  __pyx_t_2 = 0;
13779
15551
 
13780
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":521
 
15552
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":671
13781
15553
 *             self.default_response_headers = default_response_headers
13782
15554
 *         self._requests = {} # maps connection id to WeakKeyDictionary which holds requests
13783
15555
 *         self.__obj = evhttp_new(current_base)             # <<<<<<<<<<<<<<
13786
15558
 */
13787
15559
  ((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->__pyx___obj = evhttp_new(current_base);
13788
15560
 
13789
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":522
 
15561
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":672
13790
15562
 *         self._requests = {} # maps connection id to WeakKeyDictionary which holds requests
13791
15563
 *         self.__obj = evhttp_new(current_base)
13792
15564
 *         evhttp_set_gencb(self.__obj, _http_cb_handler, <void *>self)             # <<<<<<<<<<<<<<
13802
15574
  __Pyx_AddTraceback("gevent.core.http.__init__");
13803
15575
  __pyx_r = -1;
13804
15576
  __pyx_L0:;
13805
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
13806
 
  __Pyx_DECREF(__pyx_v_handle);
13807
 
  __Pyx_DECREF(__pyx_v_default_response_headers);
13808
15577
  __Pyx_RefNannyFinishContext();
13809
15578
  return __pyx_r;
13810
15579
}
13811
15580
 
13812
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":524
 
15581
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":674
13813
15582
 *         evhttp_set_gencb(self.__obj, _http_cb_handler, <void *>self)
13814
15583
 * 
13815
15584
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
13817
15586
 *             evhttp_set_gencb(self.__obj, _http_cb_reply_error, NULL)
13818
15587
 */
13819
15588
 
13820
 
static void __pyx_pf_6gevent_4core_4http___dealloc__(PyObject *__pyx_v_self); /*proto*/
13821
 
static void __pyx_pf_6gevent_4core_4http___dealloc__(PyObject *__pyx_v_self) {
 
15589
static void __pyx_pf_6gevent_4core_4http_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
 
15590
static void __pyx_pf_6gevent_4core_4http_1__dealloc__(PyObject *__pyx_v_self) {
13822
15591
  int __pyx_t_1;
13823
15592
  __Pyx_RefNannySetupContext("__dealloc__");
13824
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
13825
15593
 
13826
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":525
 
15594
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":675
13827
15595
 * 
13828
15596
 *     def __dealloc__(self):
13829
15597
 *         if self.__obj != NULL:             # <<<<<<<<<<<<<<
13833
15601
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->__pyx___obj != NULL);
13834
15602
  if (__pyx_t_1) {
13835
15603
 
13836
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":526
 
15604
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":676
13837
15605
 *     def __dealloc__(self):
13838
15606
 *         if self.__obj != NULL:
13839
15607
 *             evhttp_set_gencb(self.__obj, _http_cb_reply_error, NULL)             # <<<<<<<<<<<<<<
13842
15610
 */
13843
15611
    evhttp_set_gencb(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->__pyx___obj, __pyx_f_6gevent_4core__http_cb_reply_error, NULL);
13844
15612
 
13845
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":527
 
15613
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":677
13846
15614
 *         if self.__obj != NULL:
13847
15615
 *             evhttp_set_gencb(self.__obj, _http_cb_reply_error, NULL)
13848
15616
 *             evhttp_free(self.__obj)             # <<<<<<<<<<<<<<
13854
15622
  }
13855
15623
  __pyx_L5:;
13856
15624
 
13857
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":528
 
15625
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":678
13858
15626
 *             evhttp_set_gencb(self.__obj, _http_cb_reply_error, NULL)
13859
15627
 *             evhttp_free(self.__obj)
13860
15628
 *         self.__obj = NULL             # <<<<<<<<<<<<<<
13863
15631
 */
13864
15632
  ((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->__pyx___obj = NULL;
13865
15633
 
13866
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
13867
15634
  __Pyx_RefNannyFinishContext();
13868
15635
}
13869
15636
 
13870
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":532
 
15637
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":682
13871
15638
 *     property _obj:
13872
15639
 * 
13873
15640
 *         def __get__(self):             # <<<<<<<<<<<<<<
13881
15648
  PyObject *__pyx_t_1 = NULL;
13882
15649
  __Pyx_RefNannySetupContext("__get__");
13883
15650
 
13884
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":533
 
15651
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":683
13885
15652
 * 
13886
15653
 *         def __get__(self):
13887
15654
 *             return <size_t>(self.__obj)             # <<<<<<<<<<<<<<
13889
15656
 *     def __nonzero__(self):
13890
15657
 */
13891
15658
  __Pyx_XDECREF(__pyx_r);
13892
 
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->__pyx___obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15659
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->__pyx___obj)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13893
15660
  __Pyx_GOTREF(__pyx_t_1);
13894
15661
  __pyx_r = __pyx_t_1;
13895
15662
  __pyx_t_1 = 0;
13907
15674
  return __pyx_r;
13908
15675
}
13909
15676
 
13910
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":535
 
15677
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":685
13911
15678
 *             return <size_t>(self.__obj)
13912
15679
 * 
13913
15680
 *     def __nonzero__(self):             # <<<<<<<<<<<<<<
13915
15682
 *             return True
13916
15683
 */
13917
15684
 
13918
 
static int __pyx_pf_6gevent_4core_4http___nonzero__(PyObject *__pyx_v_self); /*proto*/
13919
 
static int __pyx_pf_6gevent_4core_4http___nonzero__(PyObject *__pyx_v_self) {
 
15685
static int __pyx_pf_6gevent_4core_4http_2__nonzero__(PyObject *__pyx_v_self); /*proto*/
 
15686
static int __pyx_pf_6gevent_4core_4http_2__nonzero__(PyObject *__pyx_v_self) {
13920
15687
  int __pyx_r;
13921
15688
  int __pyx_t_1;
13922
15689
  __Pyx_RefNannySetupContext("__nonzero__");
13923
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
13924
15690
 
13925
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":536
 
15691
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":686
13926
15692
 * 
13927
15693
 *     def __nonzero__(self):
13928
15694
 *         if self.__obj:             # <<<<<<<<<<<<<<
13932
15698
  __pyx_t_1 = (((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->__pyx___obj != 0);
13933
15699
  if (__pyx_t_1) {
13934
15700
 
13935
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":537
 
15701
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":687
13936
15702
 *     def __nonzero__(self):
13937
15703
 *         if self.__obj:
13938
15704
 *             return True             # <<<<<<<<<<<<<<
13945
15711
  }
13946
15712
  /*else*/ {
13947
15713
 
13948
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":539
 
15714
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":689
13949
15715
 *             return True
13950
15716
 *         else:
13951
15717
 *             return False             # <<<<<<<<<<<<<<
13959
15725
 
13960
15726
  __pyx_r = 0;
13961
15727
  __pyx_L0:;
13962
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
13963
15728
  __Pyx_RefNannyFinishContext();
13964
15729
  return __pyx_r;
13965
15730
}
13966
15731
 
13967
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":541
 
15732
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":691
13968
15733
 *             return False
13969
15734
 * 
13970
15735
 *     def bind(self, char* address='127.0.0.1', int port=80):             # <<<<<<<<<<<<<<
13972
15737
 *         if res:
13973
15738
 */
13974
15739
 
13975
 
static PyObject *__pyx_pf_6gevent_4core_4http_bind(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13976
 
static PyObject *__pyx_pf_6gevent_4core_4http_bind(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
15740
static PyObject *__pyx_pf_6gevent_4core_4http_3bind(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
15741
static PyObject *__pyx_pf_6gevent_4core_4http_3bind(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13977
15742
  char *__pyx_v_address;
13978
15743
  int __pyx_v_port;
13979
15744
  int __pyx_v_res;
13980
15745
  PyObject *__pyx_r = NULL;
13981
 
  int __pyx_t_1;
 
15746
  PyObject *__pyx_t_1 = NULL;
13982
15747
  PyObject *__pyx_t_2 = NULL;
13983
15748
  PyObject *__pyx_t_3 = NULL;
13984
15749
  PyObject *__pyx_t_4 = NULL;
13985
 
  PyObject *__pyx_t_5 = NULL;
13986
15750
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__address,&__pyx_n_s__port,0};
13987
15751
  __Pyx_RefNannySetupContext("bind");
13988
15752
  if (unlikely(__pyx_kwds)) {
13996
15760
    }
13997
15761
    switch (PyTuple_GET_SIZE(__pyx_args)) {
13998
15762
      case  0:
13999
 
      if (kw_args > 1) {
 
15763
      if (kw_args > 0) {
14000
15764
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__address);
14001
 
        if (unlikely(value)) { values[0] = value; kw_args--; }
 
15765
        if (value) { values[0] = value; kw_args--; }
14002
15766
      }
14003
15767
      case  1:
14004
 
      if (kw_args > 1) {
 
15768
      if (kw_args > 0) {
14005
15769
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__port);
14006
 
        if (unlikely(value)) { values[1] = value; kw_args--; }
 
15770
        if (value) { values[1] = value; kw_args--; }
14007
15771
      }
14008
15772
    }
14009
15773
    if (unlikely(kw_args > 0)) {
14010
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "bind") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
15774
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "bind") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14011
15775
    }
14012
15776
    if (values[0]) {
14013
 
      __pyx_v_address = __Pyx_PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_address) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
15777
      __pyx_v_address = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_address) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14014
15778
    } else {
14015
 
      __pyx_v_address = ((char *)__pyx_k_39);
 
15779
      __pyx_v_address = ((char *)__pyx_k_49);
14016
15780
    }
14017
15781
    if (values[1]) {
14018
 
      __pyx_v_port = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
15782
      __pyx_v_port = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14019
15783
    } else {
14020
15784
      __pyx_v_port = ((int)80);
14021
15785
    }
14022
15786
  } else {
14023
 
    __pyx_v_address = ((char *)__pyx_k_39);
 
15787
    __pyx_v_address = ((char *)__pyx_k_49);
14024
15788
    __pyx_v_port = ((int)80);
14025
15789
    switch (PyTuple_GET_SIZE(__pyx_args)) {
14026
 
      case  2: __pyx_v_port = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14027
 
      case  1: __pyx_v_address = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_address) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
15790
      case  2: __pyx_v_port = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_port == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
15791
      case  1: __pyx_v_address = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_address) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14028
15792
      case  0: break;
14029
15793
      default: goto __pyx_L5_argtuple_error;
14030
15794
    }
14031
15795
  }
14032
15796
  goto __pyx_L4_argument_unpacking_done;
14033
15797
  __pyx_L5_argtuple_error:;
14034
 
  __Pyx_RaiseArgtupleInvalid("bind", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
15798
  __Pyx_RaiseArgtupleInvalid("bind", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14035
15799
  __pyx_L3_error:;
14036
15800
  __Pyx_AddTraceback("gevent.core.http.bind");
 
15801
  __Pyx_RefNannyFinishContext();
14037
15802
  return NULL;
14038
15803
  __pyx_L4_argument_unpacking_done:;
14039
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
14040
15804
 
14041
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":542
 
15805
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":692
14042
15806
 * 
14043
15807
 *     def bind(self, char* address='127.0.0.1', int port=80):
14044
15808
 *         cdef int res = evhttp_bind_socket(self.__obj, address, port)             # <<<<<<<<<<<<<<
14047
15811
 */
14048
15812
  __pyx_v_res = evhttp_bind_socket(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->__pyx___obj, __pyx_v_address, __pyx_v_port);
14049
15813
 
14050
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":543
 
15814
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":693
14051
15815
 *     def bind(self, char* address='127.0.0.1', int port=80):
14052
15816
 *         cdef int res = evhttp_bind_socket(self.__obj, address, port)
14053
15817
 *         if res:             # <<<<<<<<<<<<<<
14054
15818
 *             raise RuntimeError('evhttp_bind_socket(%r, %r) returned %r' % (address, port, res))
14055
15819
 * 
14056
15820
 */
14057
 
  __pyx_t_1 = __pyx_v_res;
14058
 
  if (__pyx_t_1) {
 
15821
  if (__pyx_v_res) {
14059
15822
 
14060
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":544
 
15823
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":694
14061
15824
 *         cdef int res = evhttp_bind_socket(self.__obj, address, port)
14062
15825
 *         if res:
14063
15826
 *             raise RuntimeError('evhttp_bind_socket(%r, %r) returned %r' % (address, port, res))             # <<<<<<<<<<<<<<
14064
15827
 * 
14065
15828
 *     def accept(self, int fd):
14066
15829
 */
14067
 
    __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_address); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14068
 
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
14069
 
    __pyx_t_3 = PyInt_FromLong(__pyx_v_port); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15830
    __pyx_t_1 = PyBytes_FromString(__pyx_v_address); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15831
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
15832
    __pyx_t_2 = PyInt_FromLong(__pyx_v_port); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15833
    __Pyx_GOTREF(__pyx_t_2);
 
15834
    __pyx_t_3 = PyInt_FromLong(__pyx_v_res); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14070
15835
    __Pyx_GOTREF(__pyx_t_3);
14071
 
    __pyx_t_4 = PyInt_FromLong(__pyx_v_res); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14072
 
    __Pyx_GOTREF(__pyx_t_4);
14073
 
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14074
 
    __Pyx_GOTREF(__pyx_t_5);
14075
 
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
14076
 
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
14077
 
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
 
15836
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15837
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
 
15838
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
 
15839
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
 
15840
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
 
15841
    __Pyx_GIVEREF(__pyx_t_2);
 
15842
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
14078
15843
    __Pyx_GIVEREF(__pyx_t_3);
14079
 
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
14080
 
    __Pyx_GIVEREF(__pyx_t_4);
 
15844
    __pyx_t_1 = 0;
14081
15845
    __pyx_t_2 = 0;
14082
15846
    __pyx_t_3 = 0;
14083
 
    __pyx_t_4 = 0;
14084
 
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_40), __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14085
 
    __Pyx_GOTREF(__pyx_t_4);
14086
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14087
 
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14088
 
    __Pyx_GOTREF(__pyx_t_5);
14089
 
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
14090
 
    __Pyx_GIVEREF(__pyx_t_4);
14091
 
    __pyx_t_4 = 0;
14092
 
    __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14093
 
    __Pyx_GOTREF(__pyx_t_4);
14094
 
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14095
 
    __Pyx_Raise(__pyx_t_4, 0, 0);
14096
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14097
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15847
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_50), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15848
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
15849
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
 
15850
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15851
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
 
15852
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
 
15853
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
 
15854
    __pyx_t_3 = 0;
 
15855
    __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15856
    __Pyx_GOTREF(__pyx_t_3);
 
15857
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
 
15858
    __Pyx_Raise(__pyx_t_3, 0, 0);
 
15859
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
15860
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14098
15861
    goto __pyx_L6;
14099
15862
  }
14100
15863
  __pyx_L6:;
14102
15865
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14103
15866
  goto __pyx_L0;
14104
15867
  __pyx_L1_error:;
 
15868
  __Pyx_XDECREF(__pyx_t_1);
14105
15869
  __Pyx_XDECREF(__pyx_t_2);
14106
15870
  __Pyx_XDECREF(__pyx_t_3);
14107
15871
  __Pyx_XDECREF(__pyx_t_4);
14108
 
  __Pyx_XDECREF(__pyx_t_5);
14109
15872
  __Pyx_AddTraceback("gevent.core.http.bind");
14110
15873
  __pyx_r = NULL;
14111
15874
  __pyx_L0:;
14112
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
14113
15875
  __Pyx_XGIVEREF(__pyx_r);
14114
15876
  __Pyx_RefNannyFinishContext();
14115
15877
  return __pyx_r;
14116
15878
}
14117
15879
 
14118
 
/* "/home/denis/work/gevent/gevent/evhttp.pxi":546
 
15880
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":696
14119
15881
 *             raise RuntimeError('evhttp_bind_socket(%r, %r) returned %r' % (address, port, res))
14120
15882
 * 
14121
15883
 *     def accept(self, int fd):             # <<<<<<<<<<<<<<
14123
15885
 *         if res:
14124
15886
 */
14125
15887
 
14126
 
static PyObject *__pyx_pf_6gevent_4core_4http_accept(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd); /*proto*/
14127
 
static PyObject *__pyx_pf_6gevent_4core_4http_accept(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd) {
 
15888
static PyObject *__pyx_pf_6gevent_4core_4http_4accept(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd); /*proto*/
 
15889
static PyObject *__pyx_pf_6gevent_4core_4http_4accept(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd) {
14128
15890
  int __pyx_v_fd;
14129
15891
  PyObject *__pyx_v_res = 0;
14130
15892
  PyObject *__pyx_r = NULL;
14133
15895
  PyObject *__pyx_t_3 = NULL;
14134
15896
  __Pyx_RefNannySetupContext("accept");
14135
15897
  assert(__pyx_arg_fd); {
14136
 
    __pyx_v_fd = __Pyx_PyInt_AsInt(__pyx_arg_fd); if (unlikely((__pyx_v_fd == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
15898
    __pyx_v_fd = __Pyx_PyInt_AsInt(__pyx_arg_fd); if (unlikely((__pyx_v_fd == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14137
15899
  }
14138
15900
  goto __pyx_L4_argument_unpacking_done;
14139
15901
  __pyx_L3_error:;
14140
15902
  __Pyx_AddTraceback("gevent.core.http.accept");
 
15903
  __Pyx_RefNannyFinishContext();
14141
15904
  return NULL;
14142
15905
  __pyx_L4_argument_unpacking_done:;
14143
 
  __Pyx_INCREF((PyObject *)__pyx_v_self);
14144
15906
 
14145
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":547
 
15907
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":697
14146
15908
 * 
14147
15909
 *     def accept(self, int fd):
14148
15910
 *         cdef res = evhttp_accept_socket(self.__obj, fd)             # <<<<<<<<<<<<<<
14149
15911
 *         if res:
14150
15912
 *             raise RuntimeError("evhttp_accept_socket(%r) returned %r" % (fd, res))
14151
15913
 */
14152
 
  __pyx_t_1 = PyInt_FromLong(evhttp_accept_socket(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->__pyx___obj, __pyx_v_fd)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15914
  __pyx_t_1 = PyInt_FromLong(evhttp_accept_socket(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->__pyx___obj, __pyx_v_fd)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14153
15915
  __Pyx_GOTREF(__pyx_t_1);
14154
15916
  __pyx_v_res = __pyx_t_1;
14155
15917
  __pyx_t_1 = 0;
14156
15918
 
14157
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":548
 
15919
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":698
14158
15920
 *     def accept(self, int fd):
14159
15921
 *         cdef res = evhttp_accept_socket(self.__obj, fd)
14160
15922
 *         if res:             # <<<<<<<<<<<<<<
14161
15923
 *             raise RuntimeError("evhttp_accept_socket(%r) returned %r" % (fd, res))
14162
 
 * 
14163
15924
 */
14164
 
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_res); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15925
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_res); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14165
15926
  if (__pyx_t_2) {
14166
15927
 
14167
 
    /* "/home/denis/work/gevent/gevent/evhttp.pxi":549
 
15928
    /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":699
14168
15929
 *         cdef res = evhttp_accept_socket(self.__obj, fd)
14169
15930
 *         if res:
14170
15931
 *             raise RuntimeError("evhttp_accept_socket(%r) returned %r" % (fd, res))             # <<<<<<<<<<<<<<
14171
 
 * 
14172
15932
 */
14173
 
    __pyx_t_1 = PyInt_FromLong(__pyx_v_fd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15933
    __pyx_t_1 = PyInt_FromLong(__pyx_v_fd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14174
15934
    __Pyx_GOTREF(__pyx_t_1);
14175
 
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14176
 
    __Pyx_GOTREF(__pyx_t_3);
 
15935
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15936
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
14177
15937
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14178
15938
    __Pyx_GIVEREF(__pyx_t_1);
14179
15939
    __Pyx_INCREF(__pyx_v_res);
14180
15940
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_res);
14181
15941
    __Pyx_GIVEREF(__pyx_v_res);
14182
15942
    __pyx_t_1 = 0;
14183
 
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_41), __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14184
 
    __Pyx_GOTREF(__pyx_t_1);
14185
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14186
 
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14187
 
    __Pyx_GOTREF(__pyx_t_3);
14188
 
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
14189
 
    __Pyx_GIVEREF(__pyx_t_1);
 
15943
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_51), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15944
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
15945
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
 
15946
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15947
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
15948
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
 
15949
    __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
14190
15950
    __pyx_t_1 = 0;
14191
 
    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15951
    __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14192
15952
    __Pyx_GOTREF(__pyx_t_1);
14193
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
15953
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
14194
15954
    __Pyx_Raise(__pyx_t_1, 0, 0);
14195
15955
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14196
 
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
15956
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14197
15957
    goto __pyx_L5;
14198
15958
  }
14199
15959
  __pyx_L5:;
14207
15967
  __pyx_r = NULL;
14208
15968
  __pyx_L0:;
14209
15969
  __Pyx_XDECREF(__pyx_v_res);
14210
 
  __Pyx_DECREF((PyObject *)__pyx_v_self);
14211
 
  __Pyx_XGIVEREF(__pyx_r);
14212
 
  __Pyx_RefNannyFinishContext();
14213
 
  return __pyx_r;
14214
 
}
14215
 
 
14216
 
/* "/home/denis/work/gevent/gevent/core.pyx":509
 
15970
  __Pyx_XGIVEREF(__pyx_r);
 
15971
  __Pyx_RefNannyFinishContext();
 
15972
  return __pyx_r;
 
15973
}
 
15974
 
 
15975
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":660
 
15976
 * cdef class http:
 
15977
 *     cdef evhttp* __obj
 
15978
 *     cdef public object handle             # <<<<<<<<<<<<<<
 
15979
 *     cdef public object default_response_headers
 
15980
 *     cdef public dict _requests
 
15981
 */
 
15982
 
 
15983
static PyObject *__pyx_pf_6gevent_4core_4http_6handle___get__(PyObject *__pyx_v_self); /*proto*/
 
15984
static PyObject *__pyx_pf_6gevent_4core_4http_6handle___get__(PyObject *__pyx_v_self) {
 
15985
  PyObject *__pyx_r = NULL;
 
15986
  __Pyx_RefNannySetupContext("__get__");
 
15987
  __Pyx_XDECREF(__pyx_r);
 
15988
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->handle);
 
15989
  __pyx_r = ((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->handle;
 
15990
  goto __pyx_L0;
 
15991
 
 
15992
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
15993
  __pyx_L0:;
 
15994
  __Pyx_XGIVEREF(__pyx_r);
 
15995
  __Pyx_RefNannyFinishContext();
 
15996
  return __pyx_r;
 
15997
}
 
15998
 
 
15999
static int __pyx_pf_6gevent_4core_4http_6handle_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
 
16000
static int __pyx_pf_6gevent_4core_4http_6handle_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
 
16001
  int __pyx_r;
 
16002
  __Pyx_RefNannySetupContext("__set__");
 
16003
  __Pyx_INCREF(__pyx_v_value);
 
16004
  __Pyx_GIVEREF(__pyx_v_value);
 
16005
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->handle);
 
16006
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->handle);
 
16007
  ((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->handle = __pyx_v_value;
 
16008
 
 
16009
  __pyx_r = 0;
 
16010
  __Pyx_RefNannyFinishContext();
 
16011
  return __pyx_r;
 
16012
}
 
16013
 
 
16014
static int __pyx_pf_6gevent_4core_4http_6handle_2__del__(PyObject *__pyx_v_self); /*proto*/
 
16015
static int __pyx_pf_6gevent_4core_4http_6handle_2__del__(PyObject *__pyx_v_self) {
 
16016
  int __pyx_r;
 
16017
  __Pyx_RefNannySetupContext("__del__");
 
16018
  __Pyx_INCREF(Py_None);
 
16019
  __Pyx_GIVEREF(Py_None);
 
16020
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->handle);
 
16021
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->handle);
 
16022
  ((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->handle = Py_None;
 
16023
 
 
16024
  __pyx_r = 0;
 
16025
  __Pyx_RefNannyFinishContext();
 
16026
  return __pyx_r;
 
16027
}
 
16028
 
 
16029
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":661
 
16030
 *     cdef evhttp* __obj
 
16031
 *     cdef public object handle
 
16032
 *     cdef public object default_response_headers             # <<<<<<<<<<<<<<
 
16033
 *     cdef public dict _requests
 
16034
 * 
 
16035
 */
 
16036
 
 
16037
static PyObject *__pyx_pf_6gevent_4core_4http_24default_response_headers___get__(PyObject *__pyx_v_self); /*proto*/
 
16038
static PyObject *__pyx_pf_6gevent_4core_4http_24default_response_headers___get__(PyObject *__pyx_v_self) {
 
16039
  PyObject *__pyx_r = NULL;
 
16040
  __Pyx_RefNannySetupContext("__get__");
 
16041
  __Pyx_XDECREF(__pyx_r);
 
16042
  __Pyx_INCREF(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->default_response_headers);
 
16043
  __pyx_r = ((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->default_response_headers;
 
16044
  goto __pyx_L0;
 
16045
 
 
16046
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
16047
  __pyx_L0:;
 
16048
  __Pyx_XGIVEREF(__pyx_r);
 
16049
  __Pyx_RefNannyFinishContext();
 
16050
  return __pyx_r;
 
16051
}
 
16052
 
 
16053
static int __pyx_pf_6gevent_4core_4http_24default_response_headers_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
 
16054
static int __pyx_pf_6gevent_4core_4http_24default_response_headers_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
 
16055
  int __pyx_r;
 
16056
  __Pyx_RefNannySetupContext("__set__");
 
16057
  __Pyx_INCREF(__pyx_v_value);
 
16058
  __Pyx_GIVEREF(__pyx_v_value);
 
16059
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->default_response_headers);
 
16060
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->default_response_headers);
 
16061
  ((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->default_response_headers = __pyx_v_value;
 
16062
 
 
16063
  __pyx_r = 0;
 
16064
  __Pyx_RefNannyFinishContext();
 
16065
  return __pyx_r;
 
16066
}
 
16067
 
 
16068
static int __pyx_pf_6gevent_4core_4http_24default_response_headers_2__del__(PyObject *__pyx_v_self); /*proto*/
 
16069
static int __pyx_pf_6gevent_4core_4http_24default_response_headers_2__del__(PyObject *__pyx_v_self) {
 
16070
  int __pyx_r;
 
16071
  __Pyx_RefNannySetupContext("__del__");
 
16072
  __Pyx_INCREF(Py_None);
 
16073
  __Pyx_GIVEREF(Py_None);
 
16074
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->default_response_headers);
 
16075
  __Pyx_DECREF(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->default_response_headers);
 
16076
  ((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->default_response_headers = Py_None;
 
16077
 
 
16078
  __pyx_r = 0;
 
16079
  __Pyx_RefNannyFinishContext();
 
16080
  return __pyx_r;
 
16081
}
 
16082
 
 
16083
/* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":662
 
16084
 *     cdef public object handle
 
16085
 *     cdef public object default_response_headers
 
16086
 *     cdef public dict _requests             # <<<<<<<<<<<<<<
 
16087
 * 
 
16088
 *     def __init__(self, object handle, object default_response_headers=None):
 
16089
 */
 
16090
 
 
16091
static PyObject *__pyx_pf_6gevent_4core_4http_9_requests___get__(PyObject *__pyx_v_self); /*proto*/
 
16092
static PyObject *__pyx_pf_6gevent_4core_4http_9_requests___get__(PyObject *__pyx_v_self) {
 
16093
  PyObject *__pyx_r = NULL;
 
16094
  __Pyx_RefNannySetupContext("__get__");
 
16095
  __Pyx_XDECREF(__pyx_r);
 
16096
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->_requests));
 
16097
  __pyx_r = ((PyObject *)((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->_requests);
 
16098
  goto __pyx_L0;
 
16099
 
 
16100
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
16101
  __pyx_L0:;
 
16102
  __Pyx_XGIVEREF(__pyx_r);
 
16103
  __Pyx_RefNannyFinishContext();
 
16104
  return __pyx_r;
 
16105
}
 
16106
 
 
16107
static int __pyx_pf_6gevent_4core_4http_9_requests_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
 
16108
static int __pyx_pf_6gevent_4core_4http_9_requests_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
 
16109
  int __pyx_r;
 
16110
  __Pyx_RefNannySetupContext("__set__");
 
16111
  if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected dict, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
16112
  __Pyx_INCREF(__pyx_v_value);
 
16113
  __Pyx_GIVEREF(__pyx_v_value);
 
16114
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->_requests);
 
16115
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->_requests));
 
16116
  ((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->_requests = ((PyObject*)__pyx_v_value);
 
16117
 
 
16118
  __pyx_r = 0;
 
16119
  goto __pyx_L0;
 
16120
  __pyx_L1_error:;
 
16121
  __Pyx_AddTraceback("gevent.core.http._requests.__set__");
 
16122
  __pyx_r = -1;
 
16123
  __pyx_L0:;
 
16124
  __Pyx_RefNannyFinishContext();
 
16125
  return __pyx_r;
 
16126
}
 
16127
 
 
16128
static int __pyx_pf_6gevent_4core_4http_9_requests_2__del__(PyObject *__pyx_v_self); /*proto*/
 
16129
static int __pyx_pf_6gevent_4core_4http_9_requests_2__del__(PyObject *__pyx_v_self) {
 
16130
  int __pyx_r;
 
16131
  __Pyx_RefNannySetupContext("__del__");
 
16132
  __Pyx_INCREF(Py_None);
 
16133
  __Pyx_GIVEREF(Py_None);
 
16134
  __Pyx_GOTREF(((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->_requests);
 
16135
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->_requests));
 
16136
  ((struct __pyx_obj_6gevent_4core_http *)__pyx_v_self)->_requests = ((PyObject*)Py_None);
 
16137
 
 
16138
  __pyx_r = 0;
 
16139
  __Pyx_RefNannyFinishContext();
 
16140
  return __pyx_r;
 
16141
}
 
16142
 
 
16143
/* "gevent/core.pyx":466
14217
16144
 * include "evhttp.pxi"
14218
16145
 * 
14219
 
 * def set_exc_info(object typ, object value, object tb):             # <<<<<<<<<<<<<<
 
16146
 * def set_exc_info(object type, object value):             # <<<<<<<<<<<<<<
14220
16147
 *     cdef PyThreadState* tstate = PyThreadState_GET()
14221
 
 *     if tstate.exc_type != NULL:
 
16148
 *     Py_XDECREF(tstate.exc_type)
14222
16149
 */
14223
16150
 
14224
 
static PyObject *__pyx_pf_6gevent_4core_set_exc_info(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14225
 
static PyObject *__pyx_pf_6gevent_4core_set_exc_info(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14226
 
  PyObject *__pyx_v_typ = 0;
 
16151
static PyObject *__pyx_pf_6gevent_4core_14set_exc_info(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
 
16152
static PyMethodDef __pyx_mdef_6gevent_4core_14set_exc_info = {__Pyx_NAMESTR("set_exc_info"), (PyCFunction)__pyx_pf_6gevent_4core_14set_exc_info, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
 
16153
static PyObject *__pyx_pf_6gevent_4core_14set_exc_info(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
 
16154
  PyObject *__pyx_v_type = 0;
14227
16155
  PyObject *__pyx_v_value = 0;
14228
 
  PyObject *__pyx_v_tb = 0;
14229
16156
  PyThreadState *__pyx_v_tstate;
14230
16157
  PyObject *__pyx_r = NULL;
14231
16158
  int __pyx_t_1;
14232
 
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__typ,&__pyx_n_s__value,&__pyx_n_s__tb,0};
 
16159
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__type,&__pyx_n_s__value,0};
14233
16160
  __Pyx_RefNannySetupContext("set_exc_info");
14234
16161
  __pyx_self = __pyx_self;
14235
16162
  if (unlikely(__pyx_kwds)) {
14236
16163
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
14237
 
    PyObject* values[3] = {0,0,0};
 
16164
    PyObject* values[2] = {0,0};
14238
16165
    switch (PyTuple_GET_SIZE(__pyx_args)) {
14239
 
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14240
16166
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14241
16167
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14242
16168
      case  0: break;
14244
16170
    }
14245
16171
    switch (PyTuple_GET_SIZE(__pyx_args)) {
14246
16172
      case  0:
14247
 
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__typ);
 
16173
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__type);
14248
16174
      if (likely(values[0])) kw_args--;
14249
16175
      else goto __pyx_L5_argtuple_error;
14250
16176
      case  1:
14251
16177
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__value);
14252
16178
      if (likely(values[1])) kw_args--;
14253
16179
      else {
14254
 
        __Pyx_RaiseArgtupleInvalid("set_exc_info", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14255
 
      }
14256
 
      case  2:
14257
 
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__tb);
14258
 
      if (likely(values[2])) kw_args--;
14259
 
      else {
14260
 
        __Pyx_RaiseArgtupleInvalid("set_exc_info", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
16180
        __Pyx_RaiseArgtupleInvalid("set_exc_info", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14261
16181
      }
14262
16182
    }
14263
16183
    if (unlikely(kw_args > 0)) {
14264
 
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "set_exc_info") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
16184
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "set_exc_info") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14265
16185
    }
14266
 
    __pyx_v_typ = values[0];
 
16186
    __pyx_v_type = values[0];
14267
16187
    __pyx_v_value = values[1];
14268
 
    __pyx_v_tb = values[2];
14269
 
  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
 
16188
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
14270
16189
    goto __pyx_L5_argtuple_error;
14271
16190
  } else {
14272
 
    __pyx_v_typ = PyTuple_GET_ITEM(__pyx_args, 0);
 
16191
    __pyx_v_type = PyTuple_GET_ITEM(__pyx_args, 0);
14273
16192
    __pyx_v_value = PyTuple_GET_ITEM(__pyx_args, 1);
14274
 
    __pyx_v_tb = PyTuple_GET_ITEM(__pyx_args, 2);
14275
16193
  }
14276
16194
  goto __pyx_L4_argument_unpacking_done;
14277
16195
  __pyx_L5_argtuple_error:;
14278
 
  __Pyx_RaiseArgtupleInvalid("set_exc_info", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
 
16196
  __Pyx_RaiseArgtupleInvalid("set_exc_info", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
14279
16197
  __pyx_L3_error:;
14280
16198
  __Pyx_AddTraceback("gevent.core.set_exc_info");
 
16199
  __Pyx_RefNannyFinishContext();
14281
16200
  return NULL;
14282
16201
  __pyx_L4_argument_unpacking_done:;
14283
 
  __Pyx_INCREF(__pyx_v_typ);
14284
 
  __Pyx_INCREF(__pyx_v_value);
14285
 
  __Pyx_INCREF(__pyx_v_tb);
14286
16202
 
14287
 
  /* "/home/denis/work/gevent/gevent/core.pyx":510
 
16203
  /* "gevent/core.pyx":467
14288
16204
 * 
14289
 
 * def set_exc_info(object typ, object value, object tb):
 
16205
 * def set_exc_info(object type, object value):
14290
16206
 *     cdef PyThreadState* tstate = PyThreadState_GET()             # <<<<<<<<<<<<<<
14291
 
 *     if tstate.exc_type != NULL:
14292
 
 *         Py_DECREF(<object>tstate.exc_type)
 
16207
 *     Py_XDECREF(tstate.exc_type)
 
16208
 *     Py_XDECREF(tstate.exc_value)
14293
16209
 */
14294
16210
  __pyx_v_tstate = PyThreadState_GET();
14295
16211
 
14296
 
  /* "/home/denis/work/gevent/gevent/core.pyx":511
14297
 
 * def set_exc_info(object typ, object value, object tb):
14298
 
 *     cdef PyThreadState* tstate = PyThreadState_GET()
14299
 
 *     if tstate.exc_type != NULL:             # <<<<<<<<<<<<<<
14300
 
 *         Py_DECREF(<object>tstate.exc_type)
14301
 
 *     if tstate.exc_value != NULL:
14302
 
 */
14303
 
  __pyx_t_1 = (__pyx_v_tstate->exc_type != NULL);
 
16212
  /* "gevent/core.pyx":468
 
16213
 * def set_exc_info(object type, object value):
 
16214
 *     cdef PyThreadState* tstate = PyThreadState_GET()
 
16215
 *     Py_XDECREF(tstate.exc_type)             # <<<<<<<<<<<<<<
 
16216
 *     Py_XDECREF(tstate.exc_value)
 
16217
 *     Py_XDECREF(tstate.exc_traceback)
 
16218
 */
 
16219
  Py_XDECREF(__pyx_v_tstate->exc_type);
 
16220
 
 
16221
  /* "gevent/core.pyx":469
 
16222
 *     cdef PyThreadState* tstate = PyThreadState_GET()
 
16223
 *     Py_XDECREF(tstate.exc_type)
 
16224
 *     Py_XDECREF(tstate.exc_value)             # <<<<<<<<<<<<<<
 
16225
 *     Py_XDECREF(tstate.exc_traceback)
 
16226
 *     if value is None:
 
16227
 */
 
16228
  Py_XDECREF(__pyx_v_tstate->exc_value);
 
16229
 
 
16230
  /* "gevent/core.pyx":470
 
16231
 *     Py_XDECREF(tstate.exc_type)
 
16232
 *     Py_XDECREF(tstate.exc_value)
 
16233
 *     Py_XDECREF(tstate.exc_traceback)             # <<<<<<<<<<<<<<
 
16234
 *     if value is None:
 
16235
 *         tstate.exc_type = NULL
 
16236
 */
 
16237
  Py_XDECREF(__pyx_v_tstate->exc_traceback);
 
16238
 
 
16239
  /* "gevent/core.pyx":471
 
16240
 *     Py_XDECREF(tstate.exc_value)
 
16241
 *     Py_XDECREF(tstate.exc_traceback)
 
16242
 *     if value is None:             # <<<<<<<<<<<<<<
 
16243
 *         tstate.exc_type = NULL
 
16244
 *         tstate.exc_value = NULL
 
16245
 */
 
16246
  __pyx_t_1 = (__pyx_v_value == Py_None);
14304
16247
  if (__pyx_t_1) {
14305
16248
 
14306
 
    /* "/home/denis/work/gevent/gevent/core.pyx":512
14307
 
 *     cdef PyThreadState* tstate = PyThreadState_GET()
14308
 
 *     if tstate.exc_type != NULL:
14309
 
 *         Py_DECREF(<object>tstate.exc_type)             # <<<<<<<<<<<<<<
14310
 
 *     if tstate.exc_value != NULL:
14311
 
 *         Py_DECREF(<object>tstate.exc_value)
14312
 
 */
14313
 
    Py_DECREF(((PyObject *)__pyx_v_tstate->exc_type));
 
16249
    /* "gevent/core.pyx":472
 
16250
 *     Py_XDECREF(tstate.exc_traceback)
 
16251
 *     if value is None:
 
16252
 *         tstate.exc_type = NULL             # <<<<<<<<<<<<<<
 
16253
 *         tstate.exc_value = NULL
 
16254
 *     else:
 
16255
 */
 
16256
    __pyx_v_tstate->exc_type = NULL;
 
16257
 
 
16258
    /* "gevent/core.pyx":473
 
16259
 *     if value is None:
 
16260
 *         tstate.exc_type = NULL
 
16261
 *         tstate.exc_value = NULL             # <<<<<<<<<<<<<<
 
16262
 *     else:
 
16263
 *         Py_INCREF(<PyObjectPtr>type)
 
16264
 */
 
16265
    __pyx_v_tstate->exc_value = NULL;
14314
16266
    goto __pyx_L6;
14315
16267
  }
 
16268
  /*else*/ {
 
16269
 
 
16270
    /* "gevent/core.pyx":475
 
16271
 *         tstate.exc_value = NULL
 
16272
 *     else:
 
16273
 *         Py_INCREF(<PyObjectPtr>type)             # <<<<<<<<<<<<<<
 
16274
 *         Py_INCREF(<PyObjectPtr>value)
 
16275
 *         tstate.exc_type = <PyObjectPtr>type
 
16276
 */
 
16277
    Py_INCREF(((PyObject*)__pyx_v_type));
 
16278
 
 
16279
    /* "gevent/core.pyx":476
 
16280
 *     else:
 
16281
 *         Py_INCREF(<PyObjectPtr>type)
 
16282
 *         Py_INCREF(<PyObjectPtr>value)             # <<<<<<<<<<<<<<
 
16283
 *         tstate.exc_type = <PyObjectPtr>type
 
16284
 *         tstate.exc_value = <PyObjectPtr>value
 
16285
 */
 
16286
    Py_INCREF(((PyObject*)__pyx_v_value));
 
16287
 
 
16288
    /* "gevent/core.pyx":477
 
16289
 *         Py_INCREF(<PyObjectPtr>type)
 
16290
 *         Py_INCREF(<PyObjectPtr>value)
 
16291
 *         tstate.exc_type = <PyObjectPtr>type             # <<<<<<<<<<<<<<
 
16292
 *         tstate.exc_value = <PyObjectPtr>value
 
16293
 *     tstate.exc_traceback = NULL
 
16294
 */
 
16295
    __pyx_v_tstate->exc_type = ((PyObject*)__pyx_v_type);
 
16296
 
 
16297
    /* "gevent/core.pyx":478
 
16298
 *         Py_INCREF(<PyObjectPtr>value)
 
16299
 *         tstate.exc_type = <PyObjectPtr>type
 
16300
 *         tstate.exc_value = <PyObjectPtr>value             # <<<<<<<<<<<<<<
 
16301
 *     tstate.exc_traceback = NULL
 
16302
 */
 
16303
    __pyx_v_tstate->exc_value = ((PyObject*)__pyx_v_value);
 
16304
  }
14316
16305
  __pyx_L6:;
14317
16306
 
14318
 
  /* "/home/denis/work/gevent/gevent/core.pyx":513
14319
 
 *     if tstate.exc_type != NULL:
14320
 
 *         Py_DECREF(<object>tstate.exc_type)
14321
 
 *     if tstate.exc_value != NULL:             # <<<<<<<<<<<<<<
14322
 
 *         Py_DECREF(<object>tstate.exc_value)
14323
 
 *     if tstate.exc_traceback != NULL:
14324
 
 */
14325
 
  __pyx_t_1 = (__pyx_v_tstate->exc_value != NULL);
14326
 
  if (__pyx_t_1) {
14327
 
 
14328
 
    /* "/home/denis/work/gevent/gevent/core.pyx":514
14329
 
 *         Py_DECREF(<object>tstate.exc_type)
14330
 
 *     if tstate.exc_value != NULL:
14331
 
 *         Py_DECREF(<object>tstate.exc_value)             # <<<<<<<<<<<<<<
14332
 
 *     if tstate.exc_traceback != NULL:
14333
 
 *         Py_DECREF(<object>tstate.exc_traceback)
14334
 
 */
14335
 
    Py_DECREF(((PyObject *)__pyx_v_tstate->exc_value));
14336
 
    goto __pyx_L7;
14337
 
  }
14338
 
  __pyx_L7:;
14339
 
 
14340
 
  /* "/home/denis/work/gevent/gevent/core.pyx":515
14341
 
 *     if tstate.exc_value != NULL:
14342
 
 *         Py_DECREF(<object>tstate.exc_value)
14343
 
 *     if tstate.exc_traceback != NULL:             # <<<<<<<<<<<<<<
14344
 
 *         Py_DECREF(<object>tstate.exc_traceback)
14345
 
 *     Py_INCREF(typ)
14346
 
 */
14347
 
  __pyx_t_1 = (__pyx_v_tstate->exc_traceback != NULL);
14348
 
  if (__pyx_t_1) {
14349
 
 
14350
 
    /* "/home/denis/work/gevent/gevent/core.pyx":516
14351
 
 *         Py_DECREF(<object>tstate.exc_value)
14352
 
 *     if tstate.exc_traceback != NULL:
14353
 
 *         Py_DECREF(<object>tstate.exc_traceback)             # <<<<<<<<<<<<<<
14354
 
 *     Py_INCREF(typ)
14355
 
 *     Py_INCREF(value)
14356
 
 */
14357
 
    Py_DECREF(((PyObject *)__pyx_v_tstate->exc_traceback));
14358
 
    goto __pyx_L8;
14359
 
  }
14360
 
  __pyx_L8:;
14361
 
 
14362
 
  /* "/home/denis/work/gevent/gevent/core.pyx":517
14363
 
 *     if tstate.exc_traceback != NULL:
14364
 
 *         Py_DECREF(<object>tstate.exc_traceback)
14365
 
 *     Py_INCREF(typ)             # <<<<<<<<<<<<<<
14366
 
 *     Py_INCREF(value)
14367
 
 *     Py_INCREF(tb)
14368
 
 */
14369
 
  Py_INCREF(__pyx_v_typ);
14370
 
 
14371
 
  /* "/home/denis/work/gevent/gevent/core.pyx":518
14372
 
 *         Py_DECREF(<object>tstate.exc_traceback)
14373
 
 *     Py_INCREF(typ)
14374
 
 *     Py_INCREF(value)             # <<<<<<<<<<<<<<
14375
 
 *     Py_INCREF(tb)
14376
 
 *     tstate.exc_type = <void*>typ
14377
 
 */
14378
 
  Py_INCREF(__pyx_v_value);
14379
 
 
14380
 
  /* "/home/denis/work/gevent/gevent/core.pyx":519
14381
 
 *     Py_INCREF(typ)
14382
 
 *     Py_INCREF(value)
14383
 
 *     Py_INCREF(tb)             # <<<<<<<<<<<<<<
14384
 
 *     tstate.exc_type = <void*>typ
14385
 
 *     tstate.exc_value = <void *>value
14386
 
 */
14387
 
  Py_INCREF(__pyx_v_tb);
14388
 
 
14389
 
  /* "/home/denis/work/gevent/gevent/core.pyx":520
14390
 
 *     Py_INCREF(value)
14391
 
 *     Py_INCREF(tb)
14392
 
 *     tstate.exc_type = <void*>typ             # <<<<<<<<<<<<<<
14393
 
 *     tstate.exc_value = <void *>value
14394
 
 *     tstate.exc_traceback = <void *>tb
14395
 
 */
14396
 
  __pyx_v_tstate->exc_type = ((void *)__pyx_v_typ);
14397
 
 
14398
 
  /* "/home/denis/work/gevent/gevent/core.pyx":521
14399
 
 *     Py_INCREF(tb)
14400
 
 *     tstate.exc_type = <void*>typ
14401
 
 *     tstate.exc_value = <void *>value             # <<<<<<<<<<<<<<
14402
 
 *     tstate.exc_traceback = <void *>tb
14403
 
 * 
14404
 
 */
14405
 
  __pyx_v_tstate->exc_value = ((void *)__pyx_v_value);
14406
 
 
14407
 
  /* "/home/denis/work/gevent/gevent/core.pyx":522
14408
 
 *     tstate.exc_type = <void*>typ
14409
 
 *     tstate.exc_value = <void *>value
14410
 
 *     tstate.exc_traceback = <void *>tb             # <<<<<<<<<<<<<<
14411
 
 * 
14412
 
 */
14413
 
  __pyx_v_tstate->exc_traceback = ((void *)__pyx_v_tb);
 
16307
  /* "gevent/core.pyx":479
 
16308
 *         tstate.exc_type = <PyObjectPtr>type
 
16309
 *         tstate.exc_value = <PyObjectPtr>value
 
16310
 *     tstate.exc_traceback = NULL             # <<<<<<<<<<<<<<
 
16311
 */
 
16312
  __pyx_v_tstate->exc_traceback = NULL;
14414
16313
 
14415
16314
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14416
 
  __Pyx_DECREF(__pyx_v_typ);
14417
 
  __Pyx_DECREF(__pyx_v_value);
14418
 
  __Pyx_DECREF(__pyx_v_tb);
14419
16315
  __Pyx_XGIVEREF(__pyx_r);
14420
16316
  __Pyx_RefNannyFinishContext();
14421
16317
  return __pyx_r;
14428
16324
  if (!o) return 0;
14429
16325
  p = ((struct __pyx_obj_6gevent_4core_event *)o);
14430
16326
  p->__pyx_vtab = __pyx_vtabptr_6gevent_4core_event;
14431
 
  p->_callback = Py_None; Py_INCREF(Py_None);
14432
 
  p->_arg = Py_None; Py_INCREF(Py_None);
 
16327
  p->callback = Py_None; Py_INCREF(Py_None);
 
16328
  p->arg = Py_None; Py_INCREF(Py_None);
14433
16329
  return o;
14434
16330
}
14435
16331
 
14436
16332
static void __pyx_tp_dealloc_6gevent_4core_event(PyObject *o) {
14437
16333
  struct __pyx_obj_6gevent_4core_event *p = (struct __pyx_obj_6gevent_4core_event *)o;
14438
 
  Py_XDECREF(p->_callback);
14439
 
  Py_XDECREF(p->_arg);
 
16334
  Py_XDECREF(p->callback);
 
16335
  Py_XDECREF(p->arg);
14440
16336
  (*Py_TYPE(o)->tp_free)(o);
14441
16337
}
14442
16338
 
14443
16339
static int __pyx_tp_traverse_6gevent_4core_event(PyObject *o, visitproc v, void *a) {
14444
16340
  int e;
14445
16341
  struct __pyx_obj_6gevent_4core_event *p = (struct __pyx_obj_6gevent_4core_event *)o;
14446
 
  if (p->_callback) {
14447
 
    e = (*v)(p->_callback, a); if (e) return e;
 
16342
  if (p->callback) {
 
16343
    e = (*v)(p->callback, a); if (e) return e;
14448
16344
  }
14449
 
  if (p->_arg) {
14450
 
    e = (*v)(p->_arg, a); if (e) return e;
 
16345
  if (p->arg) {
 
16346
    e = (*v)(p->arg, a); if (e) return e;
14451
16347
  }
14452
16348
  return 0;
14453
16349
}
14455
16351
static int __pyx_tp_clear_6gevent_4core_event(PyObject *o) {
14456
16352
  struct __pyx_obj_6gevent_4core_event *p = (struct __pyx_obj_6gevent_4core_event *)o;
14457
16353
  PyObject* tmp;
14458
 
  tmp = ((PyObject*)p->_callback);
14459
 
  p->_callback = Py_None; Py_INCREF(Py_None);
 
16354
  tmp = ((PyObject*)p->callback);
 
16355
  p->callback = Py_None; Py_INCREF(Py_None);
14460
16356
  Py_XDECREF(tmp);
14461
 
  tmp = ((PyObject*)p->_arg);
14462
 
  p->_arg = Py_None; Py_INCREF(Py_None);
 
16357
  tmp = ((PyObject*)p->arg);
 
16358
  p->arg = Py_None; Py_INCREF(Py_None);
14463
16359
  Py_XDECREF(tmp);
14464
16360
  return 0;
14465
16361
}
14466
16362
 
14467
 
static PyObject *__pyx_getprop_6gevent_4core_5event_callback(PyObject *o, void *x) {
14468
 
  return __pyx_pf_6gevent_4core_5event_8callback___get__(o);
14469
 
}
14470
 
 
14471
 
static int __pyx_setprop_6gevent_4core_5event_callback(PyObject *o, PyObject *v, void *x) {
14472
 
  if (v) {
14473
 
    return __pyx_pf_6gevent_4core_5event_8callback___set__(o, v);
14474
 
  }
14475
 
  else {
14476
 
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
14477
 
    return -1;
14478
 
  }
14479
 
}
14480
 
 
14481
 
static PyObject *__pyx_getprop_6gevent_4core_5event_arg(PyObject *o, void *x) {
14482
 
  return __pyx_pf_6gevent_4core_5event_3arg___get__(o);
14483
 
}
14484
 
 
14485
 
static int __pyx_setprop_6gevent_4core_5event_arg(PyObject *o, PyObject *v, void *x) {
14486
 
  if (v) {
14487
 
    return __pyx_pf_6gevent_4core_5event_3arg___set__(o, v);
14488
 
  }
14489
 
  else {
14490
 
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
14491
 
    return -1;
14492
 
  }
14493
 
}
14494
 
 
14495
16363
static PyObject *__pyx_getprop_6gevent_4core_5event_pending(PyObject *o, void *x) {
14496
16364
  return __pyx_pf_6gevent_4core_5event_7pending___get__(o);
14497
16365
}
14516
16384
  return __pyx_pf_6gevent_4core_5event_9flags_str___get__(o);
14517
16385
}
14518
16386
 
14519
 
static struct PyMethodDef __pyx_methods_6gevent_4core_event[] = {
14520
 
  {__Pyx_NAMESTR("add"), (PyCFunction)__pyx_pf_6gevent_4core_5event_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_5event_add)},
14521
 
  {__Pyx_NAMESTR("cancel"), (PyCFunction)__pyx_pf_6gevent_4core_5event_cancel, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_5event_cancel)},
14522
 
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_6gevent_4core_5event___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
14523
 
  {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pf_6gevent_4core_5event___str__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
14524
 
  {__Pyx_NAMESTR("__enter__"), (PyCFunction)__pyx_pf_6gevent_4core_5event___enter__, METH_NOARGS, __Pyx_DOCSTR(0)},
14525
 
  {__Pyx_NAMESTR("__exit__"), (PyCFunction)__pyx_pf_6gevent_4core_5event___exit__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
 
16387
static PyObject *__pyx_getprop_6gevent_4core_5event_callback(PyObject *o, void *x) {
 
16388
  return __pyx_pf_6gevent_4core_5event_8callback___get__(o);
 
16389
}
 
16390
 
 
16391
static int __pyx_setprop_6gevent_4core_5event_callback(PyObject *o, PyObject *v, void *x) {
 
16392
  if (v) {
 
16393
    return __pyx_pf_6gevent_4core_5event_8callback_1__set__(o, v);
 
16394
  }
 
16395
  else {
 
16396
    return __pyx_pf_6gevent_4core_5event_8callback_2__del__(o);
 
16397
  }
 
16398
}
 
16399
 
 
16400
static PyObject *__pyx_getprop_6gevent_4core_5event_arg(PyObject *o, void *x) {
 
16401
  return __pyx_pf_6gevent_4core_5event_3arg___get__(o);
 
16402
}
 
16403
 
 
16404
static int __pyx_setprop_6gevent_4core_5event_arg(PyObject *o, PyObject *v, void *x) {
 
16405
  if (v) {
 
16406
    return __pyx_pf_6gevent_4core_5event_3arg_1__set__(o, v);
 
16407
  }
 
16408
  else {
 
16409
    return __pyx_pf_6gevent_4core_5event_3arg_2__del__(o);
 
16410
  }
 
16411
}
 
16412
 
 
16413
static PyMethodDef __pyx_methods_6gevent_4core_event[] = {
 
16414
  {__Pyx_NAMESTR("add"), (PyCFunction)__pyx_pf_6gevent_4core_5event_1add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_5event_1add)},
 
16415
  {__Pyx_NAMESTR("cancel"), (PyCFunction)__pyx_pf_6gevent_4core_5event_2cancel, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_5event_2cancel)},
 
16416
  {__Pyx_NAMESTR("__enter__"), (PyCFunction)__pyx_pf_6gevent_4core_5event_5__enter__, METH_NOARGS, __Pyx_DOCSTR(0)},
 
16417
  {__Pyx_NAMESTR("__exit__"), (PyCFunction)__pyx_pf_6gevent_4core_5event_6__exit__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
14526
16418
  {0, 0, 0, 0}
14527
16419
};
14528
16420
 
14529
16421
static struct PyGetSetDef __pyx_getsets_6gevent_4core_event[] = {
14530
 
  {(char *)"callback", __pyx_getprop_6gevent_4core_5event_callback, __pyx_setprop_6gevent_4core_5event_callback, __Pyx_DOCSTR(__pyx_k_42), 0},
14531
 
  {(char *)"arg", __pyx_getprop_6gevent_4core_5event_arg, __pyx_setprop_6gevent_4core_5event_arg, __Pyx_DOCSTR(__pyx_k_43), 0},
14532
 
  {(char *)"pending", __pyx_getprop_6gevent_4core_5event_pending, 0, __Pyx_DOCSTR(__pyx_k_44), 0},
 
16422
  {(char *)"pending", __pyx_getprop_6gevent_4core_5event_pending, 0, __Pyx_DOCSTR(__pyx_k_52), 0},
14533
16423
  {(char *)"fd", __pyx_getprop_6gevent_4core_5event_fd, 0, 0, 0},
14534
16424
  {(char *)"events", __pyx_getprop_6gevent_4core_5event_events, 0, 0, 0},
14535
16425
  {(char *)"events_str", __pyx_getprop_6gevent_4core_5event_events_str, 0, 0, 0},
14536
16426
  {(char *)"flags", __pyx_getprop_6gevent_4core_5event_flags, 0, 0, 0},
14537
16427
  {(char *)"flags_str", __pyx_getprop_6gevent_4core_5event_flags_str, 0, 0, 0},
 
16428
  {(char *)"callback", __pyx_getprop_6gevent_4core_5event_callback, __pyx_setprop_6gevent_4core_5event_callback, 0, 0},
 
16429
  {(char *)"arg", __pyx_getprop_6gevent_4core_5event_arg, __pyx_setprop_6gevent_4core_5event_arg, 0, 0},
14538
16430
  {0, 0, 0, 0, 0}
14539
16431
};
14540
16432
 
14562
16454
  0, /*nb_coerce*/
14563
16455
  #endif
14564
16456
  0, /*nb_int*/
14565
 
  #if PY_MAJOR_VERSION >= 3
 
16457
  #if PY_MAJOR_VERSION < 3
 
16458
  0, /*nb_long*/
 
16459
  #else
14566
16460
  0, /*reserved*/
14567
 
  #else
14568
 
  0, /*nb_long*/
14569
16461
  #endif
14570
16462
  0, /*nb_float*/
14571
16463
  #if PY_MAJOR_VERSION < 3
14591
16483
  0, /*nb_true_divide*/
14592
16484
  0, /*nb_inplace_floor_divide*/
14593
16485
  0, /*nb_inplace_true_divide*/
14594
 
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
 
16486
  #if PY_VERSION_HEX >= 0x02050000
14595
16487
  0, /*nb_index*/
14596
16488
  #endif
14597
16489
};
14636
16528
  #endif
14637
16529
};
14638
16530
 
14639
 
PyTypeObject __pyx_type_6gevent_4core_event = {
 
16531
static PyTypeObject __pyx_type_6gevent_4core_event = {
14640
16532
  PyVarObject_HEAD_INIT(0, 0)
14641
16533
  __Pyx_NAMESTR("gevent.core.event"), /*tp_name*/
14642
16534
  sizeof(struct __pyx_obj_6gevent_4core_event), /*tp_basicsize*/
14645
16537
  0, /*tp_print*/
14646
16538
  0, /*tp_getattr*/
14647
16539
  0, /*tp_setattr*/
 
16540
  #if PY_MAJOR_VERSION < 3
14648
16541
  0, /*tp_compare*/
14649
 
  __pyx_pf_6gevent_4core_5event___repr__, /*tp_repr*/
 
16542
  #else
 
16543
  0, /*reserved*/
 
16544
  #endif
 
16545
  __pyx_pf_6gevent_4core_5event_3__repr__, /*tp_repr*/
14650
16546
  &__pyx_tp_as_number_event, /*tp_as_number*/
14651
16547
  &__pyx_tp_as_sequence_event, /*tp_as_sequence*/
14652
16548
  &__pyx_tp_as_mapping_event, /*tp_as_mapping*/
14653
16549
  0, /*tp_hash*/
14654
16550
  0, /*tp_call*/
14655
 
  __pyx_pf_6gevent_4core_5event___str__, /*tp_str*/
 
16551
  __pyx_pf_6gevent_4core_5event_4__str__, /*tp_str*/
14656
16552
  0, /*tp_getattro*/
14657
16553
  0, /*tp_setattro*/
14658
16554
  &__pyx_tp_as_buffer_event, /*tp_as_buffer*/
14659
 
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
 
16555
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
14660
16556
  __Pyx_DOCSTR("Create a new event object with a user callback.\n\n    - *evtype*   -- bitmask of EV_READ or EV_WRITE, or EV_SIGNAL\n    - *handle*   -- a file handle, descriptor, or socket for EV_READ or EV_WRITE; a signal number for EV_SIGNAL\n    - *callback* -- user callback with ``(event, evtype)`` prototype\n    - *arg*      -- optional object, which will be made available as :attr:`arg` property.\n    "), /*tp_doc*/
14661
16557
  __pyx_tp_traverse_6gevent_4core_event, /*tp_traverse*/
14662
16558
  __pyx_tp_clear_6gevent_4core_event, /*tp_clear*/
14698
16594
  return o;
14699
16595
}
14700
16596
 
14701
 
static struct PyMethodDef __pyx_methods_6gevent_4core_read_event[] = {
 
16597
static PyMethodDef __pyx_methods_6gevent_4core_read_event[] = {
14702
16598
  {0, 0, 0, 0}
14703
16599
};
14704
16600
 
14726
16622
  0, /*nb_coerce*/
14727
16623
  #endif
14728
16624
  0, /*nb_int*/
14729
 
  #if PY_MAJOR_VERSION >= 3
 
16625
  #if PY_MAJOR_VERSION < 3
 
16626
  0, /*nb_long*/
 
16627
  #else
14730
16628
  0, /*reserved*/
14731
 
  #else
14732
 
  0, /*nb_long*/
14733
16629
  #endif
14734
16630
  0, /*nb_float*/
14735
16631
  #if PY_MAJOR_VERSION < 3
14755
16651
  0, /*nb_true_divide*/
14756
16652
  0, /*nb_inplace_floor_divide*/
14757
16653
  0, /*nb_inplace_true_divide*/
14758
 
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
 
16654
  #if PY_VERSION_HEX >= 0x02050000
14759
16655
  0, /*nb_index*/
14760
16656
  #endif
14761
16657
};
14800
16696
  #endif
14801
16697
};
14802
16698
 
14803
 
PyTypeObject __pyx_type_6gevent_4core_read_event = {
 
16699
static PyTypeObject __pyx_type_6gevent_4core_read_event = {
14804
16700
  PyVarObject_HEAD_INIT(0, 0)
14805
16701
  __Pyx_NAMESTR("gevent.core.read_event"), /*tp_name*/
14806
16702
  sizeof(struct __pyx_obj_6gevent_4core_read_event), /*tp_basicsize*/
14809
16705
  0, /*tp_print*/
14810
16706
  0, /*tp_getattr*/
14811
16707
  0, /*tp_setattr*/
 
16708
  #if PY_MAJOR_VERSION < 3
14812
16709
  0, /*tp_compare*/
 
16710
  #else
 
16711
  0, /*reserved*/
 
16712
  #endif
14813
16713
  0, /*tp_repr*/
14814
16714
  &__pyx_tp_as_number_read_event, /*tp_as_number*/
14815
16715
  &__pyx_tp_as_sequence_read_event, /*tp_as_sequence*/
14820
16720
  0, /*tp_getattro*/
14821
16721
  0, /*tp_setattro*/
14822
16722
  &__pyx_tp_as_buffer_read_event, /*tp_as_buffer*/
14823
 
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
 
16723
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
14824
16724
  __Pyx_DOCSTR("Create a new scheduled event with evtype=EV_READ"), /*tp_doc*/
14825
16725
  __pyx_tp_traverse_6gevent_4core_event, /*tp_traverse*/
14826
16726
  __pyx_tp_clear_6gevent_4core_event, /*tp_clear*/
14862
16762
  return o;
14863
16763
}
14864
16764
 
14865
 
static struct PyMethodDef __pyx_methods_6gevent_4core_write_event[] = {
 
16765
static PyMethodDef __pyx_methods_6gevent_4core_write_event[] = {
14866
16766
  {0, 0, 0, 0}
14867
16767
};
14868
16768
 
14890
16790
  0, /*nb_coerce*/
14891
16791
  #endif
14892
16792
  0, /*nb_int*/
14893
 
  #if PY_MAJOR_VERSION >= 3
 
16793
  #if PY_MAJOR_VERSION < 3
 
16794
  0, /*nb_long*/
 
16795
  #else
14894
16796
  0, /*reserved*/
14895
 
  #else
14896
 
  0, /*nb_long*/
14897
16797
  #endif
14898
16798
  0, /*nb_float*/
14899
16799
  #if PY_MAJOR_VERSION < 3
14919
16819
  0, /*nb_true_divide*/
14920
16820
  0, /*nb_inplace_floor_divide*/
14921
16821
  0, /*nb_inplace_true_divide*/
14922
 
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
 
16822
  #if PY_VERSION_HEX >= 0x02050000
14923
16823
  0, /*nb_index*/
14924
16824
  #endif
14925
16825
};
14964
16864
  #endif
14965
16865
};
14966
16866
 
14967
 
PyTypeObject __pyx_type_6gevent_4core_write_event = {
 
16867
static PyTypeObject __pyx_type_6gevent_4core_write_event = {
14968
16868
  PyVarObject_HEAD_INIT(0, 0)
14969
16869
  __Pyx_NAMESTR("gevent.core.write_event"), /*tp_name*/
14970
16870
  sizeof(struct __pyx_obj_6gevent_4core_write_event), /*tp_basicsize*/
14973
16873
  0, /*tp_print*/
14974
16874
  0, /*tp_getattr*/
14975
16875
  0, /*tp_setattr*/
 
16876
  #if PY_MAJOR_VERSION < 3
14976
16877
  0, /*tp_compare*/
 
16878
  #else
 
16879
  0, /*reserved*/
 
16880
  #endif
14977
16881
  0, /*tp_repr*/
14978
16882
  &__pyx_tp_as_number_write_event, /*tp_as_number*/
14979
16883
  &__pyx_tp_as_sequence_write_event, /*tp_as_sequence*/
14984
16888
  0, /*tp_getattro*/
14985
16889
  0, /*tp_setattro*/
14986
16890
  &__pyx_tp_as_buffer_write_event, /*tp_as_buffer*/
14987
 
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
 
16891
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
14988
16892
  __Pyx_DOCSTR("Create a new scheduled event with evtype=EV_WRITE"), /*tp_doc*/
14989
16893
  __pyx_tp_traverse_6gevent_4core_event, /*tp_traverse*/
14990
16894
  __pyx_tp_clear_6gevent_4core_event, /*tp_clear*/
15026
16930
  return o;
15027
16931
}
15028
16932
 
15029
 
static struct PyMethodDef __pyx_methods_6gevent_4core_timer[] = {
 
16933
static PyMethodDef __pyx_methods_6gevent_4core_timer[] = {
15030
16934
  {0, 0, 0, 0}
15031
16935
};
15032
16936
 
15054
16958
  0, /*nb_coerce*/
15055
16959
  #endif
15056
16960
  0, /*nb_int*/
15057
 
  #if PY_MAJOR_VERSION >= 3
 
16961
  #if PY_MAJOR_VERSION < 3
 
16962
  0, /*nb_long*/
 
16963
  #else
15058
16964
  0, /*reserved*/
15059
 
  #else
15060
 
  0, /*nb_long*/
15061
16965
  #endif
15062
16966
  0, /*nb_float*/
15063
16967
  #if PY_MAJOR_VERSION < 3
15083
16987
  0, /*nb_true_divide*/
15084
16988
  0, /*nb_inplace_floor_divide*/
15085
16989
  0, /*nb_inplace_true_divide*/
15086
 
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
 
16990
  #if PY_VERSION_HEX >= 0x02050000
15087
16991
  0, /*nb_index*/
15088
16992
  #endif
15089
16993
};
15128
17032
  #endif
15129
17033
};
15130
17034
 
15131
 
PyTypeObject __pyx_type_6gevent_4core_timer = {
 
17035
static PyTypeObject __pyx_type_6gevent_4core_timer = {
15132
17036
  PyVarObject_HEAD_INIT(0, 0)
15133
17037
  __Pyx_NAMESTR("gevent.core.timer"), /*tp_name*/
15134
17038
  sizeof(struct __pyx_obj_6gevent_4core_timer), /*tp_basicsize*/
15137
17041
  0, /*tp_print*/
15138
17042
  0, /*tp_getattr*/
15139
17043
  0, /*tp_setattr*/
 
17044
  #if PY_MAJOR_VERSION < 3
15140
17045
  0, /*tp_compare*/
 
17046
  #else
 
17047
  0, /*reserved*/
 
17048
  #endif
15141
17049
  0, /*tp_repr*/
15142
17050
  &__pyx_tp_as_number_timer, /*tp_as_number*/
15143
17051
  &__pyx_tp_as_sequence_timer, /*tp_as_sequence*/
15148
17056
  0, /*tp_getattro*/
15149
17057
  0, /*tp_setattro*/
15150
17058
  &__pyx_tp_as_buffer_timer, /*tp_as_buffer*/
15151
 
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
 
17059
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
15152
17060
  __Pyx_DOCSTR("Create a new scheduled timer"), /*tp_doc*/
15153
17061
  __pyx_tp_traverse_6gevent_4core_event, /*tp_traverse*/
15154
17062
  __pyx_tp_clear_6gevent_4core_event, /*tp_clear*/
15190
17098
  return o;
15191
17099
}
15192
17100
 
15193
 
static struct PyMethodDef __pyx_methods_6gevent_4core_signal[] = {
 
17101
static PyMethodDef __pyx_methods_6gevent_4core_signal[] = {
15194
17102
  {0, 0, 0, 0}
15195
17103
};
15196
17104
 
15218
17126
  0, /*nb_coerce*/
15219
17127
  #endif
15220
17128
  0, /*nb_int*/
15221
 
  #if PY_MAJOR_VERSION >= 3
 
17129
  #if PY_MAJOR_VERSION < 3
 
17130
  0, /*nb_long*/
 
17131
  #else
15222
17132
  0, /*reserved*/
15223
 
  #else
15224
 
  0, /*nb_long*/
15225
17133
  #endif
15226
17134
  0, /*nb_float*/
15227
17135
  #if PY_MAJOR_VERSION < 3
15247
17155
  0, /*nb_true_divide*/
15248
17156
  0, /*nb_inplace_floor_divide*/
15249
17157
  0, /*nb_inplace_true_divide*/
15250
 
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
 
17158
  #if PY_VERSION_HEX >= 0x02050000
15251
17159
  0, /*nb_index*/
15252
17160
  #endif
15253
17161
};
15292
17200
  #endif
15293
17201
};
15294
17202
 
15295
 
PyTypeObject __pyx_type_6gevent_4core_signal = {
 
17203
static PyTypeObject __pyx_type_6gevent_4core_signal = {
15296
17204
  PyVarObject_HEAD_INIT(0, 0)
15297
17205
  __Pyx_NAMESTR("gevent.core.signal"), /*tp_name*/
15298
17206
  sizeof(struct __pyx_obj_6gevent_4core_signal), /*tp_basicsize*/
15301
17209
  0, /*tp_print*/
15302
17210
  0, /*tp_getattr*/
15303
17211
  0, /*tp_setattr*/
 
17212
  #if PY_MAJOR_VERSION < 3
15304
17213
  0, /*tp_compare*/
 
17214
  #else
 
17215
  0, /*reserved*/
 
17216
  #endif
15305
17217
  0, /*tp_repr*/
15306
17218
  &__pyx_tp_as_number_signal, /*tp_as_number*/
15307
17219
  &__pyx_tp_as_sequence_signal, /*tp_as_sequence*/
15312
17224
  0, /*tp_getattro*/
15313
17225
  0, /*tp_setattro*/
15314
17226
  &__pyx_tp_as_buffer_signal, /*tp_as_buffer*/
15315
 
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
 
17227
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
15316
17228
  __Pyx_DOCSTR("Create a new persistent signal event"), /*tp_doc*/
15317
17229
  __pyx_tp_traverse_6gevent_4core_event, /*tp_traverse*/
15318
17230
  __pyx_tp_clear_6gevent_4core_event, /*tp_clear*/
15354
17266
  return o;
15355
17267
}
15356
17268
 
15357
 
static struct PyMethodDef __pyx_methods_6gevent_4core_active_event[] = {
15358
 
  {__Pyx_NAMESTR("add"), (PyCFunction)__pyx_pf_6gevent_4core_12active_event_add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
 
17269
static PyMethodDef __pyx_methods_6gevent_4core_active_event[] = {
 
17270
  {__Pyx_NAMESTR("add"), (PyCFunction)__pyx_pf_6gevent_4core_12active_event_1add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
15359
17271
  {0, 0, 0, 0}
15360
17272
};
15361
17273
 
15383
17295
  0, /*nb_coerce*/
15384
17296
  #endif
15385
17297
  0, /*nb_int*/
15386
 
  #if PY_MAJOR_VERSION >= 3
 
17298
  #if PY_MAJOR_VERSION < 3
 
17299
  0, /*nb_long*/
 
17300
  #else
15387
17301
  0, /*reserved*/
15388
 
  #else
15389
 
  0, /*nb_long*/
15390
17302
  #endif
15391
17303
  0, /*nb_float*/
15392
17304
  #if PY_MAJOR_VERSION < 3
15412
17324
  0, /*nb_true_divide*/
15413
17325
  0, /*nb_inplace_floor_divide*/
15414
17326
  0, /*nb_inplace_true_divide*/
15415
 
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
 
17327
  #if PY_VERSION_HEX >= 0x02050000
15416
17328
  0, /*nb_index*/
15417
17329
  #endif
15418
17330
};
15457
17369
  #endif
15458
17370
};
15459
17371
 
15460
 
PyTypeObject __pyx_type_6gevent_4core_active_event = {
 
17372
static PyTypeObject __pyx_type_6gevent_4core_active_event = {
15461
17373
  PyVarObject_HEAD_INIT(0, 0)
15462
17374
  __Pyx_NAMESTR("gevent.core.active_event"), /*tp_name*/
15463
17375
  sizeof(struct __pyx_obj_6gevent_4core_active_event), /*tp_basicsize*/
15466
17378
  0, /*tp_print*/
15467
17379
  0, /*tp_getattr*/
15468
17380
  0, /*tp_setattr*/
 
17381
  #if PY_MAJOR_VERSION < 3
15469
17382
  0, /*tp_compare*/
 
17383
  #else
 
17384
  0, /*reserved*/
 
17385
  #endif
15470
17386
  0, /*tp_repr*/
15471
17387
  &__pyx_tp_as_number_active_event, /*tp_as_number*/
15472
17388
  &__pyx_tp_as_sequence_active_event, /*tp_as_sequence*/
15477
17393
  0, /*tp_getattro*/
15478
17394
  0, /*tp_setattro*/
15479
17395
  &__pyx_tp_as_buffer_active_event, /*tp_as_buffer*/
15480
 
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
 
17396
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
15481
17397
  __Pyx_DOCSTR("An event that is scheduled to run in the current loop iteration"), /*tp_doc*/
15482
17398
  __pyx_tp_traverse_6gevent_4core_event, /*tp_traverse*/
15483
17399
  __pyx_tp_clear_6gevent_4core_event, /*tp_clear*/
15523
17439
  return __pyx_pf_6gevent_4core_6buffer_4_obj___get__(o);
15524
17440
}
15525
17441
 
15526
 
static struct PyMethodDef __pyx_methods_6gevent_4core_buffer[] = {
15527
 
  {__Pyx_NAMESTR("detach"), (PyCFunction)__pyx_pf_6gevent_4core_6buffer_detach, METH_NOARGS, __Pyx_DOCSTR(0)},
15528
 
  {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_6gevent_4core_6buffer___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
15529
 
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6gevent_4core_6buffer___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
15530
 
  {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pf_6gevent_4core_6buffer_read, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_6buffer_read)},
15531
 
  {__Pyx_NAMESTR("readline"), (PyCFunction)__pyx_pf_6gevent_4core_6buffer_readline, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
15532
 
  {__Pyx_NAMESTR("readlines"), (PyCFunction)__pyx_pf_6gevent_4core_6buffer_readlines, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
 
17442
static PyMethodDef __pyx_methods_6gevent_4core_buffer[] = {
 
17443
  {__Pyx_NAMESTR("detach"), (PyCFunction)__pyx_pf_6gevent_4core_6buffer_3detach, METH_NOARGS, __Pyx_DOCSTR(0)},
 
17444
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6gevent_4core_6buffer_5__next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
 
17445
  {__Pyx_NAMESTR("read"), (PyCFunction)__pyx_pf_6gevent_4core_6buffer_6read, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_6buffer_6read)},
 
17446
  {__Pyx_NAMESTR("readline"), (PyCFunction)__pyx_pf_6gevent_4core_6buffer_7readline, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
 
17447
  {__Pyx_NAMESTR("readlines"), (PyCFunction)__pyx_pf_6gevent_4core_6buffer_8readlines, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
 
17448
  {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pf_6gevent_4core_6buffer_9write, METH_O, __Pyx_DOCSTR(0)},
15533
17449
  {0, 0, 0, 0}
15534
17450
};
15535
17451
 
15551
17467
  0, /*nb_negative*/
15552
17468
  0, /*nb_positive*/
15553
17469
  0, /*nb_absolute*/
15554
 
  __pyx_pf_6gevent_4core_6buffer___nonzero__, /*nb_nonzero*/
 
17470
  __pyx_pf_6gevent_4core_6buffer_2__nonzero__, /*nb_nonzero*/
15555
17471
  0, /*nb_invert*/
15556
17472
  0, /*nb_lshift*/
15557
17473
  0, /*nb_rshift*/
15562
17478
  0, /*nb_coerce*/
15563
17479
  #endif
15564
17480
  0, /*nb_int*/
15565
 
  #if PY_MAJOR_VERSION >= 3
 
17481
  #if PY_MAJOR_VERSION < 3
 
17482
  0, /*nb_long*/
 
17483
  #else
15566
17484
  0, /*reserved*/
15567
 
  #else
15568
 
  0, /*nb_long*/
15569
17485
  #endif
15570
17486
  0, /*nb_float*/
15571
17487
  #if PY_MAJOR_VERSION < 3
15591
17507
  0, /*nb_true_divide*/
15592
17508
  0, /*nb_inplace_floor_divide*/
15593
17509
  0, /*nb_inplace_true_divide*/
15594
 
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
 
17510
  #if PY_VERSION_HEX >= 0x02050000
15595
17511
  0, /*nb_index*/
15596
17512
  #endif
15597
17513
};
15598
17514
 
15599
17515
static PySequenceMethods __pyx_tp_as_sequence_buffer = {
15600
 
  __pyx_pf_6gevent_4core_6buffer___len__, /*sq_length*/
 
17516
  __pyx_pf_6gevent_4core_6buffer_1__len__, /*sq_length*/
15601
17517
  0, /*sq_concat*/
15602
17518
  0, /*sq_repeat*/
15603
17519
  0, /*sq_item*/
15610
17526
};
15611
17527
 
15612
17528
static PyMappingMethods __pyx_tp_as_mapping_buffer = {
15613
 
  __pyx_pf_6gevent_4core_6buffer___len__, /*mp_length*/
 
17529
  __pyx_pf_6gevent_4core_6buffer_1__len__, /*mp_length*/
15614
17530
  0, /*mp_subscript*/
15615
17531
  0, /*mp_ass_subscript*/
15616
17532
};
15636
17552
  #endif
15637
17553
};
15638
17554
 
15639
 
PyTypeObject __pyx_type_6gevent_4core_buffer = {
 
17555
static PyTypeObject __pyx_type_6gevent_4core_buffer = {
15640
17556
  PyVarObject_HEAD_INIT(0, 0)
15641
17557
  __Pyx_NAMESTR("gevent.core.buffer"), /*tp_name*/
15642
17558
  sizeof(struct __pyx_obj_6gevent_4core_buffer), /*tp_basicsize*/
15645
17561
  0, /*tp_print*/
15646
17562
  0, /*tp_getattr*/
15647
17563
  0, /*tp_setattr*/
 
17564
  #if PY_MAJOR_VERSION < 3
15648
17565
  0, /*tp_compare*/
 
17566
  #else
 
17567
  0, /*reserved*/
 
17568
  #endif
15649
17569
  0, /*tp_repr*/
15650
17570
  &__pyx_tp_as_number_buffer, /*tp_as_number*/
15651
17571
  &__pyx_tp_as_sequence_buffer, /*tp_as_sequence*/
15656
17576
  0, /*tp_getattro*/
15657
17577
  0, /*tp_setattro*/
15658
17578
  &__pyx_tp_as_buffer_buffer, /*tp_as_buffer*/
15659
 
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
 
17579
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
15660
17580
  __Pyx_DOCSTR("file-like wrapper for libevent's :class:`evbuffer` structure.\n\n    Note, that the wrapper does not own the structure, libevent does.\n    "), /*tp_doc*/
15661
17581
  0, /*tp_traverse*/
15662
17582
  0, /*tp_clear*/
15663
17583
  0, /*tp_richcompare*/
15664
17584
  0, /*tp_weaklistoffset*/
15665
 
  __pyx_pf_6gevent_4core_6buffer___iter__, /*tp_iter*/
15666
 
  __pyx_pf_6gevent_4core_6buffer___next__, /*tp_iternext*/
 
17585
  __pyx_pf_6gevent_4core_6buffer_4__iter__, /*tp_iter*/
 
17586
  __pyx_pf_6gevent_4core_6buffer_5__next__, /*tp_iternext*/
15667
17587
  __pyx_methods_6gevent_4core_buffer, /*tp_methods*/
15668
17588
  0, /*tp_members*/
15669
17589
  __pyx_getsets_6gevent_4core_buffer, /*tp_getset*/
15688
17608
  #endif
15689
17609
};
15690
17610
 
15691
 
static PyObject *__pyx_tp_new_6gevent_4core_http_request(PyTypeObject *t, PyObject *a, PyObject *k) {
15692
 
  struct __pyx_obj_6gevent_4core_http_request *p;
 
17611
static PyObject *__pyx_tp_new_6gevent_4core_http_request_base(PyTypeObject *t, PyObject *a, PyObject *k) {
 
17612
  struct __pyx_obj_6gevent_4core_http_request_base *p;
15693
17613
  PyObject *o = (*t->tp_alloc)(t, 0);
15694
17614
  if (!o) return 0;
15695
 
  p = ((struct __pyx_obj_6gevent_4core_http_request *)o);
 
17615
  p = ((struct __pyx_obj_6gevent_4core_http_request_base *)o);
15696
17616
  p->__weakref__ = 0;
15697
17617
  p->_input_buffer = Py_None; Py_INCREF(Py_None);
15698
17618
  p->_output_buffer = Py_None; Py_INCREF(Py_None);
15699
 
  p->default_response_headers = Py_None; Py_INCREF(Py_None);
15700
17619
  return o;
15701
17620
}
15702
17621
 
15703
 
static void __pyx_tp_dealloc_6gevent_4core_http_request(PyObject *o) {
15704
 
  struct __pyx_obj_6gevent_4core_http_request *p = (struct __pyx_obj_6gevent_4core_http_request *)o;
15705
 
  {
15706
 
    PyObject *etype, *eval, *etb;
15707
 
    PyErr_Fetch(&etype, &eval, &etb);
15708
 
    ++Py_REFCNT(o);
15709
 
    __pyx_pf_6gevent_4core_12http_request___dealloc__(o);
15710
 
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
15711
 
    --Py_REFCNT(o);
15712
 
    PyErr_Restore(etype, eval, etb);
15713
 
  }
 
17622
static void __pyx_tp_dealloc_6gevent_4core_http_request_base(PyObject *o) {
 
17623
  struct __pyx_obj_6gevent_4core_http_request_base *p = (struct __pyx_obj_6gevent_4core_http_request_base *)o;
15714
17624
  if (p->__weakref__) PyObject_ClearWeakRefs(o);
15715
17625
  Py_XDECREF(p->_input_buffer);
15716
17626
  Py_XDECREF(p->_output_buffer);
15717
 
  Py_XDECREF(p->default_response_headers);
15718
17627
  (*Py_TYPE(o)->tp_free)(o);
15719
17628
}
15720
17629
 
15721
 
static int __pyx_tp_traverse_6gevent_4core_http_request(PyObject *o, visitproc v, void *a) {
 
17630
static int __pyx_tp_traverse_6gevent_4core_http_request_base(PyObject *o, visitproc v, void *a) {
15722
17631
  int e;
15723
 
  struct __pyx_obj_6gevent_4core_http_request *p = (struct __pyx_obj_6gevent_4core_http_request *)o;
 
17632
  struct __pyx_obj_6gevent_4core_http_request_base *p = (struct __pyx_obj_6gevent_4core_http_request_base *)o;
15724
17633
  if (p->_input_buffer) {
15725
17634
    e = (*v)(p->_input_buffer, a); if (e) return e;
15726
17635
  }
15727
17636
  if (p->_output_buffer) {
15728
17637
    e = (*v)(p->_output_buffer, a); if (e) return e;
15729
17638
  }
15730
 
  if (p->default_response_headers) {
15731
 
    e = (*v)(p->default_response_headers, a); if (e) return e;
15732
 
  }
15733
17639
  return 0;
15734
17640
}
15735
17641
 
15736
 
static int __pyx_tp_clear_6gevent_4core_http_request(PyObject *o) {
15737
 
  struct __pyx_obj_6gevent_4core_http_request *p = (struct __pyx_obj_6gevent_4core_http_request *)o;
 
17642
static int __pyx_tp_clear_6gevent_4core_http_request_base(PyObject *o) {
 
17643
  struct __pyx_obj_6gevent_4core_http_request_base *p = (struct __pyx_obj_6gevent_4core_http_request_base *)o;
15738
17644
  PyObject* tmp;
15739
17645
  tmp = ((PyObject*)p->_input_buffer);
15740
17646
  p->_input_buffer = Py_None; Py_INCREF(Py_None);
15742
17648
  tmp = ((PyObject*)p->_output_buffer);
15743
17649
  p->_output_buffer = Py_None; Py_INCREF(Py_None);
15744
17650
  Py_XDECREF(tmp);
 
17651
  return 0;
 
17652
}
 
17653
 
 
17654
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base__obj(PyObject *o, void *x) {
 
17655
  return __pyx_pf_6gevent_4core_17http_request_base_4_obj___get__(o);
 
17656
}
 
17657
 
 
17658
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_connection(PyObject *o, void *x) {
 
17659
  return __pyx_pf_6gevent_4core_17http_request_base_10connection___get__(o);
 
17660
}
 
17661
 
 
17662
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_remote_host(PyObject *o, void *x) {
 
17663
  return __pyx_pf_6gevent_4core_17http_request_base_11remote_host___get__(o);
 
17664
}
 
17665
 
 
17666
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_remote_port(PyObject *o, void *x) {
 
17667
  return __pyx_pf_6gevent_4core_17http_request_base_11remote_port___get__(o);
 
17668
}
 
17669
 
 
17670
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_remote(PyObject *o, void *x) {
 
17671
  return __pyx_pf_6gevent_4core_17http_request_base_6remote___get__(o);
 
17672
}
 
17673
 
 
17674
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_kind(PyObject *o, void *x) {
 
17675
  return __pyx_pf_6gevent_4core_17http_request_base_4kind___get__(o);
 
17676
}
 
17677
 
 
17678
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_type(PyObject *o, void *x) {
 
17679
  return __pyx_pf_6gevent_4core_17http_request_base_4type___get__(o);
 
17680
}
 
17681
 
 
17682
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_typestr(PyObject *o, void *x) {
 
17683
  return __pyx_pf_6gevent_4core_17http_request_base_7typestr___get__(o);
 
17684
}
 
17685
 
 
17686
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_uri(PyObject *o, void *x) {
 
17687
  return __pyx_pf_6gevent_4core_17http_request_base_3uri___get__(o);
 
17688
}
 
17689
 
 
17690
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_major(PyObject *o, void *x) {
 
17691
  return __pyx_pf_6gevent_4core_17http_request_base_5major___get__(o);
 
17692
}
 
17693
 
 
17694
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_minor(PyObject *o, void *x) {
 
17695
  return __pyx_pf_6gevent_4core_17http_request_base_5minor___get__(o);
 
17696
}
 
17697
 
 
17698
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_version(PyObject *o, void *x) {
 
17699
  return __pyx_pf_6gevent_4core_17http_request_base_7version___get__(o);
 
17700
}
 
17701
 
 
17702
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_response_code(PyObject *o, void *x) {
 
17703
  return __pyx_pf_6gevent_4core_17http_request_base_13response_code___get__(o);
 
17704
}
 
17705
 
 
17706
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_response_code_line(PyObject *o, void *x) {
 
17707
  return __pyx_pf_6gevent_4core_17http_request_base_18response_code_line___get__(o);
 
17708
}
 
17709
 
 
17710
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_response(PyObject *o, void *x) {
 
17711
  return __pyx_pf_6gevent_4core_17http_request_base_8response___get__(o);
 
17712
}
 
17713
 
 
17714
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_chunked(PyObject *o, void *x) {
 
17715
  return __pyx_pf_6gevent_4core_17http_request_base_7chunked___get__(o);
 
17716
}
 
17717
 
 
17718
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_input_buffer(PyObject *o, void *x) {
 
17719
  return __pyx_pf_6gevent_4core_17http_request_base_12input_buffer___get__(o);
 
17720
}
 
17721
 
 
17722
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base_output_buffer(PyObject *o, void *x) {
 
17723
  return __pyx_pf_6gevent_4core_17http_request_base_13output_buffer___get__(o);
 
17724
}
 
17725
 
 
17726
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base__input_buffer(PyObject *o, void *x) {
 
17727
  return __pyx_pf_6gevent_4core_17http_request_base_13_input_buffer___get__(o);
 
17728
}
 
17729
 
 
17730
static int __pyx_setprop_6gevent_4core_17http_request_base__input_buffer(PyObject *o, PyObject *v, void *x) {
 
17731
  if (v) {
 
17732
    return __pyx_pf_6gevent_4core_17http_request_base_13_input_buffer_1__set__(o, v);
 
17733
  }
 
17734
  else {
 
17735
    return __pyx_pf_6gevent_4core_17http_request_base_13_input_buffer_2__del__(o);
 
17736
  }
 
17737
}
 
17738
 
 
17739
static PyObject *__pyx_getprop_6gevent_4core_17http_request_base__output_buffer(PyObject *o, void *x) {
 
17740
  return __pyx_pf_6gevent_4core_17http_request_base_14_output_buffer___get__(o);
 
17741
}
 
17742
 
 
17743
static int __pyx_setprop_6gevent_4core_17http_request_base__output_buffer(PyObject *o, PyObject *v, void *x) {
 
17744
  if (v) {
 
17745
    return __pyx_pf_6gevent_4core_17http_request_base_14_output_buffer_1__set__(o, v);
 
17746
  }
 
17747
  else {
 
17748
    return __pyx_pf_6gevent_4core_17http_request_base_14_output_buffer_2__del__(o);
 
17749
  }
 
17750
}
 
17751
 
 
17752
static PyMethodDef __pyx_methods_6gevent_4core_http_request_base[] = {
 
17753
  {__Pyx_NAMESTR("detach"), (PyCFunction)__pyx_pf_6gevent_4core_17http_request_base_2detach, METH_NOARGS, __Pyx_DOCSTR(0)},
 
17754
  {__Pyx_NAMESTR("_format"), (PyCFunction)__pyx_pf_6gevent_4core_17http_request_base_3_format, METH_NOARGS, __Pyx_DOCSTR(0)},
 
17755
  {__Pyx_NAMESTR("get_input_headers"), (PyCFunction)__pyx_pf_6gevent_4core_17http_request_base_6get_input_headers, METH_NOARGS, __Pyx_DOCSTR(0)},
 
17756
  {__Pyx_NAMESTR("find_input_header"), (PyCFunction)__pyx_pf_6gevent_4core_17http_request_base_7find_input_header, METH_O, __Pyx_DOCSTR(0)},
 
17757
  {__Pyx_NAMESTR("find_output_header"), (PyCFunction)__pyx_pf_6gevent_4core_17http_request_base_8find_output_header, METH_O, __Pyx_DOCSTR(0)},
 
17758
  {__Pyx_NAMESTR("add_input_header"), (PyCFunction)__pyx_pf_6gevent_4core_17http_request_base_9add_input_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
 
17759
  {__Pyx_NAMESTR("add_output_header"), (PyCFunction)__pyx_pf_6gevent_4core_17http_request_base_10add_output_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
 
17760
  {__Pyx_NAMESTR("remove_input_header"), (PyCFunction)__pyx_pf_6gevent_4core_17http_request_base_11remove_input_header, METH_O, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_17http_request_base_11remove_input_header)},
 
17761
  {__Pyx_NAMESTR("remove_output_header"), (PyCFunction)__pyx_pf_6gevent_4core_17http_request_base_12remove_output_header, METH_O, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_17http_request_base_12remove_output_header)},
 
17762
  {__Pyx_NAMESTR("clear_input_headers"), (PyCFunction)__pyx_pf_6gevent_4core_17http_request_base_13clear_input_headers, METH_NOARGS, __Pyx_DOCSTR(0)},
 
17763
  {__Pyx_NAMESTR("clear_output_headers"), (PyCFunction)__pyx_pf_6gevent_4core_17http_request_base_14clear_output_headers, METH_NOARGS, __Pyx_DOCSTR(0)},
 
17764
  {0, 0, 0, 0}
 
17765
};
 
17766
 
 
17767
static struct PyGetSetDef __pyx_getsets_6gevent_4core_http_request_base[] = {
 
17768
  {(char *)"_obj", __pyx_getprop_6gevent_4core_17http_request_base__obj, 0, 0, 0},
 
17769
  {(char *)"connection", __pyx_getprop_6gevent_4core_17http_request_base_connection, 0, 0, 0},
 
17770
  {(char *)"remote_host", __pyx_getprop_6gevent_4core_17http_request_base_remote_host, 0, 0, 0},
 
17771
  {(char *)"remote_port", __pyx_getprop_6gevent_4core_17http_request_base_remote_port, 0, 0, 0},
 
17772
  {(char *)"remote", __pyx_getprop_6gevent_4core_17http_request_base_remote, 0, 0, 0},
 
17773
  {(char *)"kind", __pyx_getprop_6gevent_4core_17http_request_base_kind, 0, 0, 0},
 
17774
  {(char *)"type", __pyx_getprop_6gevent_4core_17http_request_base_type, 0, 0, 0},
 
17775
  {(char *)"typestr", __pyx_getprop_6gevent_4core_17http_request_base_typestr, 0, 0, 0},
 
17776
  {(char *)"uri", __pyx_getprop_6gevent_4core_17http_request_base_uri, 0, 0, 0},
 
17777
  {(char *)"major", __pyx_getprop_6gevent_4core_17http_request_base_major, 0, 0, 0},
 
17778
  {(char *)"minor", __pyx_getprop_6gevent_4core_17http_request_base_minor, 0, 0, 0},
 
17779
  {(char *)"version", __pyx_getprop_6gevent_4core_17http_request_base_version, 0, 0, 0},
 
17780
  {(char *)"response_code", __pyx_getprop_6gevent_4core_17http_request_base_response_code, 0, 0, 0},
 
17781
  {(char *)"response_code_line", __pyx_getprop_6gevent_4core_17http_request_base_response_code_line, 0, 0, 0},
 
17782
  {(char *)"response", __pyx_getprop_6gevent_4core_17http_request_base_response, 0, 0, 0},
 
17783
  {(char *)"chunked", __pyx_getprop_6gevent_4core_17http_request_base_chunked, 0, 0, 0},
 
17784
  {(char *)"input_buffer", __pyx_getprop_6gevent_4core_17http_request_base_input_buffer, 0, 0, 0},
 
17785
  {(char *)"output_buffer", __pyx_getprop_6gevent_4core_17http_request_base_output_buffer, 0, 0, 0},
 
17786
  {(char *)"_input_buffer", __pyx_getprop_6gevent_4core_17http_request_base__input_buffer, __pyx_setprop_6gevent_4core_17http_request_base__input_buffer, 0, 0},
 
17787
  {(char *)"_output_buffer", __pyx_getprop_6gevent_4core_17http_request_base__output_buffer, __pyx_setprop_6gevent_4core_17http_request_base__output_buffer, 0, 0},
 
17788
  {0, 0, 0, 0, 0}
 
17789
};
 
17790
 
 
17791
static PyNumberMethods __pyx_tp_as_number_http_request_base = {
 
17792
  0, /*nb_add*/
 
17793
  0, /*nb_subtract*/
 
17794
  0, /*nb_multiply*/
 
17795
  #if PY_MAJOR_VERSION < 3
 
17796
  0, /*nb_divide*/
 
17797
  #endif
 
17798
  0, /*nb_remainder*/
 
17799
  0, /*nb_divmod*/
 
17800
  0, /*nb_power*/
 
17801
  0, /*nb_negative*/
 
17802
  0, /*nb_positive*/
 
17803
  0, /*nb_absolute*/
 
17804
  __pyx_pf_6gevent_4core_17http_request_base_1__nonzero__, /*nb_nonzero*/
 
17805
  0, /*nb_invert*/
 
17806
  0, /*nb_lshift*/
 
17807
  0, /*nb_rshift*/
 
17808
  0, /*nb_and*/
 
17809
  0, /*nb_xor*/
 
17810
  0, /*nb_or*/
 
17811
  #if PY_MAJOR_VERSION < 3
 
17812
  0, /*nb_coerce*/
 
17813
  #endif
 
17814
  0, /*nb_int*/
 
17815
  #if PY_MAJOR_VERSION < 3
 
17816
  0, /*nb_long*/
 
17817
  #else
 
17818
  0, /*reserved*/
 
17819
  #endif
 
17820
  0, /*nb_float*/
 
17821
  #if PY_MAJOR_VERSION < 3
 
17822
  0, /*nb_oct*/
 
17823
  #endif
 
17824
  #if PY_MAJOR_VERSION < 3
 
17825
  0, /*nb_hex*/
 
17826
  #endif
 
17827
  0, /*nb_inplace_add*/
 
17828
  0, /*nb_inplace_subtract*/
 
17829
  0, /*nb_inplace_multiply*/
 
17830
  #if PY_MAJOR_VERSION < 3
 
17831
  0, /*nb_inplace_divide*/
 
17832
  #endif
 
17833
  0, /*nb_inplace_remainder*/
 
17834
  0, /*nb_inplace_power*/
 
17835
  0, /*nb_inplace_lshift*/
 
17836
  0, /*nb_inplace_rshift*/
 
17837
  0, /*nb_inplace_and*/
 
17838
  0, /*nb_inplace_xor*/
 
17839
  0, /*nb_inplace_or*/
 
17840
  0, /*nb_floor_divide*/
 
17841
  0, /*nb_true_divide*/
 
17842
  0, /*nb_inplace_floor_divide*/
 
17843
  0, /*nb_inplace_true_divide*/
 
17844
  #if PY_VERSION_HEX >= 0x02050000
 
17845
  0, /*nb_index*/
 
17846
  #endif
 
17847
};
 
17848
 
 
17849
static PySequenceMethods __pyx_tp_as_sequence_http_request_base = {
 
17850
  0, /*sq_length*/
 
17851
  0, /*sq_concat*/
 
17852
  0, /*sq_repeat*/
 
17853
  0, /*sq_item*/
 
17854
  0, /*sq_slice*/
 
17855
  0, /*sq_ass_item*/
 
17856
  0, /*sq_ass_slice*/
 
17857
  0, /*sq_contains*/
 
17858
  0, /*sq_inplace_concat*/
 
17859
  0, /*sq_inplace_repeat*/
 
17860
};
 
17861
 
 
17862
static PyMappingMethods __pyx_tp_as_mapping_http_request_base = {
 
17863
  0, /*mp_length*/
 
17864
  0, /*mp_subscript*/
 
17865
  0, /*mp_ass_subscript*/
 
17866
};
 
17867
 
 
17868
static PyBufferProcs __pyx_tp_as_buffer_http_request_base = {
 
17869
  #if PY_MAJOR_VERSION < 3
 
17870
  0, /*bf_getreadbuffer*/
 
17871
  #endif
 
17872
  #if PY_MAJOR_VERSION < 3
 
17873
  0, /*bf_getwritebuffer*/
 
17874
  #endif
 
17875
  #if PY_MAJOR_VERSION < 3
 
17876
  0, /*bf_getsegcount*/
 
17877
  #endif
 
17878
  #if PY_MAJOR_VERSION < 3
 
17879
  0, /*bf_getcharbuffer*/
 
17880
  #endif
 
17881
  #if PY_VERSION_HEX >= 0x02060000
 
17882
  0, /*bf_getbuffer*/
 
17883
  #endif
 
17884
  #if PY_VERSION_HEX >= 0x02060000
 
17885
  0, /*bf_releasebuffer*/
 
17886
  #endif
 
17887
};
 
17888
 
 
17889
static PyTypeObject __pyx_type_6gevent_4core_http_request_base = {
 
17890
  PyVarObject_HEAD_INIT(0, 0)
 
17891
  __Pyx_NAMESTR("gevent.core.http_request_base"), /*tp_name*/
 
17892
  sizeof(struct __pyx_obj_6gevent_4core_http_request_base), /*tp_basicsize*/
 
17893
  0, /*tp_itemsize*/
 
17894
  __pyx_tp_dealloc_6gevent_4core_http_request_base, /*tp_dealloc*/
 
17895
  0, /*tp_print*/
 
17896
  0, /*tp_getattr*/
 
17897
  0, /*tp_setattr*/
 
17898
  #if PY_MAJOR_VERSION < 3
 
17899
  0, /*tp_compare*/
 
17900
  #else
 
17901
  0, /*reserved*/
 
17902
  #endif
 
17903
  __pyx_pf_6gevent_4core_17http_request_base_5__repr__, /*tp_repr*/
 
17904
  &__pyx_tp_as_number_http_request_base, /*tp_as_number*/
 
17905
  &__pyx_tp_as_sequence_http_request_base, /*tp_as_sequence*/
 
17906
  &__pyx_tp_as_mapping_http_request_base, /*tp_as_mapping*/
 
17907
  0, /*tp_hash*/
 
17908
  0, /*tp_call*/
 
17909
  __pyx_pf_6gevent_4core_17http_request_base_4__str__, /*tp_str*/
 
17910
  0, /*tp_getattro*/
 
17911
  0, /*tp_setattro*/
 
17912
  &__pyx_tp_as_buffer_http_request_base, /*tp_as_buffer*/
 
17913
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
 
17914
  __Pyx_DOCSTR("Wrapper around libevent's :class:`evhttp_request` structure."), /*tp_doc*/
 
17915
  __pyx_tp_traverse_6gevent_4core_http_request_base, /*tp_traverse*/
 
17916
  __pyx_tp_clear_6gevent_4core_http_request_base, /*tp_clear*/
 
17917
  0, /*tp_richcompare*/
 
17918
  0, /*tp_weaklistoffset*/
 
17919
  0, /*tp_iter*/
 
17920
  0, /*tp_iternext*/
 
17921
  __pyx_methods_6gevent_4core_http_request_base, /*tp_methods*/
 
17922
  0, /*tp_members*/
 
17923
  __pyx_getsets_6gevent_4core_http_request_base, /*tp_getset*/
 
17924
  0, /*tp_base*/
 
17925
  0, /*tp_dict*/
 
17926
  0, /*tp_descr_get*/
 
17927
  0, /*tp_descr_set*/
 
17928
  0, /*tp_dictoffset*/
 
17929
  __pyx_pf_6gevent_4core_17http_request_base___init__, /*tp_init*/
 
17930
  0, /*tp_alloc*/
 
17931
  __pyx_tp_new_6gevent_4core_http_request_base, /*tp_new*/
 
17932
  0, /*tp_free*/
 
17933
  0, /*tp_is_gc*/
 
17934
  0, /*tp_bases*/
 
17935
  0, /*tp_mro*/
 
17936
  0, /*tp_cache*/
 
17937
  0, /*tp_subclasses*/
 
17938
  0, /*tp_weaklist*/
 
17939
  0, /*tp_del*/
 
17940
  #if PY_VERSION_HEX >= 0x02060000
 
17941
  0, /*tp_version_tag*/
 
17942
  #endif
 
17943
};
 
17944
 
 
17945
static PyObject *__pyx_tp_new_6gevent_4core_http_request(PyTypeObject *t, PyObject *a, PyObject *k) {
 
17946
  struct __pyx_obj_6gevent_4core_http_request *p;
 
17947
  PyObject *o = __pyx_tp_new_6gevent_4core_http_request_base(t, a, k);
 
17948
  if (!o) return 0;
 
17949
  p = ((struct __pyx_obj_6gevent_4core_http_request *)o);
 
17950
  p->default_response_headers = Py_None; Py_INCREF(Py_None);
 
17951
  return o;
 
17952
}
 
17953
 
 
17954
static void __pyx_tp_dealloc_6gevent_4core_http_request(PyObject *o) {
 
17955
  struct __pyx_obj_6gevent_4core_http_request *p = (struct __pyx_obj_6gevent_4core_http_request *)o;
 
17956
  {
 
17957
    PyObject *etype, *eval, *etb;
 
17958
    PyErr_Fetch(&etype, &eval, &etb);
 
17959
    ++Py_REFCNT(o);
 
17960
    __pyx_pf_6gevent_4core_12http_request_1__dealloc__(o);
 
17961
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
 
17962
    --Py_REFCNT(o);
 
17963
    PyErr_Restore(etype, eval, etb);
 
17964
  }
 
17965
  Py_XDECREF(p->default_response_headers);
 
17966
  __pyx_tp_dealloc_6gevent_4core_http_request_base(o);
 
17967
}
 
17968
 
 
17969
static int __pyx_tp_traverse_6gevent_4core_http_request(PyObject *o, visitproc v, void *a) {
 
17970
  int e;
 
17971
  struct __pyx_obj_6gevent_4core_http_request *p = (struct __pyx_obj_6gevent_4core_http_request *)o;
 
17972
  e = __pyx_tp_traverse_6gevent_4core_http_request_base(o, v, a); if (e) return e;
 
17973
  if (p->default_response_headers) {
 
17974
    e = (*v)(p->default_response_headers, a); if (e) return e;
 
17975
  }
 
17976
  return 0;
 
17977
}
 
17978
 
 
17979
static int __pyx_tp_clear_6gevent_4core_http_request(PyObject *o) {
 
17980
  struct __pyx_obj_6gevent_4core_http_request *p = (struct __pyx_obj_6gevent_4core_http_request *)o;
 
17981
  PyObject* tmp;
 
17982
  __pyx_tp_clear_6gevent_4core_http_request_base(o);
15745
17983
  tmp = ((PyObject*)p->default_response_headers);
15746
17984
  p->default_response_headers = Py_None; Py_INCREF(Py_None);
15747
17985
  Py_XDECREF(tmp);
15748
17986
  return 0;
15749
17987
}
15750
17988
 
15751
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request__obj(PyObject *o, void *x) {
15752
 
  return __pyx_pf_6gevent_4core_12http_request_4_obj___get__(o);
15753
 
}
15754
 
 
15755
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_connection(PyObject *o, void *x) {
15756
 
  return __pyx_pf_6gevent_4core_12http_request_10connection___get__(o);
15757
 
}
15758
 
 
15759
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_remote_host(PyObject *o, void *x) {
15760
 
  return __pyx_pf_6gevent_4core_12http_request_11remote_host___get__(o);
15761
 
}
15762
 
 
15763
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_remote_port(PyObject *o, void *x) {
15764
 
  return __pyx_pf_6gevent_4core_12http_request_11remote_port___get__(o);
15765
 
}
15766
 
 
15767
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_remote(PyObject *o, void *x) {
15768
 
  return __pyx_pf_6gevent_4core_12http_request_6remote___get__(o);
15769
 
}
15770
 
 
15771
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_kind(PyObject *o, void *x) {
15772
 
  return __pyx_pf_6gevent_4core_12http_request_4kind___get__(o);
15773
 
}
15774
 
 
15775
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_type(PyObject *o, void *x) {
15776
 
  return __pyx_pf_6gevent_4core_12http_request_4type___get__(o);
15777
 
}
15778
 
 
15779
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_typestr(PyObject *o, void *x) {
15780
 
  return __pyx_pf_6gevent_4core_12http_request_7typestr___get__(o);
15781
 
}
15782
 
 
15783
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_uri(PyObject *o, void *x) {
15784
 
  return __pyx_pf_6gevent_4core_12http_request_3uri___get__(o);
15785
 
}
15786
 
 
15787
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_major(PyObject *o, void *x) {
15788
 
  return __pyx_pf_6gevent_4core_12http_request_5major___get__(o);
15789
 
}
15790
 
 
15791
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_minor(PyObject *o, void *x) {
15792
 
  return __pyx_pf_6gevent_4core_12http_request_5minor___get__(o);
15793
 
}
15794
 
 
15795
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_version(PyObject *o, void *x) {
15796
 
  return __pyx_pf_6gevent_4core_12http_request_7version___get__(o);
15797
 
}
15798
 
 
15799
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_response_code(PyObject *o, void *x) {
15800
 
  return __pyx_pf_6gevent_4core_12http_request_13response_code___get__(o);
15801
 
}
15802
 
 
15803
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_response_code_line(PyObject *o, void *x) {
15804
 
  return __pyx_pf_6gevent_4core_12http_request_18response_code_line___get__(o);
15805
 
}
15806
 
 
15807
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_response(PyObject *o, void *x) {
15808
 
  return __pyx_pf_6gevent_4core_12http_request_8response___get__(o);
15809
 
}
15810
 
 
15811
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_chunked(PyObject *o, void *x) {
15812
 
  return __pyx_pf_6gevent_4core_12http_request_7chunked___get__(o);
15813
 
}
15814
 
 
15815
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_input_buffer(PyObject *o, void *x) {
15816
 
  return __pyx_pf_6gevent_4core_12http_request_12input_buffer___get__(o);
15817
 
}
15818
 
 
15819
 
static PyObject *__pyx_getprop_6gevent_4core_12http_request_output_buffer(PyObject *o, void *x) {
15820
 
  return __pyx_pf_6gevent_4core_12http_request_13output_buffer___get__(o);
15821
 
}
15822
 
 
15823
 
static struct PyMethodDef __pyx_methods_6gevent_4core_http_request[] = {
15824
 
  {__Pyx_NAMESTR("detach"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_detach, METH_NOARGS, __Pyx_DOCSTR(0)},
15825
 
  {__Pyx_NAMESTR("_format"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request__format, METH_NOARGS, __Pyx_DOCSTR(0)},
15826
 
  {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request___str__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
15827
 
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
15828
 
  {__Pyx_NAMESTR("get_input_headers"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_get_input_headers, METH_NOARGS, __Pyx_DOCSTR(0)},
15829
 
  {__Pyx_NAMESTR("_add_default_response_headers"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request__add_default_response_headers, METH_NOARGS, __Pyx_DOCSTR(0)},
15830
 
  {__Pyx_NAMESTR("send_reply"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_send_reply, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
15831
 
  {__Pyx_NAMESTR("send_reply_start"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_send_reply_start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
15832
 
  {__Pyx_NAMESTR("send_reply_chunk"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_send_reply_chunk, METH_O, __Pyx_DOCSTR(0)},
15833
 
  {__Pyx_NAMESTR("send_reply_end"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_send_reply_end, METH_NOARGS, __Pyx_DOCSTR(0)},
15834
 
  {__Pyx_NAMESTR("send_error"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_send_error, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
15835
 
  {__Pyx_NAMESTR("find_input_header"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_find_input_header, METH_O, __Pyx_DOCSTR(0)},
15836
 
  {__Pyx_NAMESTR("find_output_header"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_find_output_header, METH_O, __Pyx_DOCSTR(0)},
15837
 
  {__Pyx_NAMESTR("add_input_header"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_add_input_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
15838
 
  {__Pyx_NAMESTR("add_output_header"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_add_output_header, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
15839
 
  {__Pyx_NAMESTR("remove_input_header"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_remove_input_header, METH_O, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_12http_request_remove_input_header)},
15840
 
  {__Pyx_NAMESTR("remove_output_header"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_remove_output_header, METH_O, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_12http_request_remove_output_header)},
15841
 
  {__Pyx_NAMESTR("clear_input_headers"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_clear_input_headers, METH_NOARGS, __Pyx_DOCSTR(0)},
15842
 
  {__Pyx_NAMESTR("clear_output_headers"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_clear_output_headers, METH_NOARGS, __Pyx_DOCSTR(0)},
 
17989
static PyObject *__pyx_getprop_6gevent_4core_12http_request_default_response_headers(PyObject *o, void *x) {
 
17990
  return __pyx_pf_6gevent_4core_12http_request_24default_response_headers___get__(o);
 
17991
}
 
17992
 
 
17993
static int __pyx_setprop_6gevent_4core_12http_request_default_response_headers(PyObject *o, PyObject *v, void *x) {
 
17994
  if (v) {
 
17995
    return __pyx_pf_6gevent_4core_12http_request_24default_response_headers_1__set__(o, v);
 
17996
  }
 
17997
  else {
 
17998
    return __pyx_pf_6gevent_4core_12http_request_24default_response_headers_2__del__(o);
 
17999
  }
 
18000
}
 
18001
 
 
18002
static PyMethodDef __pyx_methods_6gevent_4core_http_request[] = {
 
18003
  {__Pyx_NAMESTR("_add_default_response_headers"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_2_add_default_response_headers, METH_NOARGS, __Pyx_DOCSTR(0)},
 
18004
  {__Pyx_NAMESTR("send_reply"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_3send_reply, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
 
18005
  {__Pyx_NAMESTR("send_reply_start"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_4send_reply_start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
 
18006
  {__Pyx_NAMESTR("send_reply_chunk"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_5send_reply_chunk, METH_O, __Pyx_DOCSTR(0)},
 
18007
  {__Pyx_NAMESTR("send_reply_end"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_6send_reply_end, METH_NOARGS, __Pyx_DOCSTR(0)},
 
18008
  {__Pyx_NAMESTR("send_error"), (PyCFunction)__pyx_pf_6gevent_4core_12http_request_7send_error, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
15843
18009
  {0, 0, 0, 0}
15844
18010
};
15845
18011
 
15846
 
static struct PyMemberDef __pyx_members_6gevent_4core_http_request[] = {
15847
 
  {(char *)"default_response_headers", T_OBJECT, offsetof(struct __pyx_obj_6gevent_4core_http_request, default_response_headers), 0, 0},
15848
 
  {0, 0, 0, 0, 0}
15849
 
};
15850
 
 
15851
18012
static struct PyGetSetDef __pyx_getsets_6gevent_4core_http_request[] = {
15852
 
  {(char *)"_obj", __pyx_getprop_6gevent_4core_12http_request__obj, 0, 0, 0},
15853
 
  {(char *)"connection", __pyx_getprop_6gevent_4core_12http_request_connection, 0, 0, 0},
15854
 
  {(char *)"remote_host", __pyx_getprop_6gevent_4core_12http_request_remote_host, 0, 0, 0},
15855
 
  {(char *)"remote_port", __pyx_getprop_6gevent_4core_12http_request_remote_port, 0, 0, 0},
15856
 
  {(char *)"remote", __pyx_getprop_6gevent_4core_12http_request_remote, 0, 0, 0},
15857
 
  {(char *)"kind", __pyx_getprop_6gevent_4core_12http_request_kind, 0, 0, 0},
15858
 
  {(char *)"type", __pyx_getprop_6gevent_4core_12http_request_type, 0, 0, 0},
15859
 
  {(char *)"typestr", __pyx_getprop_6gevent_4core_12http_request_typestr, 0, 0, 0},
15860
 
  {(char *)"uri", __pyx_getprop_6gevent_4core_12http_request_uri, 0, 0, 0},
15861
 
  {(char *)"major", __pyx_getprop_6gevent_4core_12http_request_major, 0, 0, 0},
15862
 
  {(char *)"minor", __pyx_getprop_6gevent_4core_12http_request_minor, 0, 0, 0},
15863
 
  {(char *)"version", __pyx_getprop_6gevent_4core_12http_request_version, 0, 0, 0},
15864
 
  {(char *)"response_code", __pyx_getprop_6gevent_4core_12http_request_response_code, 0, 0, 0},
15865
 
  {(char *)"response_code_line", __pyx_getprop_6gevent_4core_12http_request_response_code_line, 0, 0, 0},
15866
 
  {(char *)"response", __pyx_getprop_6gevent_4core_12http_request_response, 0, 0, 0},
15867
 
  {(char *)"chunked", __pyx_getprop_6gevent_4core_12http_request_chunked, 0, 0, 0},
15868
 
  {(char *)"input_buffer", __pyx_getprop_6gevent_4core_12http_request_input_buffer, 0, 0, 0},
15869
 
  {(char *)"output_buffer", __pyx_getprop_6gevent_4core_12http_request_output_buffer, 0, 0, 0},
 
18013
  {(char *)"default_response_headers", __pyx_getprop_6gevent_4core_12http_request_default_response_headers, __pyx_setprop_6gevent_4core_12http_request_default_response_headers, 0, 0},
15870
18014
  {0, 0, 0, 0, 0}
15871
18015
};
15872
18016
 
15883
18027
  0, /*nb_negative*/
15884
18028
  0, /*nb_positive*/
15885
18029
  0, /*nb_absolute*/
15886
 
  __pyx_pf_6gevent_4core_12http_request___nonzero__, /*nb_nonzero*/
 
18030
  0, /*nb_nonzero*/
15887
18031
  0, /*nb_invert*/
15888
18032
  0, /*nb_lshift*/
15889
18033
  0, /*nb_rshift*/
15894
18038
  0, /*nb_coerce*/
15895
18039
  #endif
15896
18040
  0, /*nb_int*/
15897
 
  #if PY_MAJOR_VERSION >= 3
 
18041
  #if PY_MAJOR_VERSION < 3
 
18042
  0, /*nb_long*/
 
18043
  #else
15898
18044
  0, /*reserved*/
15899
 
  #else
15900
 
  0, /*nb_long*/
15901
18045
  #endif
15902
18046
  0, /*nb_float*/
15903
18047
  #if PY_MAJOR_VERSION < 3
15923
18067
  0, /*nb_true_divide*/
15924
18068
  0, /*nb_inplace_floor_divide*/
15925
18069
  0, /*nb_inplace_true_divide*/
15926
 
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
 
18070
  #if PY_VERSION_HEX >= 0x02050000
15927
18071
  0, /*nb_index*/
15928
18072
  #endif
15929
18073
};
15968
18112
  #endif
15969
18113
};
15970
18114
 
15971
 
PyTypeObject __pyx_type_6gevent_4core_http_request = {
 
18115
static PyTypeObject __pyx_type_6gevent_4core_http_request = {
15972
18116
  PyVarObject_HEAD_INIT(0, 0)
15973
18117
  __Pyx_NAMESTR("gevent.core.http_request"), /*tp_name*/
15974
18118
  sizeof(struct __pyx_obj_6gevent_4core_http_request), /*tp_basicsize*/
15977
18121
  0, /*tp_print*/
15978
18122
  0, /*tp_getattr*/
15979
18123
  0, /*tp_setattr*/
 
18124
  #if PY_MAJOR_VERSION < 3
15980
18125
  0, /*tp_compare*/
15981
 
  __pyx_pf_6gevent_4core_12http_request___repr__, /*tp_repr*/
 
18126
  #else
 
18127
  0, /*reserved*/
 
18128
  #endif
 
18129
  0, /*tp_repr*/
15982
18130
  &__pyx_tp_as_number_http_request, /*tp_as_number*/
15983
18131
  &__pyx_tp_as_sequence_http_request, /*tp_as_sequence*/
15984
18132
  &__pyx_tp_as_mapping_http_request, /*tp_as_mapping*/
15985
18133
  0, /*tp_hash*/
15986
18134
  0, /*tp_call*/
15987
 
  __pyx_pf_6gevent_4core_12http_request___str__, /*tp_str*/
 
18135
  0, /*tp_str*/
15988
18136
  0, /*tp_getattro*/
15989
18137
  0, /*tp_setattro*/
15990
18138
  &__pyx_tp_as_buffer_http_request, /*tp_as_buffer*/
15991
 
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
 
18139
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
15992
18140
  __Pyx_DOCSTR("Wrapper around libevent's :class:`evhttp_request` structure."), /*tp_doc*/
15993
18141
  __pyx_tp_traverse_6gevent_4core_http_request, /*tp_traverse*/
15994
18142
  __pyx_tp_clear_6gevent_4core_http_request, /*tp_clear*/
15997
18145
  0, /*tp_iter*/
15998
18146
  0, /*tp_iternext*/
15999
18147
  __pyx_methods_6gevent_4core_http_request, /*tp_methods*/
16000
 
  __pyx_members_6gevent_4core_http_request, /*tp_members*/
 
18148
  0, /*tp_members*/
16001
18149
  __pyx_getsets_6gevent_4core_http_request, /*tp_getset*/
16002
18150
  0, /*tp_base*/
16003
18151
  0, /*tp_dict*/
16019
18167
  0, /*tp_version_tag*/
16020
18168
  #endif
16021
18169
};
 
18170
static struct __pyx_vtabstruct_6gevent_4core_http_request_client __pyx_vtable_6gevent_4core_http_request_client;
 
18171
 
 
18172
static PyObject *__pyx_tp_new_6gevent_4core_http_request_client(PyTypeObject *t, PyObject *a, PyObject *k) {
 
18173
  struct __pyx_obj_6gevent_4core_http_request_client *p;
 
18174
  PyObject *o = __pyx_tp_new_6gevent_4core_http_request_base(t, a, k);
 
18175
  if (!o) return 0;
 
18176
  p = ((struct __pyx_obj_6gevent_4core_http_request_client *)o);
 
18177
  p->__pyx_vtab = __pyx_vtabptr_6gevent_4core_http_request_client;
 
18178
  p->callback = Py_None; Py_INCREF(Py_None);
 
18179
  return o;
 
18180
}
 
18181
 
 
18182
static void __pyx_tp_dealloc_6gevent_4core_http_request_client(PyObject *o) {
 
18183
  struct __pyx_obj_6gevent_4core_http_request_client *p = (struct __pyx_obj_6gevent_4core_http_request_client *)o;
 
18184
  {
 
18185
    PyObject *etype, *eval, *etb;
 
18186
    PyErr_Fetch(&etype, &eval, &etb);
 
18187
    ++Py_REFCNT(o);
 
18188
    __pyx_pf_6gevent_4core_19http_request_client_1__dealloc__(o);
 
18189
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
 
18190
    --Py_REFCNT(o);
 
18191
    PyErr_Restore(etype, eval, etb);
 
18192
  }
 
18193
  Py_XDECREF(p->callback);
 
18194
  __pyx_tp_dealloc_6gevent_4core_http_request_base(o);
 
18195
}
 
18196
 
 
18197
static int __pyx_tp_traverse_6gevent_4core_http_request_client(PyObject *o, visitproc v, void *a) {
 
18198
  int e;
 
18199
  struct __pyx_obj_6gevent_4core_http_request_client *p = (struct __pyx_obj_6gevent_4core_http_request_client *)o;
 
18200
  e = __pyx_tp_traverse_6gevent_4core_http_request_base(o, v, a); if (e) return e;
 
18201
  if (p->callback) {
 
18202
    e = (*v)(p->callback, a); if (e) return e;
 
18203
  }
 
18204
  return 0;
 
18205
}
 
18206
 
 
18207
static int __pyx_tp_clear_6gevent_4core_http_request_client(PyObject *o) {
 
18208
  struct __pyx_obj_6gevent_4core_http_request_client *p = (struct __pyx_obj_6gevent_4core_http_request_client *)o;
 
18209
  PyObject* tmp;
 
18210
  __pyx_tp_clear_6gevent_4core_http_request_base(o);
 
18211
  tmp = ((PyObject*)p->callback);
 
18212
  p->callback = Py_None; Py_INCREF(Py_None);
 
18213
  Py_XDECREF(tmp);
 
18214
  return 0;
 
18215
}
 
18216
 
 
18217
static PyObject *__pyx_getprop_6gevent_4core_19http_request_client__owned(PyObject *o, void *x) {
 
18218
  return __pyx_pf_6gevent_4core_19http_request_client_6_owned___get__(o);
 
18219
}
 
18220
 
 
18221
static int __pyx_setprop_6gevent_4core_19http_request_client__owned(PyObject *o, PyObject *v, void *x) {
 
18222
  if (v) {
 
18223
    return __pyx_pf_6gevent_4core_19http_request_client_6_owned_1__set__(o, v);
 
18224
  }
 
18225
  else {
 
18226
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
 
18227
    return -1;
 
18228
  }
 
18229
}
 
18230
 
 
18231
static PyObject *__pyx_getprop_6gevent_4core_19http_request_client_callback(PyObject *o, void *x) {
 
18232
  return __pyx_pf_6gevent_4core_19http_request_client_8callback___get__(o);
 
18233
}
 
18234
 
 
18235
static int __pyx_setprop_6gevent_4core_19http_request_client_callback(PyObject *o, PyObject *v, void *x) {
 
18236
  if (v) {
 
18237
    return __pyx_pf_6gevent_4core_19http_request_client_8callback_1__set__(o, v);
 
18238
  }
 
18239
  else {
 
18240
    return __pyx_pf_6gevent_4core_19http_request_client_8callback_2__del__(o);
 
18241
  }
 
18242
}
 
18243
 
 
18244
static PyMethodDef __pyx_methods_6gevent_4core_http_request_client[] = {
 
18245
  {0, 0, 0, 0}
 
18246
};
 
18247
 
 
18248
static struct PyGetSetDef __pyx_getsets_6gevent_4core_http_request_client[] = {
 
18249
  {(char *)"_owned", __pyx_getprop_6gevent_4core_19http_request_client__owned, __pyx_setprop_6gevent_4core_19http_request_client__owned, 0, 0},
 
18250
  {(char *)"callback", __pyx_getprop_6gevent_4core_19http_request_client_callback, __pyx_setprop_6gevent_4core_19http_request_client_callback, 0, 0},
 
18251
  {0, 0, 0, 0, 0}
 
18252
};
 
18253
 
 
18254
static PyNumberMethods __pyx_tp_as_number_http_request_client = {
 
18255
  0, /*nb_add*/
 
18256
  0, /*nb_subtract*/
 
18257
  0, /*nb_multiply*/
 
18258
  #if PY_MAJOR_VERSION < 3
 
18259
  0, /*nb_divide*/
 
18260
  #endif
 
18261
  0, /*nb_remainder*/
 
18262
  0, /*nb_divmod*/
 
18263
  0, /*nb_power*/
 
18264
  0, /*nb_negative*/
 
18265
  0, /*nb_positive*/
 
18266
  0, /*nb_absolute*/
 
18267
  0, /*nb_nonzero*/
 
18268
  0, /*nb_invert*/
 
18269
  0, /*nb_lshift*/
 
18270
  0, /*nb_rshift*/
 
18271
  0, /*nb_and*/
 
18272
  0, /*nb_xor*/
 
18273
  0, /*nb_or*/
 
18274
  #if PY_MAJOR_VERSION < 3
 
18275
  0, /*nb_coerce*/
 
18276
  #endif
 
18277
  0, /*nb_int*/
 
18278
  #if PY_MAJOR_VERSION < 3
 
18279
  0, /*nb_long*/
 
18280
  #else
 
18281
  0, /*reserved*/
 
18282
  #endif
 
18283
  0, /*nb_float*/
 
18284
  #if PY_MAJOR_VERSION < 3
 
18285
  0, /*nb_oct*/
 
18286
  #endif
 
18287
  #if PY_MAJOR_VERSION < 3
 
18288
  0, /*nb_hex*/
 
18289
  #endif
 
18290
  0, /*nb_inplace_add*/
 
18291
  0, /*nb_inplace_subtract*/
 
18292
  0, /*nb_inplace_multiply*/
 
18293
  #if PY_MAJOR_VERSION < 3
 
18294
  0, /*nb_inplace_divide*/
 
18295
  #endif
 
18296
  0, /*nb_inplace_remainder*/
 
18297
  0, /*nb_inplace_power*/
 
18298
  0, /*nb_inplace_lshift*/
 
18299
  0, /*nb_inplace_rshift*/
 
18300
  0, /*nb_inplace_and*/
 
18301
  0, /*nb_inplace_xor*/
 
18302
  0, /*nb_inplace_or*/
 
18303
  0, /*nb_floor_divide*/
 
18304
  0, /*nb_true_divide*/
 
18305
  0, /*nb_inplace_floor_divide*/
 
18306
  0, /*nb_inplace_true_divide*/
 
18307
  #if PY_VERSION_HEX >= 0x02050000
 
18308
  0, /*nb_index*/
 
18309
  #endif
 
18310
};
 
18311
 
 
18312
static PySequenceMethods __pyx_tp_as_sequence_http_request_client = {
 
18313
  0, /*sq_length*/
 
18314
  0, /*sq_concat*/
 
18315
  0, /*sq_repeat*/
 
18316
  0, /*sq_item*/
 
18317
  0, /*sq_slice*/
 
18318
  0, /*sq_ass_item*/
 
18319
  0, /*sq_ass_slice*/
 
18320
  0, /*sq_contains*/
 
18321
  0, /*sq_inplace_concat*/
 
18322
  0, /*sq_inplace_repeat*/
 
18323
};
 
18324
 
 
18325
static PyMappingMethods __pyx_tp_as_mapping_http_request_client = {
 
18326
  0, /*mp_length*/
 
18327
  0, /*mp_subscript*/
 
18328
  0, /*mp_ass_subscript*/
 
18329
};
 
18330
 
 
18331
static PyBufferProcs __pyx_tp_as_buffer_http_request_client = {
 
18332
  #if PY_MAJOR_VERSION < 3
 
18333
  0, /*bf_getreadbuffer*/
 
18334
  #endif
 
18335
  #if PY_MAJOR_VERSION < 3
 
18336
  0, /*bf_getwritebuffer*/
 
18337
  #endif
 
18338
  #if PY_MAJOR_VERSION < 3
 
18339
  0, /*bf_getsegcount*/
 
18340
  #endif
 
18341
  #if PY_MAJOR_VERSION < 3
 
18342
  0, /*bf_getcharbuffer*/
 
18343
  #endif
 
18344
  #if PY_VERSION_HEX >= 0x02060000
 
18345
  0, /*bf_getbuffer*/
 
18346
  #endif
 
18347
  #if PY_VERSION_HEX >= 0x02060000
 
18348
  0, /*bf_releasebuffer*/
 
18349
  #endif
 
18350
};
 
18351
 
 
18352
static PyTypeObject __pyx_type_6gevent_4core_http_request_client = {
 
18353
  PyVarObject_HEAD_INIT(0, 0)
 
18354
  __Pyx_NAMESTR("gevent.core.http_request_client"), /*tp_name*/
 
18355
  sizeof(struct __pyx_obj_6gevent_4core_http_request_client), /*tp_basicsize*/
 
18356
  0, /*tp_itemsize*/
 
18357
  __pyx_tp_dealloc_6gevent_4core_http_request_client, /*tp_dealloc*/
 
18358
  0, /*tp_print*/
 
18359
  0, /*tp_getattr*/
 
18360
  0, /*tp_setattr*/
 
18361
  #if PY_MAJOR_VERSION < 3
 
18362
  0, /*tp_compare*/
 
18363
  #else
 
18364
  0, /*reserved*/
 
18365
  #endif
 
18366
  0, /*tp_repr*/
 
18367
  &__pyx_tp_as_number_http_request_client, /*tp_as_number*/
 
18368
  &__pyx_tp_as_sequence_http_request_client, /*tp_as_sequence*/
 
18369
  &__pyx_tp_as_mapping_http_request_client, /*tp_as_mapping*/
 
18370
  0, /*tp_hash*/
 
18371
  0, /*tp_call*/
 
18372
  0, /*tp_str*/
 
18373
  0, /*tp_getattro*/
 
18374
  0, /*tp_setattro*/
 
18375
  &__pyx_tp_as_buffer_http_request_client, /*tp_as_buffer*/
 
18376
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
 
18377
  __Pyx_DOCSTR("Wrapper around libevent's :class:`evhttp_request` structure."), /*tp_doc*/
 
18378
  __pyx_tp_traverse_6gevent_4core_http_request_client, /*tp_traverse*/
 
18379
  __pyx_tp_clear_6gevent_4core_http_request_client, /*tp_clear*/
 
18380
  0, /*tp_richcompare*/
 
18381
  0, /*tp_weaklistoffset*/
 
18382
  0, /*tp_iter*/
 
18383
  0, /*tp_iternext*/
 
18384
  __pyx_methods_6gevent_4core_http_request_client, /*tp_methods*/
 
18385
  0, /*tp_members*/
 
18386
  __pyx_getsets_6gevent_4core_http_request_client, /*tp_getset*/
 
18387
  0, /*tp_base*/
 
18388
  0, /*tp_dict*/
 
18389
  0, /*tp_descr_get*/
 
18390
  0, /*tp_descr_set*/
 
18391
  0, /*tp_dictoffset*/
 
18392
  __pyx_pf_6gevent_4core_19http_request_client___init__, /*tp_init*/
 
18393
  0, /*tp_alloc*/
 
18394
  __pyx_tp_new_6gevent_4core_http_request_client, /*tp_new*/
 
18395
  0, /*tp_free*/
 
18396
  0, /*tp_is_gc*/
 
18397
  0, /*tp_bases*/
 
18398
  0, /*tp_mro*/
 
18399
  0, /*tp_cache*/
 
18400
  0, /*tp_subclasses*/
 
18401
  0, /*tp_weaklist*/
 
18402
  0, /*tp_del*/
 
18403
  #if PY_VERSION_HEX >= 0x02060000
 
18404
  0, /*tp_version_tag*/
 
18405
  #endif
 
18406
};
16022
18407
 
16023
18408
static PyObject *__pyx_tp_new_6gevent_4core_http_connection(PyTypeObject *t, PyObject *a, PyObject *k) {
16024
18409
  PyObject *o = (*t->tp_alloc)(t, 0);
16027
18412
}
16028
18413
 
16029
18414
static void __pyx_tp_dealloc_6gevent_4core_http_connection(PyObject *o) {
 
18415
  {
 
18416
    PyObject *etype, *eval, *etb;
 
18417
    PyErr_Fetch(&etype, &eval, &etb);
 
18418
    ++Py_REFCNT(o);
 
18419
    __pyx_pf_6gevent_4core_15http_connection_2__dealloc__(o);
 
18420
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
 
18421
    --Py_REFCNT(o);
 
18422
    PyErr_Restore(etype, eval, etb);
 
18423
  }
16030
18424
  (*Py_TYPE(o)->tp_free)(o);
16031
18425
}
16032
18426
 
16038
18432
  return __pyx_pf_6gevent_4core_15http_connection_4peer___get__(o);
16039
18433
}
16040
18434
 
16041
 
static struct PyMethodDef __pyx_methods_6gevent_4core_http_connection[] = {
16042
 
  {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pf_6gevent_4core_15http_connection___str__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
16043
 
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_6gevent_4core_15http_connection___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
 
18435
static PyObject *__pyx_getprop_6gevent_4core_15http_connection__owned(PyObject *o, void *x) {
 
18436
  return __pyx_pf_6gevent_4core_15http_connection_6_owned___get__(o);
 
18437
}
 
18438
 
 
18439
static int __pyx_setprop_6gevent_4core_15http_connection__owned(PyObject *o, PyObject *v, void *x) {
 
18440
  if (v) {
 
18441
    return __pyx_pf_6gevent_4core_15http_connection_6_owned_1__set__(o, v);
 
18442
  }
 
18443
  else {
 
18444
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
 
18445
    return -1;
 
18446
  }
 
18447
}
 
18448
 
 
18449
static PyMethodDef __pyx_methods_6gevent_4core_http_connection[] = {
 
18450
  {__Pyx_NAMESTR("new"), (PyCFunction)__pyx_pf_6gevent_4core_15http_connection_1new, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
 
18451
  {__Pyx_NAMESTR("set_local_address"), (PyCFunction)__pyx_pf_6gevent_4core_15http_connection_6set_local_address, METH_O, __Pyx_DOCSTR(0)},
 
18452
  {__Pyx_NAMESTR("set_timeout"), (PyCFunction)__pyx_pf_6gevent_4core_15http_connection_7set_timeout, METH_O, __Pyx_DOCSTR(0)},
 
18453
  {__Pyx_NAMESTR("set_retries"), (PyCFunction)__pyx_pf_6gevent_4core_15http_connection_8set_retries, METH_O, __Pyx_DOCSTR(0)},
 
18454
  {__Pyx_NAMESTR("make_request"), (PyCFunction)__pyx_pf_6gevent_4core_15http_connection_9make_request, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
16044
18455
  {0, 0, 0, 0}
16045
18456
};
16046
18457
 
16047
18458
static struct PyGetSetDef __pyx_getsets_6gevent_4core_http_connection[] = {
16048
18459
  {(char *)"_obj", __pyx_getprop_6gevent_4core_15http_connection__obj, 0, 0, 0},
16049
18460
  {(char *)"peer", __pyx_getprop_6gevent_4core_15http_connection_peer, 0, 0, 0},
 
18461
  {(char *)"_owned", __pyx_getprop_6gevent_4core_15http_connection__owned, __pyx_setprop_6gevent_4core_15http_connection__owned, 0, 0},
16050
18462
  {0, 0, 0, 0, 0}
16051
18463
};
16052
18464
 
16063
18475
  0, /*nb_negative*/
16064
18476
  0, /*nb_positive*/
16065
18477
  0, /*nb_absolute*/
16066
 
  __pyx_pf_6gevent_4core_15http_connection___nonzero__, /*nb_nonzero*/
 
18478
  __pyx_pf_6gevent_4core_15http_connection_3__nonzero__, /*nb_nonzero*/
16067
18479
  0, /*nb_invert*/
16068
18480
  0, /*nb_lshift*/
16069
18481
  0, /*nb_rshift*/
16074
18486
  0, /*nb_coerce*/
16075
18487
  #endif
16076
18488
  0, /*nb_int*/
16077
 
  #if PY_MAJOR_VERSION >= 3
 
18489
  #if PY_MAJOR_VERSION < 3
 
18490
  0, /*nb_long*/
 
18491
  #else
16078
18492
  0, /*reserved*/
16079
 
  #else
16080
 
  0, /*nb_long*/
16081
18493
  #endif
16082
18494
  0, /*nb_float*/
16083
18495
  #if PY_MAJOR_VERSION < 3
16103
18515
  0, /*nb_true_divide*/
16104
18516
  0, /*nb_inplace_floor_divide*/
16105
18517
  0, /*nb_inplace_true_divide*/
16106
 
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
 
18518
  #if PY_VERSION_HEX >= 0x02050000
16107
18519
  0, /*nb_index*/
16108
18520
  #endif
16109
18521
};
16148
18560
  #endif
16149
18561
};
16150
18562
 
16151
 
PyTypeObject __pyx_type_6gevent_4core_http_connection = {
 
18563
static PyTypeObject __pyx_type_6gevent_4core_http_connection = {
16152
18564
  PyVarObject_HEAD_INIT(0, 0)
16153
18565
  __Pyx_NAMESTR("gevent.core.http_connection"), /*tp_name*/
16154
18566
  sizeof(struct __pyx_obj_6gevent_4core_http_connection), /*tp_basicsize*/
16157
18569
  0, /*tp_print*/
16158
18570
  0, /*tp_getattr*/
16159
18571
  0, /*tp_setattr*/
 
18572
  #if PY_MAJOR_VERSION < 3
16160
18573
  0, /*tp_compare*/
16161
 
  __pyx_pf_6gevent_4core_15http_connection___repr__, /*tp_repr*/
 
18574
  #else
 
18575
  0, /*reserved*/
 
18576
  #endif
 
18577
  __pyx_pf_6gevent_4core_15http_connection_5__repr__, /*tp_repr*/
16162
18578
  &__pyx_tp_as_number_http_connection, /*tp_as_number*/
16163
18579
  &__pyx_tp_as_sequence_http_connection, /*tp_as_sequence*/
16164
18580
  &__pyx_tp_as_mapping_http_connection, /*tp_as_mapping*/
16165
18581
  0, /*tp_hash*/
16166
18582
  0, /*tp_call*/
16167
 
  __pyx_pf_6gevent_4core_15http_connection___str__, /*tp_str*/
 
18583
  __pyx_pf_6gevent_4core_15http_connection_4__str__, /*tp_str*/
16168
18584
  0, /*tp_getattro*/
16169
18585
  0, /*tp_setattro*/
16170
18586
  &__pyx_tp_as_buffer_http_connection, /*tp_as_buffer*/
16171
 
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
 
18587
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
16172
18588
  0, /*tp_doc*/
16173
18589
  0, /*tp_traverse*/
16174
18590
  0, /*tp_clear*/
16207
18623
  p = ((struct __pyx_obj_6gevent_4core_http *)o);
16208
18624
  p->handle = Py_None; Py_INCREF(Py_None);
16209
18625
  p->default_response_headers = Py_None; Py_INCREF(Py_None);
16210
 
  p->_requests = ((PyObject *)Py_None); Py_INCREF(Py_None);
 
18626
  p->_requests = ((PyObject*)Py_None); Py_INCREF(Py_None);
16211
18627
  return o;
16212
18628
}
16213
18629
 
16217
18633
    PyObject *etype, *eval, *etb;
16218
18634
    PyErr_Fetch(&etype, &eval, &etb);
16219
18635
    ++Py_REFCNT(o);
16220
 
    __pyx_pf_6gevent_4core_4http___dealloc__(o);
 
18636
    __pyx_pf_6gevent_4core_4http_1__dealloc__(o);
16221
18637
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
16222
18638
    --Py_REFCNT(o);
16223
18639
    PyErr_Restore(etype, eval, etb);
16253
18669
  p->default_response_headers = Py_None; Py_INCREF(Py_None);
16254
18670
  Py_XDECREF(tmp);
16255
18671
  tmp = ((PyObject*)p->_requests);
16256
 
  p->_requests = ((PyObject *)Py_None); Py_INCREF(Py_None);
 
18672
  p->_requests = ((PyObject*)Py_None); Py_INCREF(Py_None);
16257
18673
  Py_XDECREF(tmp);
16258
18674
  return 0;
16259
18675
}
16262
18678
  return __pyx_pf_6gevent_4core_4http_4_obj___get__(o);
16263
18679
}
16264
18680
 
16265
 
static struct PyMethodDef __pyx_methods_6gevent_4core_http[] = {
16266
 
  {__Pyx_NAMESTR("bind"), (PyCFunction)__pyx_pf_6gevent_4core_4http_bind, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
16267
 
  {__Pyx_NAMESTR("accept"), (PyCFunction)__pyx_pf_6gevent_4core_4http_accept, METH_O, __Pyx_DOCSTR(0)},
 
18681
static PyObject *__pyx_getprop_6gevent_4core_4http_handle(PyObject *o, void *x) {
 
18682
  return __pyx_pf_6gevent_4core_4http_6handle___get__(o);
 
18683
}
 
18684
 
 
18685
static int __pyx_setprop_6gevent_4core_4http_handle(PyObject *o, PyObject *v, void *x) {
 
18686
  if (v) {
 
18687
    return __pyx_pf_6gevent_4core_4http_6handle_1__set__(o, v);
 
18688
  }
 
18689
  else {
 
18690
    return __pyx_pf_6gevent_4core_4http_6handle_2__del__(o);
 
18691
  }
 
18692
}
 
18693
 
 
18694
static PyObject *__pyx_getprop_6gevent_4core_4http_default_response_headers(PyObject *o, void *x) {
 
18695
  return __pyx_pf_6gevent_4core_4http_24default_response_headers___get__(o);
 
18696
}
 
18697
 
 
18698
static int __pyx_setprop_6gevent_4core_4http_default_response_headers(PyObject *o, PyObject *v, void *x) {
 
18699
  if (v) {
 
18700
    return __pyx_pf_6gevent_4core_4http_24default_response_headers_1__set__(o, v);
 
18701
  }
 
18702
  else {
 
18703
    return __pyx_pf_6gevent_4core_4http_24default_response_headers_2__del__(o);
 
18704
  }
 
18705
}
 
18706
 
 
18707
static PyObject *__pyx_getprop_6gevent_4core_4http__requests(PyObject *o, void *x) {
 
18708
  return __pyx_pf_6gevent_4core_4http_9_requests___get__(o);
 
18709
}
 
18710
 
 
18711
static int __pyx_setprop_6gevent_4core_4http__requests(PyObject *o, PyObject *v, void *x) {
 
18712
  if (v) {
 
18713
    return __pyx_pf_6gevent_4core_4http_9_requests_1__set__(o, v);
 
18714
  }
 
18715
  else {
 
18716
    return __pyx_pf_6gevent_4core_4http_9_requests_2__del__(o);
 
18717
  }
 
18718
}
 
18719
 
 
18720
static PyMethodDef __pyx_methods_6gevent_4core_http[] = {
 
18721
  {__Pyx_NAMESTR("bind"), (PyCFunction)__pyx_pf_6gevent_4core_4http_3bind, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
 
18722
  {__Pyx_NAMESTR("accept"), (PyCFunction)__pyx_pf_6gevent_4core_4http_4accept, METH_O, __Pyx_DOCSTR(0)},
16268
18723
  {0, 0, 0, 0}
16269
18724
};
16270
18725
 
16271
 
static struct PyMemberDef __pyx_members_6gevent_4core_http[] = {
16272
 
  {(char *)"handle", T_OBJECT, offsetof(struct __pyx_obj_6gevent_4core_http, handle), 0, 0},
16273
 
  {(char *)"default_response_headers", T_OBJECT, offsetof(struct __pyx_obj_6gevent_4core_http, default_response_headers), 0, 0},
16274
 
  {0, 0, 0, 0, 0}
16275
 
};
16276
 
 
16277
18726
static struct PyGetSetDef __pyx_getsets_6gevent_4core_http[] = {
16278
18727
  {(char *)"_obj", __pyx_getprop_6gevent_4core_4http__obj, 0, 0, 0},
 
18728
  {(char *)"handle", __pyx_getprop_6gevent_4core_4http_handle, __pyx_setprop_6gevent_4core_4http_handle, 0, 0},
 
18729
  {(char *)"default_response_headers", __pyx_getprop_6gevent_4core_4http_default_response_headers, __pyx_setprop_6gevent_4core_4http_default_response_headers, 0, 0},
 
18730
  {(char *)"_requests", __pyx_getprop_6gevent_4core_4http__requests, __pyx_setprop_6gevent_4core_4http__requests, 0, 0},
16279
18731
  {0, 0, 0, 0, 0}
16280
18732
};
16281
18733
 
16292
18744
  0, /*nb_negative*/
16293
18745
  0, /*nb_positive*/
16294
18746
  0, /*nb_absolute*/
16295
 
  __pyx_pf_6gevent_4core_4http___nonzero__, /*nb_nonzero*/
 
18747
  __pyx_pf_6gevent_4core_4http_2__nonzero__, /*nb_nonzero*/
16296
18748
  0, /*nb_invert*/
16297
18749
  0, /*nb_lshift*/
16298
18750
  0, /*nb_rshift*/
16303
18755
  0, /*nb_coerce*/
16304
18756
  #endif
16305
18757
  0, /*nb_int*/
16306
 
  #if PY_MAJOR_VERSION >= 3
 
18758
  #if PY_MAJOR_VERSION < 3
 
18759
  0, /*nb_long*/
 
18760
  #else
16307
18761
  0, /*reserved*/
16308
 
  #else
16309
 
  0, /*nb_long*/
16310
18762
  #endif
16311
18763
  0, /*nb_float*/
16312
18764
  #if PY_MAJOR_VERSION < 3
16332
18784
  0, /*nb_true_divide*/
16333
18785
  0, /*nb_inplace_floor_divide*/
16334
18786
  0, /*nb_inplace_true_divide*/
16335
 
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
 
18787
  #if PY_VERSION_HEX >= 0x02050000
16336
18788
  0, /*nb_index*/
16337
18789
  #endif
16338
18790
};
16377
18829
  #endif
16378
18830
};
16379
18831
 
16380
 
PyTypeObject __pyx_type_6gevent_4core_http = {
 
18832
static PyTypeObject __pyx_type_6gevent_4core_http = {
16381
18833
  PyVarObject_HEAD_INIT(0, 0)
16382
18834
  __Pyx_NAMESTR("gevent.core.http"), /*tp_name*/
16383
18835
  sizeof(struct __pyx_obj_6gevent_4core_http), /*tp_basicsize*/
16386
18838
  0, /*tp_print*/
16387
18839
  0, /*tp_getattr*/
16388
18840
  0, /*tp_setattr*/
 
18841
  #if PY_MAJOR_VERSION < 3
16389
18842
  0, /*tp_compare*/
 
18843
  #else
 
18844
  0, /*reserved*/
 
18845
  #endif
16390
18846
  0, /*tp_repr*/
16391
18847
  &__pyx_tp_as_number_http, /*tp_as_number*/
16392
18848
  &__pyx_tp_as_sequence_http, /*tp_as_sequence*/
16397
18853
  0, /*tp_getattro*/
16398
18854
  0, /*tp_setattro*/
16399
18855
  &__pyx_tp_as_buffer_http, /*tp_as_buffer*/
16400
 
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
 
18856
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
16401
18857
  0, /*tp_doc*/
16402
18858
  __pyx_tp_traverse_6gevent_4core_http, /*tp_traverse*/
16403
18859
  __pyx_tp_clear_6gevent_4core_http, /*tp_clear*/
16406
18862
  0, /*tp_iter*/
16407
18863
  0, /*tp_iternext*/
16408
18864
  __pyx_methods_6gevent_4core_http, /*tp_methods*/
16409
 
  __pyx_members_6gevent_4core_http, /*tp_members*/
 
18865
  0, /*tp_members*/
16410
18866
  __pyx_getsets_6gevent_4core_http, /*tp_getset*/
16411
18867
  0, /*tp_base*/
16412
18868
  0, /*tp_dict*/
16429
18885
  #endif
16430
18886
};
16431
18887
 
16432
 
static struct PyMethodDef __pyx_methods[] = {
16433
 
  {__Pyx_NAMESTR("init"), (PyCFunction)__pyx_pf_6gevent_4core_init, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_init)},
16434
 
  {__Pyx_NAMESTR("dispatch"), (PyCFunction)__pyx_pf_6gevent_4core_dispatch, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_dispatch)},
16435
 
  {__Pyx_NAMESTR("loop"), (PyCFunction)__pyx_pf_6gevent_4core_loop, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_loop)},
16436
 
  {__Pyx_NAMESTR("get_version"), (PyCFunction)__pyx_pf_6gevent_4core_get_version, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_get_version)},
16437
 
  {__Pyx_NAMESTR("get_method"), (PyCFunction)__pyx_pf_6gevent_4core_get_method, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_get_method)},
16438
 
  {__Pyx_NAMESTR("get_header_version"), (PyCFunction)__pyx_pf_6gevent_4core_get_header_version, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_get_header_version)},
16439
 
  {__Pyx_NAMESTR("reinit"), (PyCFunction)__pyx_pf_6gevent_4core_reinit, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_reinit)},
16440
 
  {__Pyx_NAMESTR("dns_init"), (PyCFunction)__pyx_pf_6gevent_4core_dns_init, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_dns_init)},
16441
 
  {__Pyx_NAMESTR("dns_shutdown"), (PyCFunction)__pyx_pf_6gevent_4core_dns_shutdown, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_dns_shutdown)},
16442
 
  {__Pyx_NAMESTR("dns_err_to_string"), (PyCFunction)__pyx_pf_6gevent_4core_dns_err_to_string, METH_O, __Pyx_DOCSTR(0)},
16443
 
  {__Pyx_NAMESTR("dns_resolve_ipv4"), (PyCFunction)__pyx_pf_6gevent_4core_dns_resolve_ipv4, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_dns_resolve_ipv4)},
16444
 
  {__Pyx_NAMESTR("dns_resolve_ipv6"), (PyCFunction)__pyx_pf_6gevent_4core_dns_resolve_ipv6, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_dns_resolve_ipv6)},
16445
 
  {__Pyx_NAMESTR("dns_resolve_reverse"), (PyCFunction)__pyx_pf_6gevent_4core_dns_resolve_reverse, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_dns_resolve_reverse)},
16446
 
  {__Pyx_NAMESTR("dns_resolve_reverse_ipv6"), (PyCFunction)__pyx_pf_6gevent_4core_dns_resolve_reverse_ipv6, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6gevent_4core_dns_resolve_reverse_ipv6)},
16447
 
  {__Pyx_NAMESTR("set_exc_info"), (PyCFunction)__pyx_pf_6gevent_4core_set_exc_info, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
 
18888
static PyMethodDef __pyx_methods[] = {
16448
18889
  {0, 0, 0, 0}
16449
18890
};
16450
18891
 
16451
 
static void __pyx_init_filenames(void); /*proto*/
16452
 
 
16453
18892
#if PY_MAJOR_VERSION >= 3
16454
18893
static struct PyModuleDef __pyx_moduledef = {
16455
18894
    PyModuleDef_HEAD_INIT,
16456
18895
    __Pyx_NAMESTR("core"),
16457
 
    __Pyx_DOCSTR(__pyx_k_45), /* m_doc */
 
18896
    __Pyx_DOCSTR(__pyx_k_53), /* m_doc */
16458
18897
    -1, /* m_size */
16459
18898
    __pyx_methods /* m_methods */,
16460
18899
    NULL, /* m_reload */
16474
18913
  {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0},
16475
18914
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
16476
18915
  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
16477
 
  {&__pyx_n_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 1},
 
18916
  {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
16478
18917
  {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
16479
18918
  {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0},
16480
18919
  {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0},
16482
18921
  {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0},
16483
18922
  {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
16484
18923
  {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
16485
 
  {&__pyx_n_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 1},
 
18924
  {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
16486
18925
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
16487
 
  {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
16488
 
  {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0},
16489
18926
  {&__pyx_n_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 1},
16490
 
  {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0},
16491
 
  {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0},
 
18927
  {&__pyx_n_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 1},
 
18928
  {&__pyx_kp_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 0},
 
18929
  {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0},
 
18930
  {&__pyx_n_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 1},
 
18931
  {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
16492
18932
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
16493
18933
  {&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0},
16494
 
  {&__pyx_kp_s_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 0, 1, 0},
16495
 
  {&__pyx_kp_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 0},
16496
 
  {&__pyx_kp_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 0},
16497
 
  {&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0},
16498
 
  {&__pyx_kp_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 0},
 
18934
  {&__pyx_kp_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0},
 
18935
  {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0},
16499
18936
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
16500
18937
  {&__pyx_kp_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 0},
16501
18938
  {&__pyx_kp_s_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 1, 0},
16502
 
  {&__pyx_kp_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 0},
16503
 
  {&__pyx_n_s_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 1, 1},
16504
 
  {&__pyx_n_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 1},
 
18939
  {&__pyx_kp_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 0},
16505
18940
  {&__pyx_kp_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 0},
16506
 
  {&__pyx_kp_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 0},
16507
18941
  {&__pyx_kp_s_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 1, 0},
16508
18942
  {&__pyx_kp_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 0},
16509
 
  {&__pyx_kp_u_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 1, 0, 0},
16510
18943
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
16511
 
  {&__pyx_kp_u_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 1, 0, 0},
16512
 
  {&__pyx_kp_u_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 1, 0, 0},
16513
 
  {&__pyx_kp_u_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 1, 0, 0},
16514
 
  {&__pyx_kp_u_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 1, 0, 0},
16515
 
  {&__pyx_kp_u_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 1, 0, 0},
16516
 
  {&__pyx_kp_u_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 1, 0, 0},
16517
 
  {&__pyx_kp_u_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 1, 0, 0},
16518
 
  {&__pyx_kp_u_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 1, 0, 0},
16519
 
  {&__pyx_kp_u_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 1, 0, 0},
16520
 
  {&__pyx_kp_u_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 1, 0, 0},
 
18944
  {&__pyx_kp_s_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 1, 0},
 
18945
  {&__pyx_kp_s_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 0, 1, 0},
 
18946
  {&__pyx_n_s_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 0, 1, 1},
 
18947
  {&__pyx_kp_s_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 0, 1, 0},
 
18948
  {&__pyx_n_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 1},
 
18949
  {&__pyx_n_s_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 0, 1, 1},
 
18950
  {&__pyx_kp_s_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 1, 0},
 
18951
  {&__pyx_kp_s_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 0, 1, 0},
 
18952
  {&__pyx_kp_s_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 0, 1, 0},
 
18953
  {&__pyx_kp_s_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 1, 0},
16521
18954
  {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0},
16522
 
  {&__pyx_kp_u_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 1, 0, 0},
16523
 
  {&__pyx_kp_u_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 1, 0, 0},
16524
 
  {&__pyx_kp_u_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 1, 0, 0},
16525
 
  {&__pyx_kp_u_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 1, 0, 0},
16526
 
  {&__pyx_kp_u_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 1, 0, 0},
16527
 
  {&__pyx_kp_u_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 1, 0, 0},
16528
 
  {&__pyx_kp_u_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 1, 0, 0},
16529
 
  {&__pyx_n_s_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 1, 1},
16530
18955
  {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
16531
18956
  {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
16532
18957
  {&__pyx_n_s__ACTIVE, __pyx_k__ACTIVE, sizeof(__pyx_k__ACTIVE), 0, 0, 1, 1},
16533
18958
  {&__pyx_n_s__AttributeError, __pyx_k__AttributeError, sizeof(__pyx_k__AttributeError), 0, 0, 1, 1},
16534
18959
  {&__pyx_n_s__BSD, __pyx_k__BSD, sizeof(__pyx_k__BSD), 0, 0, 1, 1},
 
18960
  {&__pyx_n_s__CONNECT, __pyx_k__CONNECT, sizeof(__pyx_k__CONNECT), 0, 0, 1, 1},
16535
18961
  {&__pyx_n_s__DELETE, __pyx_k__DELETE, sizeof(__pyx_k__DELETE), 0, 0, 1, 1},
16536
18962
  {&__pyx_n_s__DNS_ERR_FORMAT, __pyx_k__DNS_ERR_FORMAT, sizeof(__pyx_k__DNS_ERR_FORMAT), 0, 0, 1, 1},
16537
18963
  {&__pyx_n_s__DNS_ERR_NONE, __pyx_k__DNS_ERR_NONE, sizeof(__pyx_k__DNS_ERR_NONE), 0, 0, 1, 1},
16548
18974
  {&__pyx_n_s__DNS_QUERY_NO_SEARCH, __pyx_k__DNS_QUERY_NO_SEARCH, sizeof(__pyx_k__DNS_QUERY_NO_SEARCH), 0, 0, 1, 1},
16549
18975
  {&__pyx_n_s__DeprecationWarning, __pyx_k__DeprecationWarning, sizeof(__pyx_k__DeprecationWarning), 0, 0, 1, 1},
16550
18976
  {&__pyx_n_s__EVHTTP_REQUEST, __pyx_k__EVHTTP_REQUEST, sizeof(__pyx_k__EVHTTP_REQUEST), 0, 0, 1, 1},
 
18977
  {&__pyx_n_s__EVHTTP_REQ_CONNECT, __pyx_k__EVHTTP_REQ_CONNECT, sizeof(__pyx_k__EVHTTP_REQ_CONNECT), 0, 0, 1, 1},
16551
18978
  {&__pyx_n_s__EVHTTP_REQ_DELETE, __pyx_k__EVHTTP_REQ_DELETE, sizeof(__pyx_k__EVHTTP_REQ_DELETE), 0, 0, 1, 1},
16552
18979
  {&__pyx_n_s__EVHTTP_REQ_GET, __pyx_k__EVHTTP_REQ_GET, sizeof(__pyx_k__EVHTTP_REQ_GET), 0, 0, 1, 1},
16553
18980
  {&__pyx_n_s__EVHTTP_REQ_HEAD, __pyx_k__EVHTTP_REQ_HEAD, sizeof(__pyx_k__EVHTTP_REQ_HEAD), 0, 0, 1, 1},
 
18981
  {&__pyx_n_s__EVHTTP_REQ_OPTIONS, __pyx_k__EVHTTP_REQ_OPTIONS, sizeof(__pyx_k__EVHTTP_REQ_OPTIONS), 0, 0, 1, 1},
 
18982
  {&__pyx_n_s__EVHTTP_REQ_PATCH, __pyx_k__EVHTTP_REQ_PATCH, sizeof(__pyx_k__EVHTTP_REQ_PATCH), 0, 0, 1, 1},
16554
18983
  {&__pyx_n_s__EVHTTP_REQ_POST, __pyx_k__EVHTTP_REQ_POST, sizeof(__pyx_k__EVHTTP_REQ_POST), 0, 0, 1, 1},
16555
18984
  {&__pyx_n_s__EVHTTP_REQ_PUT, __pyx_k__EVHTTP_REQ_PUT, sizeof(__pyx_k__EVHTTP_REQ_PUT), 0, 0, 1, 1},
 
18985
  {&__pyx_n_s__EVHTTP_REQ_TRACE, __pyx_k__EVHTTP_REQ_TRACE, sizeof(__pyx_k__EVHTTP_REQ_TRACE), 0, 0, 1, 1},
16556
18986
  {&__pyx_n_s__EVHTTP_RESPONSE, __pyx_k__EVHTTP_RESPONSE, sizeof(__pyx_k__EVHTTP_RESPONSE), 0, 0, 1, 1},
16557
18987
  {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1},
16558
18988
  {&__pyx_n_s__GET, __pyx_k__GET, sizeof(__pyx_k__GET), 0, 0, 1, 1},
16564
18994
  {&__pyx_n_s__INTERNAL, __pyx_k__INTERNAL, sizeof(__pyx_k__INTERNAL), 0, 0, 1, 1},
16565
18995
  {&__pyx_n_s__IOError, __pyx_k__IOError, sizeof(__pyx_k__IOError), 0, 0, 1, 1},
16566
18996
  {&__pyx_n_s__NotImplementedError, __pyx_k__NotImplementedError, sizeof(__pyx_k__NotImplementedError), 0, 0, 1, 1},
 
18997
  {&__pyx_n_s__OPTIONS, __pyx_k__OPTIONS, sizeof(__pyx_k__OPTIONS), 0, 0, 1, 1},
16567
18998
  {&__pyx_n_s__ObjectDeleted, __pyx_k__ObjectDeleted, sizeof(__pyx_k__ObjectDeleted), 0, 0, 1, 1},
 
18999
  {&__pyx_n_s__PATCH, __pyx_k__PATCH, sizeof(__pyx_k__PATCH), 0, 0, 1, 1},
16568
19000
  {&__pyx_n_s__PERSIST, __pyx_k__PERSIST, sizeof(__pyx_k__PERSIST), 0, 0, 1, 1},
16569
19001
  {&__pyx_n_s__POST, __pyx_k__POST, sizeof(__pyx_k__POST), 0, 0, 1, 1},
16570
19002
  {&__pyx_n_s__PUT, __pyx_k__PUT, sizeof(__pyx_k__PUT), 0, 0, 1, 1},
16573
19005
  {&__pyx_n_s__SIGNAL, __pyx_k__SIGNAL, sizeof(__pyx_k__SIGNAL), 0, 0, 1, 1},
16574
19006
  {&__pyx_n_s__StopIteration, __pyx_k__StopIteration, sizeof(__pyx_k__StopIteration), 0, 0, 1, 1},
16575
19007
  {&__pyx_n_s__TIMEOUT, __pyx_k__TIMEOUT, sizeof(__pyx_k__TIMEOUT), 0, 0, 1, 1},
 
19008
  {&__pyx_n_s__TRACE, __pyx_k__TRACE, sizeof(__pyx_k__TRACE), 0, 0, 1, 1},
16576
19009
  {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
16577
19010
  {&__pyx_n_s__UserWarning, __pyx_k__UserWarning, sizeof(__pyx_k__UserWarning), 0, 0, 1, 1},
16578
19011
  {&__pyx_n_s__WRITE, __pyx_k__WRITE, sizeof(__pyx_k__WRITE), 0, 0, 1, 1},
16590
19023
  {&__pyx_n_s____url__, __pyx_k____url__, sizeof(__pyx_k____url__), 0, 0, 1, 1},
16591
19024
  {&__pyx_n_s____version__, __pyx_k____version__, sizeof(__pyx_k____version__), 0, 0, 1, 1},
16592
19025
  {&__pyx_n_s___addref, __pyx_k___addref, sizeof(__pyx_k___addref), 0, 0, 1, 1},
16593
 
  {&__pyx_n_s___arg, __pyx_k___arg, sizeof(__pyx_k___arg), 0, 0, 1, 1},
16594
 
  {&__pyx_n_s___callback, __pyx_k___callback, sizeof(__pyx_k___callback), 0, 0, 1, 1},
16595
19026
  {&__pyx_n_s___delref, __pyx_k___delref, sizeof(__pyx_k___delref), 0, 0, 1, 1},
16596
19027
  {&__pyx_n_s___format, __pyx_k___format, sizeof(__pyx_k___format), 0, 0, 1, 1},
16597
19028
  {&__pyx_n_s___incref, __pyx_k___incref, sizeof(__pyx_k___incref), 0, 0, 1, 1},
16598
19029
  {&__pyx_n_s___input_buffer, __pyx_k___input_buffer, sizeof(__pyx_k___input_buffer), 0, 0, 1, 1},
16599
19030
  {&__pyx_n_s___obj, __pyx_k___obj, sizeof(__pyx_k___obj), 0, 0, 1, 1},
16600
19031
  {&__pyx_n_s___output_buffer, __pyx_k___output_buffer, sizeof(__pyx_k___output_buffer), 0, 0, 1, 1},
 
19032
  {&__pyx_n_s___owned, __pyx_k___owned, sizeof(__pyx_k___owned), 0, 0, 1, 1},
16601
19033
  {&__pyx_n_s___requests, __pyx_k___requests, sizeof(__pyx_k___requests), 0, 0, 1, 1},
16602
19034
  {&__pyx_n_s__active_event, __pyx_k__active_event, sizeof(__pyx_k__active_event), 0, 0, 1, 1},
16603
19035
  {&__pyx_n_s__add, __pyx_k__add, sizeof(__pyx_k__add), 0, 0, 1, 1},
16604
19036
  {&__pyx_n_s__add_output_header, __pyx_k__add_output_header, sizeof(__pyx_k__add_output_header), 0, 0, 1, 1},
16605
19037
  {&__pyx_n_s__address, __pyx_k__address, sizeof(__pyx_k__address), 0, 0, 1, 1},
 
19038
  {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1},
16606
19039
  {&__pyx_n_s__arg, __pyx_k__arg, sizeof(__pyx_k__arg), 0, 0, 1, 1},
16607
19040
  {&__pyx_n_s__buf, __pyx_k__buf, sizeof(__pyx_k__buf), 0, 0, 1, 1},
16608
19041
  {&__pyx_n_s__buffer, __pyx_k__buffer, sizeof(__pyx_k__buffer), 0, 0, 1, 1},
16656
19089
  {&__pyx_n_s__keys, __pyx_k__keys, sizeof(__pyx_k__keys), 0, 0, 1, 1},
16657
19090
  {&__pyx_n_s__kind, __pyx_k__kind, sizeof(__pyx_k__kind), 0, 0, 1, 1},
16658
19091
  {&__pyx_n_s__loop, __pyx_k__loop, sizeof(__pyx_k__loop), 0, 0, 1, 1},
 
19092
  {&__pyx_n_s__lower, __pyx_k__lower, sizeof(__pyx_k__lower), 0, 0, 1, 1},
16659
19093
  {&__pyx_n_s__major, __pyx_k__major, sizeof(__pyx_k__major), 0, 0, 1, 1},
16660
 
  {&__pyx_n_s__min, __pyx_k__min, sizeof(__pyx_k__min), 0, 0, 1, 1},
16661
19094
  {&__pyx_n_s__minor, __pyx_k__minor, sizeof(__pyx_k__minor), 0, 0, 1, 1},
16662
19095
  {&__pyx_n_s__msg, __pyx_k__msg, sizeof(__pyx_k__msg), 0, 0, 1, 1},
16663
19096
  {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1},
 
19097
  {&__pyx_n_s__new, __pyx_k__new, sizeof(__pyx_k__new), 0, 0, 1, 1},
16664
19098
  {&__pyx_n_s__nonblock, __pyx_k__nonblock, sizeof(__pyx_k__nonblock), 0, 0, 1, 1},
 
19099
  {&__pyx_n_s__obj, __pyx_k__obj, sizeof(__pyx_k__obj), 0, 0, 1, 1},
16665
19100
  {&__pyx_n_s__output_buffer, __pyx_k__output_buffer, sizeof(__pyx_k__output_buffer), 0, 0, 1, 1},
16666
19101
  {&__pyx_n_s__output_headers, __pyx_k__output_headers, sizeof(__pyx_k__output_headers), 0, 0, 1, 1},
 
19102
  {&__pyx_n_s__owned, __pyx_k__owned, sizeof(__pyx_k__owned), 0, 0, 1, 1},
16667
19103
  {&__pyx_n_s__packed_ip, __pyx_k__packed_ip, sizeof(__pyx_k__packed_ip), 0, 0, 1, 1},
16668
19104
  {&__pyx_n_s__peer, __pyx_k__peer, sizeof(__pyx_k__peer), 0, 0, 1, 1},
16669
19105
  {&__pyx_n_s__pending, __pyx_k__pending, sizeof(__pyx_k__pending), 0, 0, 1, 1},
16673
19109
  {&__pyx_n_s__port, __pyx_k__port, sizeof(__pyx_k__port), 0, 0, 1, 1},
16674
19110
  {&__pyx_n_s__pprint, __pyx_k__pprint, sizeof(__pyx_k__pprint), 0, 0, 1, 1},
16675
19111
  {&__pyx_n_s__print_exc, __pyx_k__print_exc, sizeof(__pyx_k__print_exc), 0, 0, 1, 1},
16676
 
  {&__pyx_n_s__read, __pyx_k__read, sizeof(__pyx_k__read), 0, 0, 1, 1},
16677
19112
  {&__pyx_n_s__read_event, __pyx_k__read_event, sizeof(__pyx_k__read_event), 0, 0, 1, 1},
16678
19113
  {&__pyx_n_s__readline, __pyx_k__readline, sizeof(__pyx_k__readline), 0, 0, 1, 1},
16679
19114
  {&__pyx_n_s__readwrite_event, __pyx_k__readwrite_event, sizeof(__pyx_k__readwrite_event), 0, 0, 1, 1},
16681
19116
  {&__pyx_n_s__reinit, __pyx_k__reinit, sizeof(__pyx_k__reinit), 0, 0, 1, 1},
16682
19117
  {&__pyx_n_s__remote_host, __pyx_k__remote_host, sizeof(__pyx_k__remote_host), 0, 0, 1, 1},
16683
19118
  {&__pyx_n_s__remote_port, __pyx_k__remote_port, sizeof(__pyx_k__remote_port), 0, 0, 1, 1},
16684
 
  {&__pyx_n_s__remove_input_header, __pyx_k__remove_input_header, sizeof(__pyx_k__remove_input_header), 0, 0, 1, 1},
16685
19119
  {&__pyx_n_s__replace, __pyx_k__replace, sizeof(__pyx_k__replace), 0, 0, 1, 1},
 
19120
  {&__pyx_n_s__req, __pyx_k__req, sizeof(__pyx_k__req), 0, 0, 1, 1},
16686
19121
  {&__pyx_n_s__response_code, __pyx_k__response_code, sizeof(__pyx_k__response_code), 0, 0, 1, 1},
16687
19122
  {&__pyx_n_s__response_code_line, __pyx_k__response_code_line, sizeof(__pyx_k__response_code_line), 0, 0, 1, 1},
16688
19123
  {&__pyx_n_s__seconds, __pyx_k__seconds, sizeof(__pyx_k__seconds), 0, 0, 1, 1},
16689
19124
  {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
 
19125
  {&__pyx_n_s__set_exc_info, __pyx_k__set_exc_info, sizeof(__pyx_k__set_exc_info), 0, 0, 1, 1},
16690
19126
  {&__pyx_n_s__signal, __pyx_k__signal, sizeof(__pyx_k__signal), 0, 0, 1, 1},
16691
19127
  {&__pyx_n_s__signalnum, __pyx_k__signalnum, sizeof(__pyx_k__signalnum), 0, 0, 1, 1},
16692
19128
  {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1},
16693
19129
  {&__pyx_n_s__stacklevel, __pyx_k__stacklevel, sizeof(__pyx_k__stacklevel), 0, 0, 1, 1},
16694
19130
  {&__pyx_n_s__stderr, __pyx_k__stderr, sizeof(__pyx_k__stderr), 0, 0, 1, 1},
16695
19131
  {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1},
16696
 
  {&__pyx_n_s__tb, __pyx_k__tb, sizeof(__pyx_k__tb), 0, 0, 1, 1},
16697
19132
  {&__pyx_n_s__timeout, __pyx_k__timeout, sizeof(__pyx_k__timeout), 0, 0, 1, 1},
16698
19133
  {&__pyx_n_s__timer, __pyx_k__timer, sizeof(__pyx_k__timer), 0, 0, 1, 1},
16699
19134
  {&__pyx_n_s__traceback, __pyx_k__traceback, sizeof(__pyx_k__traceback), 0, 0, 1, 1},
16700
19135
  {&__pyx_n_s__tv_sec, __pyx_k__tv_sec, sizeof(__pyx_k__tv_sec), 0, 0, 1, 1},
16701
19136
  {&__pyx_n_s__tv_usec, __pyx_k__tv_usec, sizeof(__pyx_k__tv_usec), 0, 0, 1, 1},
16702
 
  {&__pyx_n_s__typ, __pyx_k__typ, sizeof(__pyx_k__typ), 0, 0, 1, 1},
16703
19137
  {&__pyx_n_s__type, __pyx_k__type, sizeof(__pyx_k__type), 0, 0, 1, 1},
16704
19138
  {&__pyx_n_s__typestr, __pyx_k__typestr, sizeof(__pyx_k__typestr), 0, 0, 1, 1},
16705
19139
  {&__pyx_n_s__uri, __pyx_k__uri, sizeof(__pyx_k__uri), 0, 0, 1, 1},
16712
19146
  {0, 0, 0, 0, 0, 0, 0}
16713
19147
};
16714
19148
static int __Pyx_InitCachedBuiltins(void) {
16715
 
  __pyx_builtin_UserWarning = __Pyx_GetName(__pyx_b, __pyx_n_s__UserWarning); if (!__pyx_builtin_UserWarning) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16716
 
  __pyx_builtin_AttributeError = __Pyx_GetName(__pyx_b, __pyx_n_s__AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16717
 
  __pyx_builtin_hex = __Pyx_GetName(__pyx_b, __pyx_n_s__hex); if (!__pyx_builtin_hex) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16718
 
  __pyx_builtin_DeprecationWarning = __Pyx_GetName(__pyx_b, __pyx_n_s__DeprecationWarning); if (!__pyx_builtin_DeprecationWarning) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16719
 
  __pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_n_s__IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16720
 
  __pyx_builtin_id = __Pyx_GetName(__pyx_b, __pyx_n_s__id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16721
 
  __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19149
  __pyx_builtin_UserWarning = __Pyx_GetName(__pyx_b, __pyx_n_s__UserWarning); if (!__pyx_builtin_UserWarning) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19150
  __pyx_builtin_AttributeError = __Pyx_GetName(__pyx_b, __pyx_n_s__AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19151
  __pyx_builtin_hex = __Pyx_GetName(__pyx_b, __pyx_n_s__hex); if (!__pyx_builtin_hex) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19152
  __pyx_builtin_DeprecationWarning = __Pyx_GetName(__pyx_b, __pyx_n_s__DeprecationWarning); if (!__pyx_builtin_DeprecationWarning) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19153
  __pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_n_s__IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19154
  __pyx_builtin_id = __Pyx_GetName(__pyx_b, __pyx_n_s__id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19155
  __pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_n_s__NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16722
19156
  __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_s__StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16723
 
  __pyx_builtin_min = __Pyx_GetName(__pyx_b, __pyx_n_s__min); if (!__pyx_builtin_min) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16724
 
  __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16725
 
  __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16726
 
  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16727
 
  return 0;
16728
 
  __pyx_L1_error:;
 
19157
  __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19158
  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19159
  __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19160
  return 0;
 
19161
  __pyx_L1_error:;
 
19162
  return -1;
 
19163
}
 
19164
 
 
19165
static int __Pyx_InitCachedConstants(void) {
 
19166
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants");
 
19167
 
 
19168
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":364
 
19169
 *             raise HttpRequestDeleted
 
19170
 *         if evhttp_add_header(self.__obj.input_headers, key, value):
 
19171
 *             raise RuntimeError('Internal error in evhttp_add_header')             # <<<<<<<<<<<<<<
 
19172
 * 
 
19173
 *     def add_output_header(self, char* key, char* value):
 
19174
 */
 
19175
  __pyx_k_tuple_30 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19176
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_30));
 
19177
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
 
19178
  PyTuple_SET_ITEM(__pyx_k_tuple_30, 0, ((PyObject *)__pyx_kp_s_29));
 
19179
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29));
 
19180
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30));
 
19181
 
 
19182
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":370
 
19183
 *             raise HttpRequestDeleted
 
19184
 *         if evhttp_add_header(self.__obj.output_headers, key, value):
 
19185
 *             raise RuntimeError('Internal error in evhttp_add_header')             # <<<<<<<<<<<<<<
 
19186
 * 
 
19187
 *     def remove_input_header(self, char* key):
 
19188
 */
 
19189
  __pyx_k_tuple_31 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19190
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_31));
 
19191
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_29));
 
19192
  PyTuple_SET_ITEM(__pyx_k_tuple_31, 0, ((PyObject *)__pyx_kp_s_29));
 
19193
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_29));
 
19194
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31));
 
19195
 
 
19196
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":482
 
19197
 *             self.__obj = evhttp_request_new(_http_request_cb_handler, <void*>self)
 
19198
 *             if not self.__obj:
 
19199
 *                 raise IOError('evhttp_request_new() failed')             # <<<<<<<<<<<<<<
 
19200
 *             self._owned = 1
 
19201
 *             self._addref()
 
19202
 */
 
19203
  __pyx_k_tuple_37 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19204
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_37));
 
19205
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_36));
 
19206
  PyTuple_SET_ITEM(__pyx_k_tuple_37, 0, ((PyObject *)__pyx_kp_s_36));
 
19207
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_36));
 
19208
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37));
 
19209
 
 
19210
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":597
 
19211
 *             if obj.__obj != c_request:
 
19212
 *                 # sometimes this happens, don't know why
 
19213
 *                 sys.stderr.write("Internal error in evhttp\n")             # <<<<<<<<<<<<<<
 
19214
 *             if obj.callback is not None:
 
19215
 *                 # preferring c_request to obj.__obj because the latter sometimes causes crashes
 
19216
 */
 
19217
  __pyx_k_tuple_41 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19218
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_41));
 
19219
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_40));
 
19220
  PyTuple_SET_ITEM(__pyx_k_tuple_41, 0, ((PyObject *)__pyx_kp_s_40));
 
19221
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_40));
 
19222
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));
 
19223
 
 
19224
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":605
 
19225
 *         traceback.print_exc()
 
19226
 *         try:
 
19227
 *             sys.stderr.write('Failed to execute callback for evhttp request.\n')             # <<<<<<<<<<<<<<
 
19228
 *         except:
 
19229
 *             pass
 
19230
 */
 
19231
  __pyx_k_tuple_43 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_43)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19232
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_43));
 
19233
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_42));
 
19234
  PyTuple_SET_ITEM(__pyx_k_tuple_43, 0, ((PyObject *)__pyx_kp_s_42));
 
19235
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_42));
 
19236
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43));
 
19237
 
 
19238
  /* "gevent/core.pyx":31
 
19239
 * """
 
19240
 * 
 
19241
 * __author__ = ( 'Dug Song <dugsong@monkey.org>',             # <<<<<<<<<<<<<<
 
19242
 *                'Martin Murray <mmurray@monkey.org>' )
 
19243
 * __copyright__ = ( 'Copyright (c) 2004 Dug Song',
 
19244
 */
 
19245
  __pyx_k_tuple_56 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19246
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_56));
 
19247
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_54));
 
19248
  PyTuple_SET_ITEM(__pyx_k_tuple_56, 0, ((PyObject *)__pyx_kp_s_54));
 
19249
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_54));
 
19250
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_55));
 
19251
  PyTuple_SET_ITEM(__pyx_k_tuple_56, 1, ((PyObject *)__pyx_kp_s_55));
 
19252
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_55));
 
19253
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56));
 
19254
 
 
19255
  /* "gevent/core.pyx":33
 
19256
 * __author__ = ( 'Dug Song <dugsong@monkey.org>',
 
19257
 *                'Martin Murray <mmurray@monkey.org>' )
 
19258
 * __copyright__ = ( 'Copyright (c) 2004 Dug Song',             # <<<<<<<<<<<<<<
 
19259
 *                   'Copyright (c) 2003 Martin Murray' )
 
19260
 * __license__ = 'BSD'
 
19261
 */
 
19262
  __pyx_k_tuple_59 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19263
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_59));
 
19264
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_57));
 
19265
  PyTuple_SET_ITEM(__pyx_k_tuple_59, 0, ((PyObject *)__pyx_kp_s_57));
 
19266
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_57));
 
19267
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_58));
 
19268
  PyTuple_SET_ITEM(__pyx_k_tuple_59, 1, ((PyObject *)__pyx_kp_s_58));
 
19269
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_58));
 
19270
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59));
 
19271
  __Pyx_RefNannyFinishContext();
 
19272
  return 0;
 
19273
  __pyx_L1_error:;
 
19274
  __Pyx_RefNannyFinishContext();
16729
19275
  return -1;
16730
19276
}
16731
19277
 
16739
19285
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
16740
19286
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
16741
19287
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
19288
  __pyx_int_16 = PyInt_FromLong(16); if (unlikely(!__pyx_int_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
19289
  __pyx_int_32 = PyInt_FromLong(32); if (unlikely(!__pyx_int_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
19290
  __pyx_int_64 = PyInt_FromLong(64); if (unlikely(!__pyx_int_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
16742
19291
  __pyx_int_65 = PyInt_FromLong(65); if (unlikely(!__pyx_int_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
16743
19292
  __pyx_int_66 = PyInt_FromLong(66); if (unlikely(!__pyx_int_66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
16744
19293
  __pyx_int_67 = PyInt_FromLong(67); if (unlikely(!__pyx_int_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
16745
19294
  __pyx_int_68 = PyInt_FromLong(68); if (unlikely(!__pyx_int_68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
19295
  __pyx_int_128 = PyInt_FromLong(128); if (unlikely(!__pyx_int_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
19296
  __pyx_int_256 = PyInt_FromLong(256); if (unlikely(!__pyx_int_256)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
16746
19297
  return 0;
16747
19298
  __pyx_L1_error:;
16748
19299
  return -1;
16759
19310
  PyObject *__pyx_t_1 = NULL;
16760
19311
  PyObject *__pyx_t_2 = NULL;
16761
19312
  PyObject *__pyx_t_3 = NULL;
16762
 
  PyObject *__pyx_t_4 = NULL;
 
19313
  int __pyx_t_4;
16763
19314
  int __pyx_t_5;
16764
19315
  int __pyx_t_6;
16765
19316
  int __pyx_t_7;
16766
 
  int __pyx_t_8;
 
19317
  PyObject *__pyx_t_8 = NULL;
16767
19318
  #if CYTHON_REFNANNY
16768
19319
  void* __pyx_refnanny = NULL;
16769
19320
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
16775
19326
  }
16776
19327
  __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_core(void)", __LINE__, __FILE__);
16777
19328
  #endif
16778
 
  __pyx_init_filenames();
16779
19329
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16780
 
  #if PY_MAJOR_VERSION < 3
16781
 
  __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16782
 
  #else
16783
19330
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19331
  #ifdef __pyx_binding_PyCFunctionType_USED
 
19332
  if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16784
19333
  #endif
16785
19334
  /*--- Library function declarations ---*/
16786
19335
  /*--- Threads initialization code ---*/
16791
19340
  #endif
16792
19341
  /*--- Module creation code ---*/
16793
19342
  #if PY_MAJOR_VERSION < 3
16794
 
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("core"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_45), 0, PYTHON_API_VERSION);
 
19343
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("core"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_53), 0, PYTHON_API_VERSION);
16795
19344
  #else
16796
19345
  __pyx_m = PyModule_Create(&__pyx_moduledef);
16797
19346
  #endif
16809
19358
  }
16810
19359
  /*--- Builtin init code ---*/
16811
19360
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19361
  /*--- Constants init code ---*/
 
19362
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16812
19363
  /*--- Global init code ---*/
16813
19364
  /*--- Function export code ---*/
16814
19365
  /*--- Type init code ---*/
16815
19366
  __pyx_vtabptr_6gevent_4core_event = &__pyx_vtable_6gevent_4core_event;
16816
 
  #if PY_MAJOR_VERSION >= 3
16817
19367
  __pyx_vtable_6gevent_4core_event._addref = (PyObject *(*)(struct __pyx_obj_6gevent_4core_event *))__pyx_f_6gevent_4core_5event__addref;
16818
19368
  __pyx_vtable_6gevent_4core_event._delref = (PyObject *(*)(struct __pyx_obj_6gevent_4core_event *))__pyx_f_6gevent_4core_5event__delref;
16819
 
  #else
16820
 
  *(void(**)(void))&__pyx_vtable_6gevent_4core_event._addref = (void(*)(void))__pyx_f_6gevent_4core_5event__addref;
16821
 
  *(void(**)(void))&__pyx_vtable_6gevent_4core_event._delref = (void(*)(void))__pyx_f_6gevent_4core_5event__delref;
16822
 
  #endif
16823
 
  if (PyType_Ready(&__pyx_type_6gevent_4core_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16824
 
  if (__Pyx_SetVtable(__pyx_type_6gevent_4core_event.tp_dict, __pyx_vtabptr_6gevent_4core_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16825
 
  if (__Pyx_SetAttrString(__pyx_m, "event", (PyObject *)&__pyx_type_6gevent_4core_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19369
  if (PyType_Ready(&__pyx_type_6gevent_4core_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19370
  if (__Pyx_SetVtable(__pyx_type_6gevent_4core_event.tp_dict, __pyx_vtabptr_6gevent_4core_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19371
  if (__Pyx_SetAttrString(__pyx_m, "event", (PyObject *)&__pyx_type_6gevent_4core_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16826
19372
  __pyx_ptype_6gevent_4core_event = &__pyx_type_6gevent_4core_event;
16827
19373
  __pyx_vtabptr_6gevent_4core_read_event = &__pyx_vtable_6gevent_4core_read_event;
16828
19374
  __pyx_vtable_6gevent_4core_read_event.__pyx_base = *__pyx_vtabptr_6gevent_4core_event;
16829
19375
  __pyx_type_6gevent_4core_read_event.tp_base = __pyx_ptype_6gevent_4core_event;
16830
 
  if (PyType_Ready(&__pyx_type_6gevent_4core_read_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16831
 
  if (__Pyx_SetVtable(__pyx_type_6gevent_4core_read_event.tp_dict, __pyx_vtabptr_6gevent_4core_read_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16832
 
  if (__Pyx_SetAttrString(__pyx_m, "read_event", (PyObject *)&__pyx_type_6gevent_4core_read_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19376
  if (PyType_Ready(&__pyx_type_6gevent_4core_read_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19377
  if (__Pyx_SetVtable(__pyx_type_6gevent_4core_read_event.tp_dict, __pyx_vtabptr_6gevent_4core_read_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19378
  if (__Pyx_SetAttrString(__pyx_m, "read_event", (PyObject *)&__pyx_type_6gevent_4core_read_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16833
19379
  __pyx_ptype_6gevent_4core_read_event = &__pyx_type_6gevent_4core_read_event;
16834
19380
  __pyx_vtabptr_6gevent_4core_write_event = &__pyx_vtable_6gevent_4core_write_event;
16835
19381
  __pyx_vtable_6gevent_4core_write_event.__pyx_base = *__pyx_vtabptr_6gevent_4core_event;
16836
19382
  __pyx_type_6gevent_4core_write_event.tp_base = __pyx_ptype_6gevent_4core_event;
16837
 
  if (PyType_Ready(&__pyx_type_6gevent_4core_write_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16838
 
  if (__Pyx_SetVtable(__pyx_type_6gevent_4core_write_event.tp_dict, __pyx_vtabptr_6gevent_4core_write_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16839
 
  if (__Pyx_SetAttrString(__pyx_m, "write_event", (PyObject *)&__pyx_type_6gevent_4core_write_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19383
  if (PyType_Ready(&__pyx_type_6gevent_4core_write_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19384
  if (__Pyx_SetVtable(__pyx_type_6gevent_4core_write_event.tp_dict, __pyx_vtabptr_6gevent_4core_write_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19385
  if (__Pyx_SetAttrString(__pyx_m, "write_event", (PyObject *)&__pyx_type_6gevent_4core_write_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16840
19386
  __pyx_ptype_6gevent_4core_write_event = &__pyx_type_6gevent_4core_write_event;
16841
19387
  __pyx_vtabptr_6gevent_4core_timer = &__pyx_vtable_6gevent_4core_timer;
16842
19388
  __pyx_vtable_6gevent_4core_timer.__pyx_base = *__pyx_vtabptr_6gevent_4core_event;
16843
19389
  __pyx_type_6gevent_4core_timer.tp_base = __pyx_ptype_6gevent_4core_event;
16844
 
  if (PyType_Ready(&__pyx_type_6gevent_4core_timer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16845
 
  if (__Pyx_SetVtable(__pyx_type_6gevent_4core_timer.tp_dict, __pyx_vtabptr_6gevent_4core_timer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16846
 
  if (__Pyx_SetAttrString(__pyx_m, "timer", (PyObject *)&__pyx_type_6gevent_4core_timer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19390
  if (PyType_Ready(&__pyx_type_6gevent_4core_timer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19391
  if (__Pyx_SetVtable(__pyx_type_6gevent_4core_timer.tp_dict, __pyx_vtabptr_6gevent_4core_timer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19392
  if (__Pyx_SetAttrString(__pyx_m, "timer", (PyObject *)&__pyx_type_6gevent_4core_timer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16847
19393
  __pyx_ptype_6gevent_4core_timer = &__pyx_type_6gevent_4core_timer;
16848
19394
  __pyx_vtabptr_6gevent_4core_signal = &__pyx_vtable_6gevent_4core_signal;
16849
19395
  __pyx_vtable_6gevent_4core_signal.__pyx_base = *__pyx_vtabptr_6gevent_4core_event;
16850
19396
  __pyx_type_6gevent_4core_signal.tp_base = __pyx_ptype_6gevent_4core_event;
16851
 
  if (PyType_Ready(&__pyx_type_6gevent_4core_signal) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16852
 
  if (__Pyx_SetVtable(__pyx_type_6gevent_4core_signal.tp_dict, __pyx_vtabptr_6gevent_4core_signal) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16853
 
  if (__Pyx_SetAttrString(__pyx_m, "signal", (PyObject *)&__pyx_type_6gevent_4core_signal) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19397
  if (PyType_Ready(&__pyx_type_6gevent_4core_signal) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19398
  if (__Pyx_SetVtable(__pyx_type_6gevent_4core_signal.tp_dict, __pyx_vtabptr_6gevent_4core_signal) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19399
  if (__Pyx_SetAttrString(__pyx_m, "signal", (PyObject *)&__pyx_type_6gevent_4core_signal) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16854
19400
  __pyx_ptype_6gevent_4core_signal = &__pyx_type_6gevent_4core_signal;
16855
19401
  __pyx_vtabptr_6gevent_4core_active_event = &__pyx_vtable_6gevent_4core_active_event;
16856
19402
  __pyx_vtable_6gevent_4core_active_event.__pyx_base = *__pyx_vtabptr_6gevent_4core_event;
16857
19403
  __pyx_type_6gevent_4core_active_event.tp_base = __pyx_ptype_6gevent_4core_event;
16858
 
  if (PyType_Ready(&__pyx_type_6gevent_4core_active_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16859
 
  if (__Pyx_SetVtable(__pyx_type_6gevent_4core_active_event.tp_dict, __pyx_vtabptr_6gevent_4core_active_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16860
 
  if (__Pyx_SetAttrString(__pyx_m, "active_event", (PyObject *)&__pyx_type_6gevent_4core_active_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19404
  if (PyType_Ready(&__pyx_type_6gevent_4core_active_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19405
  if (__Pyx_SetVtable(__pyx_type_6gevent_4core_active_event.tp_dict, __pyx_vtabptr_6gevent_4core_active_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19406
  if (__Pyx_SetAttrString(__pyx_m, "active_event", (PyObject *)&__pyx_type_6gevent_4core_active_event) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16861
19407
  __pyx_ptype_6gevent_4core_active_event = &__pyx_type_6gevent_4core_active_event;
16862
19408
  if (PyType_Ready(&__pyx_type_6gevent_4core_buffer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16863
19409
  if (__Pyx_SetAttrString(__pyx_m, "buffer", (PyObject *)&__pyx_type_6gevent_4core_buffer) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16864
19410
  __pyx_ptype_6gevent_4core_buffer = &__pyx_type_6gevent_4core_buffer;
16865
 
  if (PyType_Ready(&__pyx_type_6gevent_4core_http_request) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16866
 
  if (__Pyx_SetAttrString(__pyx_m, "http_request", (PyObject *)&__pyx_type_6gevent_4core_http_request) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16867
 
  if (__pyx_type_6gevent_4core_http_request.tp_weaklistoffset == 0) __pyx_type_6gevent_4core_http_request.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_4core_http_request, __weakref__);
 
19411
  if (PyType_Ready(&__pyx_type_6gevent_4core_http_request_base) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19412
  if (__Pyx_SetAttrString(__pyx_m, "http_request_base", (PyObject *)&__pyx_type_6gevent_4core_http_request_base) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19413
  if (__pyx_type_6gevent_4core_http_request_base.tp_weaklistoffset == 0) __pyx_type_6gevent_4core_http_request_base.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_4core_http_request_base, __weakref__);
 
19414
  __pyx_ptype_6gevent_4core_http_request_base = &__pyx_type_6gevent_4core_http_request_base;
 
19415
  __pyx_type_6gevent_4core_http_request.tp_base = __pyx_ptype_6gevent_4core_http_request_base;
 
19416
  if (PyType_Ready(&__pyx_type_6gevent_4core_http_request) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19417
  if (__Pyx_SetAttrString(__pyx_m, "http_request", (PyObject *)&__pyx_type_6gevent_4core_http_request) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19418
  if (__pyx_type_6gevent_4core_http_request.tp_weaklistoffset == 0) __pyx_type_6gevent_4core_http_request.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_4core_http_request, __pyx_base.__weakref__);
16868
19419
  __pyx_ptype_6gevent_4core_http_request = &__pyx_type_6gevent_4core_http_request;
16869
 
  if (PyType_Ready(&__pyx_type_6gevent_4core_http_connection) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16870
 
  if (__Pyx_SetAttrString(__pyx_m, "http_connection", (PyObject *)&__pyx_type_6gevent_4core_http_connection) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19420
  __pyx_vtabptr_6gevent_4core_http_request_client = &__pyx_vtable_6gevent_4core_http_request_client;
 
19421
  __pyx_vtable_6gevent_4core_http_request_client._addref = (PyObject *(*)(struct __pyx_obj_6gevent_4core_http_request_client *))__pyx_f_6gevent_4core_19http_request_client__addref;
 
19422
  __pyx_vtable_6gevent_4core_http_request_client._delref = (PyObject *(*)(struct __pyx_obj_6gevent_4core_http_request_client *))__pyx_f_6gevent_4core_19http_request_client__delref;
 
19423
  __pyx_type_6gevent_4core_http_request_client.tp_base = __pyx_ptype_6gevent_4core_http_request_base;
 
19424
  if (PyType_Ready(&__pyx_type_6gevent_4core_http_request_client) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19425
  if (__Pyx_SetVtable(__pyx_type_6gevent_4core_http_request_client.tp_dict, __pyx_vtabptr_6gevent_4core_http_request_client) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19426
  if (__Pyx_SetAttrString(__pyx_m, "http_request_client", (PyObject *)&__pyx_type_6gevent_4core_http_request_client) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19427
  if (__pyx_type_6gevent_4core_http_request_client.tp_weaklistoffset == 0) __pyx_type_6gevent_4core_http_request_client.tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_4core_http_request_client, __pyx_base.__weakref__);
 
19428
  __pyx_ptype_6gevent_4core_http_request_client = &__pyx_type_6gevent_4core_http_request_client;
 
19429
  if (PyType_Ready(&__pyx_type_6gevent_4core_http_connection) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19430
  if (__Pyx_SetAttrString(__pyx_m, "http_connection", (PyObject *)&__pyx_type_6gevent_4core_http_connection) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16871
19431
  __pyx_ptype_6gevent_4core_http_connection = &__pyx_type_6gevent_4core_http_connection;
16872
 
  if (PyType_Ready(&__pyx_type_6gevent_4core_http) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16873
 
  if (__Pyx_SetAttrString(__pyx_m, "http", (PyObject *)&__pyx_type_6gevent_4core_http) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19432
  if (PyType_Ready(&__pyx_type_6gevent_4core_http) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19433
  if (__Pyx_SetAttrString(__pyx_m, "http", (PyObject *)&__pyx_type_6gevent_4core_http) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16874
19434
  __pyx_ptype_6gevent_4core_http = &__pyx_type_6gevent_4core_http;
16875
19435
  /*--- Type import code ---*/
16876
19436
  /*--- Function import code ---*/
16877
19437
  /*--- Execution code ---*/
16878
19438
 
16879
 
  /* "/home/denis/work/gevent/gevent/core.pyx":31
 
19439
  /* "gevent/core.pyx":31
16880
19440
 * """
16881
19441
 * 
16882
19442
 * __author__ = ( 'Dug Song <dugsong@monkey.org>',             # <<<<<<<<<<<<<<
16883
19443
 *                'Martin Murray <mmurray@monkey.org>' )
16884
19444
 * __copyright__ = ( 'Copyright (c) 2004 Dug Song',
16885
19445
 */
16886
 
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16887
 
  __Pyx_GOTREF(__pyx_t_1);
16888
 
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_46));
16889
 
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_46));
16890
 
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_46));
16891
 
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_47));
16892
 
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_kp_s_47));
16893
 
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_47));
16894
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____author__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16895
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
19446
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____author__, ((PyObject *)__pyx_k_tuple_56)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16896
19447
 
16897
 
  /* "/home/denis/work/gevent/gevent/core.pyx":33
 
19448
  /* "gevent/core.pyx":33
16898
19449
 * __author__ = ( 'Dug Song <dugsong@monkey.org>',
16899
19450
 *                'Martin Murray <mmurray@monkey.org>' )
16900
19451
 * __copyright__ = ( 'Copyright (c) 2004 Dug Song',             # <<<<<<<<<<<<<<
16901
19452
 *                   'Copyright (c) 2003 Martin Murray' )
16902
19453
 * __license__ = 'BSD'
16903
19454
 */
16904
 
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16905
 
  __Pyx_GOTREF(__pyx_t_1);
16906
 
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_48));
16907
 
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_kp_s_48));
16908
 
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_48));
16909
 
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_49));
16910
 
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_kp_s_49));
16911
 
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_49));
16912
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____copyright__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16913
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
19455
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____copyright__, ((PyObject *)__pyx_k_tuple_59)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16914
19456
 
16915
 
  /* "/home/denis/work/gevent/gevent/core.pyx":35
 
19457
  /* "gevent/core.pyx":35
16916
19458
 * __copyright__ = ( 'Copyright (c) 2004 Dug Song',
16917
19459
 *                   'Copyright (c) 2003 Martin Murray' )
16918
19460
 * __license__ = 'BSD'             # <<<<<<<<<<<<<<
16921
19463
 */
16922
19464
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____license__, ((PyObject *)__pyx_n_s__BSD)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16923
19465
 
16924
 
  /* "/home/denis/work/gevent/gevent/core.pyx":36
 
19466
  /* "gevent/core.pyx":36
16925
19467
 *                   'Copyright (c) 2003 Martin Murray' )
16926
19468
 * __license__ = 'BSD'
16927
19469
 * __url__ = 'http://monkey.org/~dugsong/pyevent/'             # <<<<<<<<<<<<<<
16928
19470
 * __version__ = '0.4+'
16929
19471
 * 
16930
19472
 */
16931
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____url__, ((PyObject *)__pyx_kp_s_50)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19473
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____url__, ((PyObject *)__pyx_kp_s_60)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16932
19474
 
16933
 
  /* "/home/denis/work/gevent/gevent/core.pyx":37
 
19475
  /* "gevent/core.pyx":37
16934
19476
 * __license__ = 'BSD'
16935
19477
 * __url__ = 'http://monkey.org/~dugsong/pyevent/'
16936
19478
 * __version__ = '0.4+'             # <<<<<<<<<<<<<<
16937
19479
 * 
16938
19480
 * __all__ = ['event', 'read_event', 'write_event', 'timer', 'signal', 'active_event',
16939
19481
 */
16940
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____version__, ((PyObject *)__pyx_kp_s_51)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19482
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____version__, ((PyObject *)__pyx_kp_s_61)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16941
19483
 
16942
 
  /* "/home/denis/work/gevent/gevent/core.pyx":39
 
19484
  /* "gevent/core.pyx":39
16943
19485
 * __version__ = '0.4+'
16944
19486
 * 
16945
19487
 * __all__ = ['event', 'read_event', 'write_event', 'timer', 'signal', 'active_event',             # <<<<<<<<<<<<<<
16987
19529
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16988
19530
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
16989
19531
 
16990
 
  /* "/home/denis/work/gevent/gevent/core.pyx":43
 
19532
  /* "gevent/core.pyx":43
16991
19533
 * # note, that .pxi files append stuff to __all__
16992
19534
 * 
16993
19535
 * import sys             # <<<<<<<<<<<<<<
16999
19541
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17000
19542
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17001
19543
 
17002
 
  /* "/home/denis/work/gevent/gevent/core.pyx":44
 
19544
  /* "gevent/core.pyx":44
17003
19545
 * 
17004
19546
 * import sys
17005
19547
 * import traceback             # <<<<<<<<<<<<<<
17011
19553
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__traceback, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17012
19554
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17013
19555
 
17014
 
  /* "/home/denis/work/gevent/gevent/core.pyx":45
 
19556
  /* "gevent/core.pyx":45
17015
19557
 * import sys
17016
19558
 * import traceback
17017
19559
 * from pprint import pformat             # <<<<<<<<<<<<<<
17032
19574
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17033
19575
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17034
19576
 
17035
 
  /* "/home/denis/work/gevent/gevent/core.pyx":46
 
19577
  /* "gevent/core.pyx":46
17036
19578
 * import traceback
17037
19579
 * from pprint import pformat
17038
19580
 * import weakref             # <<<<<<<<<<<<<<
17039
19581
 * 
17040
 
 * DEF EVENT_INTERNAL_AVAILABLE = False
 
19582
 * 
17041
19583
 */
17042
19584
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__weakref), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17043
19585
  __Pyx_GOTREF(__pyx_t_2);
17044
19586
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__weakref, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17045
19587
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17046
19588
 
17047
 
  /* "/home/denis/work/gevent/gevent/core.pyx":346
 
19589
  /* "gevent/core.pyx":303
17048
19590
 *     """Create a new scheduled event with evtype=EV_READ"""
17049
19591
 * 
17050
19592
 *     def __init__(self, int handle, callback, timeout=None, arg=None, persist=False):             # <<<<<<<<<<<<<<
17051
19593
 *         cdef short evtype = EV_READ
17052
19594
 *         if persist:
17053
19595
 */
17054
 
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19596
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17055
19597
  __Pyx_GOTREF(__pyx_t_2);
17056
19598
  __pyx_k_12 = __pyx_t_2;
17057
19599
  __Pyx_GIVEREF(__pyx_t_2);
17058
19600
  __pyx_t_2 = 0;
17059
19601
 
17060
 
  /* "/home/denis/work/gevent/gevent/core.pyx":357
 
19602
  /* "gevent/core.pyx":314
17061
19603
 *     """Create a new scheduled event with evtype=EV_WRITE"""
17062
19604
 * 
17063
19605
 *     def __init__(self, int handle, callback, timeout=None, arg=None, persist=False):             # <<<<<<<<<<<<<<
17064
19606
 *         cdef short evtype = EV_WRITE
17065
19607
 *         if persist:
17066
19608
 */
17067
 
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19609
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17068
19610
  __Pyx_GOTREF(__pyx_t_2);
17069
19611
  __pyx_k_13 = __pyx_t_2;
17070
19612
  __Pyx_GIVEREF(__pyx_t_2);
17071
19613
  __pyx_t_2 = 0;
17072
19614
 
17073
 
  /* "/home/denis/work/gevent/gevent/core.pyx":365
 
19615
  /* "gevent/core.pyx":322
17074
19616
 * 
17075
19617
 * 
17076
19618
 * class readwrite_event(event):             # <<<<<<<<<<<<<<
17077
19619
 *     """Create a new scheduled event with evtype=EV_READ|EV_WRITE"""
17078
19620
 * 
17079
19621
 */
17080
 
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19622
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17081
19623
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
17082
 
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17083
 
  __Pyx_GOTREF(__pyx_t_1);
 
19624
 
 
19625
  /* "gevent/core.pyx":325
 
19626
 *     """Create a new scheduled event with evtype=EV_READ|EV_WRITE"""
 
19627
 * 
 
19628
 *     def __init__(self, int handle, callback, timeout=None, arg=None, persist=False):             # <<<<<<<<<<<<<<
 
19629
 *         cdef short evtype = EV_READ|EV_WRITE
 
19630
 *         if persist:
 
19631
 */
 
19632
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19633
  __Pyx_GOTREF(__pyx_t_1);
 
19634
  __pyx_k_14 = __pyx_t_1;
 
19635
  __Pyx_GIVEREF(__pyx_t_1);
 
19636
  __pyx_t_1 = 0;
 
19637
  __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6gevent_4core_15readwrite_event___init__, NULL, __pyx_n_s_62); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19638
  __Pyx_GOTREF(__pyx_t_1);
 
19639
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____init__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19640
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
19641
 
 
19642
  /* "gevent/core.pyx":322
 
19643
 * 
 
19644
 * 
 
19645
 * class readwrite_event(event):             # <<<<<<<<<<<<<<
 
19646
 *     """Create a new scheduled event with evtype=EV_READ|EV_WRITE"""
 
19647
 * 
 
19648
 */
 
19649
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19650
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
17084
19651
  __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_event)));
17085
19652
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_event)));
17086
19653
  __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_event)));
17087
 
  if (PyDict_SetItemString(((PyObject *)__pyx_t_2), "__doc__", ((PyObject *)__pyx_kp_s_52)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17088
 
  __pyx_t_3 = __Pyx_CreateClass(__pyx_t_1, ((PyObject *)__pyx_t_2), __pyx_n_s__readwrite_event, "gevent.core"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19654
  if (PyDict_SetItemString(((PyObject *)__pyx_t_2), "__doc__", ((PyObject *)__pyx_kp_s_63)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19655
  __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2), __pyx_n_s__readwrite_event, __pyx_n_s_62); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17089
19656
  __Pyx_GOTREF(__pyx_t_3);
17090
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17091
 
 
17092
 
  /* "/home/denis/work/gevent/gevent/core.pyx":368
17093
 
 *     """Create a new scheduled event with evtype=EV_READ|EV_WRITE"""
17094
 
 * 
17095
 
 *     def __init__(self, int handle, callback, timeout=None, arg=None, persist=False):             # <<<<<<<<<<<<<<
17096
 
 *         cdef short evtype = EV_READ|EV_WRITE
17097
 
 *         if persist:
17098
 
 */
17099
 
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17100
 
  __Pyx_GOTREF(__pyx_t_1);
17101
 
  __pyx_k_14 = __pyx_t_1;
17102
 
  __Pyx_GIVEREF(__pyx_t_1);
17103
 
  __pyx_t_1 = 0;
17104
 
  __pyx_t_1 = PyCFunction_New(&__pyx_mdef_6gevent_4core_15readwrite_event___init__, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17105
 
  __Pyx_GOTREF(__pyx_t_1);
17106
 
  __pyx_t_4 = PyMethod_New(__pyx_t_1, 0, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17107
 
  __Pyx_GOTREF(__pyx_t_4);
17108
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17109
 
  if (PyObject_SetAttr(__pyx_t_3, __pyx_n_s____init__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17110
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17111
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__readwrite_event, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19657
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
19658
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__readwrite_event, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17112
19659
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17113
19660
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
17114
19661
 
17115
 
  /* "/home/denis/work/gevent/gevent/core.pyx":445
 
19662
  /* "gevent/core.pyx":384
 
19663
 * 
 
19664
 * 
 
19665
 * def init():             # <<<<<<<<<<<<<<
 
19666
 *     """Initialize event queue."""
 
19667
 *     event_init()
 
19668
 */
 
19669
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_init, NULL, __pyx_n_s_62); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19670
  __Pyx_GOTREF(__pyx_t_2);
 
19671
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__init, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19672
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
19673
 
 
19674
  /* "gevent/core.pyx":389
 
19675
 * 
 
19676
 * 
 
19677
 * def dispatch():             # <<<<<<<<<<<<<<
 
19678
 *     """Dispatch all events on the event queue.
 
19679
 *     Returns 0 on success, and 1 if no events are registered.
 
19680
 */
 
19681
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_1dispatch, NULL, __pyx_n_s_62); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19682
  __Pyx_GOTREF(__pyx_t_2);
 
19683
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__dispatch, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19684
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
19685
 
 
19686
  /* "gevent/core.pyx":402
17116
19687
 * 
17117
19688
 * 
17118
19689
 * def loop(nonblock=False):             # <<<<<<<<<<<<<<
17119
19690
 *     """Dispatch all pending events on queue in a single pass.
17120
19691
 *     Returns 0 on success, and 1 if no events are registered.
17121
19692
 */
17122
 
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19693
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17123
19694
  __Pyx_GOTREF(__pyx_t_2);
17124
19695
  __pyx_k_15 = __pyx_t_2;
17125
19696
  __Pyx_GIVEREF(__pyx_t_2);
17126
19697
  __pyx_t_2 = 0;
17127
 
 
17128
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":1
 
19698
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_2loop, NULL, __pyx_n_s_62); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19699
  __Pyx_GOTREF(__pyx_t_2);
 
19700
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__loop, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19701
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
19702
 
 
19703
  /* "gevent/core.pyx":418
 
19704
 * 
 
19705
 * 
 
19706
 * def get_version():             # <<<<<<<<<<<<<<
 
19707
 *     """Wrapper for :meth:`event_get_version`"""
 
19708
 *     return event_get_version()
 
19709
 */
 
19710
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_3get_version, NULL, __pyx_n_s_62); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19711
  __Pyx_GOTREF(__pyx_t_2);
 
19712
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__get_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19713
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
19714
 
 
19715
  /* "gevent/core.pyx":423
 
19716
 * 
 
19717
 * 
 
19718
 * def get_method():             # <<<<<<<<<<<<<<
 
19719
 *     """Wrapper for :meth:`event_get_method`"""
 
19720
 *     return event_get_method()
 
19721
 */
 
19722
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_4get_method, NULL, __pyx_n_s_62); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19723
  __Pyx_GOTREF(__pyx_t_2);
 
19724
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__get_method, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19725
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
19726
 
 
19727
  /* "gevent/core.pyx":436
 
19728
 * # _EVENT_VERSION is available since libevent 1.4.0-beta
 
19729
 * 
 
19730
 * def get_header_version():             # <<<<<<<<<<<<<<
 
19731
 *     """Return _EVENT_VERSION"""
 
19732
 *     emit_ifdef()
 
19733
 */
 
19734
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_5get_header_version, NULL, __pyx_n_s_62); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19735
  __Pyx_GOTREF(__pyx_t_2);
 
19736
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__get_header_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19737
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
19738
 
 
19739
  /* "gevent/core.pyx":447
 
19740
 * # which will work in every version other than 1.4.0-beta
 
19741
 * 
 
19742
 * def reinit():             # <<<<<<<<<<<<<<
 
19743
 *     """Wrapper for :meth:`event_reinit`."""
 
19744
 *     emit_ifdef()
 
19745
 */
 
19746
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_6reinit, NULL, __pyx_n_s_62); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19747
  __Pyx_GOTREF(__pyx_t_2);
 
19748
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__reinit, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19749
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
19750
 
 
19751
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":1
17129
19752
 * __all__ += ['dns_init', 'dns_shutdown', 'dns_err_to_string',             # <<<<<<<<<<<<<<
17130
19753
 *             'dns_resolve_ipv4', 'dns_resolve_ipv6',
17131
19754
 *             'dns_resolve_reverse', 'dns_resolve_reverse_ipv6']
17132
19755
 */
17133
 
  __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17134
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
 
19756
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s____all__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19757
  __Pyx_GOTREF(__pyx_t_2);
 
19758
  __pyx_t_3 = PyList_New(7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19759
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
17135
19760
  __Pyx_INCREF(((PyObject *)__pyx_n_s__dns_init));
17136
 
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__dns_init));
 
19761
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__dns_init));
17137
19762
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dns_init));
17138
19763
  __Pyx_INCREF(((PyObject *)__pyx_n_s__dns_shutdown));
17139
 
  PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__dns_shutdown));
 
19764
  PyList_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__dns_shutdown));
17140
19765
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dns_shutdown));
17141
19766
  __Pyx_INCREF(((PyObject *)__pyx_n_s__dns_err_to_string));
17142
 
  PyList_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_n_s__dns_err_to_string));
 
19767
  PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_n_s__dns_err_to_string));
17143
19768
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dns_err_to_string));
17144
19769
  __Pyx_INCREF(((PyObject *)__pyx_n_s__dns_resolve_ipv4));
17145
 
  PyList_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_n_s__dns_resolve_ipv4));
 
19770
  PyList_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_n_s__dns_resolve_ipv4));
17146
19771
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dns_resolve_ipv4));
17147
19772
  __Pyx_INCREF(((PyObject *)__pyx_n_s__dns_resolve_ipv6));
17148
 
  PyList_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_n_s__dns_resolve_ipv6));
 
19773
  PyList_SET_ITEM(__pyx_t_3, 4, ((PyObject *)__pyx_n_s__dns_resolve_ipv6));
17149
19774
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dns_resolve_ipv6));
17150
19775
  __Pyx_INCREF(((PyObject *)__pyx_n_s__dns_resolve_reverse));
17151
 
  PyList_SET_ITEM(__pyx_t_2, 5, ((PyObject *)__pyx_n_s__dns_resolve_reverse));
 
19776
  PyList_SET_ITEM(__pyx_t_3, 5, ((PyObject *)__pyx_n_s__dns_resolve_reverse));
17152
19777
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__dns_resolve_reverse));
17153
 
  __Pyx_INCREF(((PyObject *)__pyx_n_s_53));
17154
 
  PyList_SET_ITEM(__pyx_t_2, 6, ((PyObject *)__pyx_n_s_53));
17155
 
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_53));
17156
 
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s____all__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17157
 
  __Pyx_GOTREF(__pyx_t_3);
17158
 
  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17159
 
  __Pyx_GOTREF(__pyx_t_4);
17160
 
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
17161
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17162
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17163
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
19778
  __Pyx_INCREF(((PyObject *)__pyx_n_s_64));
 
19779
  PyList_SET_ITEM(__pyx_t_3, 6, ((PyObject *)__pyx_n_s_64));
 
19780
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_64));
 
19781
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19782
  __Pyx_GOTREF(__pyx_t_1);
 
19783
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
19784
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
 
19785
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19786
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17164
19787
 
17165
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":20
 
19788
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":20
17166
19789
 * 
17167
19790
 * # Result codes
17168
19791
 * DNS_ERR_NONE         = 0             # <<<<<<<<<<<<<<
17171
19794
 */
17172
19795
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DNS_ERR_NONE, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17173
19796
 
17174
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":21
 
19797
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":21
17175
19798
 * # Result codes
17176
19799
 * DNS_ERR_NONE         = 0
17177
19800
 * DNS_ERR_FORMAT       = 1             # <<<<<<<<<<<<<<
17180
19803
 */
17181
19804
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DNS_ERR_FORMAT, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17182
19805
 
17183
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":22
 
19806
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":22
17184
19807
 * DNS_ERR_NONE         = 0
17185
19808
 * DNS_ERR_FORMAT       = 1
17186
19809
 * DNS_ERR_SERVERFAILED = 2             # <<<<<<<<<<<<<<
17187
19810
 * DNS_ERR_NOTEXIST     = 3
17188
19811
 * DNS_ERR_NOTIMPL      = 4
17189
19812
 */
17190
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_54, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19813
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_65, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17191
19814
 
17192
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":23
 
19815
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":23
17193
19816
 * DNS_ERR_FORMAT       = 1
17194
19817
 * DNS_ERR_SERVERFAILED = 2
17195
19818
 * DNS_ERR_NOTEXIST     = 3             # <<<<<<<<<<<<<<
17198
19821
 */
17199
19822
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DNS_ERR_NOTEXIST, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17200
19823
 
17201
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":24
 
19824
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":24
17202
19825
 * DNS_ERR_SERVERFAILED = 2
17203
19826
 * DNS_ERR_NOTEXIST     = 3
17204
19827
 * DNS_ERR_NOTIMPL      = 4             # <<<<<<<<<<<<<<
17207
19830
 */
17208
19831
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DNS_ERR_NOTIMPL, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17209
19832
 
17210
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":25
 
19833
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":25
17211
19834
 * DNS_ERR_NOTEXIST     = 3
17212
19835
 * DNS_ERR_NOTIMPL      = 4
17213
19836
 * DNS_ERR_REFUSED      = 5             # <<<<<<<<<<<<<<
17216
19839
 */
17217
19840
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DNS_ERR_REFUSED, __pyx_int_5) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17218
19841
 
17219
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":26
 
19842
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":26
17220
19843
 * DNS_ERR_NOTIMPL      = 4
17221
19844
 * DNS_ERR_REFUSED      = 5
17222
19845
 * DNS_ERR_TRUNCATED    = 65             # <<<<<<<<<<<<<<
17225
19848
 */
17226
19849
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DNS_ERR_TRUNCATED, __pyx_int_65) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17227
19850
 
17228
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":27
 
19851
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":27
17229
19852
 * DNS_ERR_REFUSED      = 5
17230
19853
 * DNS_ERR_TRUNCATED    = 65
17231
19854
 * DNS_ERR_UNKNOWN      = 66             # <<<<<<<<<<<<<<
17234
19857
 */
17235
19858
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DNS_ERR_UNKNOWN, __pyx_int_66) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17236
19859
 
17237
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":28
 
19860
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":28
17238
19861
 * DNS_ERR_TRUNCATED    = 65
17239
19862
 * DNS_ERR_UNKNOWN      = 66
17240
19863
 * DNS_ERR_TIMEOUT      = 67             # <<<<<<<<<<<<<<
17243
19866
 */
17244
19867
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DNS_ERR_TIMEOUT, __pyx_int_67) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17245
19868
 
17246
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":29
 
19869
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":29
17247
19870
 * DNS_ERR_UNKNOWN      = 66
17248
19871
 * DNS_ERR_TIMEOUT      = 67
17249
19872
 * DNS_ERR_SHUTDOWN     = 68             # <<<<<<<<<<<<<<
17252
19875
 */
17253
19876
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DNS_ERR_SHUTDOWN, __pyx_int_68) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17254
19877
 
17255
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":32
 
19878
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":32
17256
19879
 * 
17257
19880
 * # Types
17258
19881
 * DNS_IPv4_A    = 1             # <<<<<<<<<<<<<<
17261
19884
 */
17262
19885
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DNS_IPv4_A, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17263
19886
 
17264
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":33
 
19887
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":33
17265
19888
 * # Types
17266
19889
 * DNS_IPv4_A    = 1
17267
19890
 * DNS_PTR       = 2             # <<<<<<<<<<<<<<
17270
19893
 */
17271
19894
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DNS_PTR, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17272
19895
 
17273
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":34
 
19896
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":34
17274
19897
 * DNS_IPv4_A    = 1
17275
19898
 * DNS_PTR       = 2
17276
19899
 * DNS_IPv6_AAAA = 3             # <<<<<<<<<<<<<<
17279
19902
 */
17280
19903
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DNS_IPv6_AAAA, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17281
19904
 
17282
 
  /* "/home/denis/work/gevent/gevent/evdns.pxi":37
 
19905
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":37
17283
19906
 * 
17284
19907
 * # Flags
17285
19908
 * DNS_QUERY_NO_SEARCH = 1             # <<<<<<<<<<<<<<
17288
19911
 */
17289
19912
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__DNS_QUERY_NO_SEARCH, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17290
19913
 
17291
 
  /* "/home/denis/work/gevent/gevent/core.pyx":499
 
19914
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":40
 
19915
 * 
 
19916
 * 
 
19917
 * def dns_init():             # <<<<<<<<<<<<<<
 
19918
 *     """Initialize async DNS resolver."""
 
19919
 *     evdns_init()
 
19920
 */
 
19921
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_7dns_init, NULL, __pyx_n_s_62); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19922
  __Pyx_GOTREF(__pyx_t_1);
 
19923
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__dns_init, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19924
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
19925
 
 
19926
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":45
 
19927
 * 
 
19928
 * 
 
19929
 * def dns_shutdown(int fail_requests=0):             # <<<<<<<<<<<<<<
 
19930
 *     """Shutdown the async DNS resolver and terminate all active requests."""
 
19931
 *     evdns_shutdown(fail_requests)
 
19932
 */
 
19933
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_8dns_shutdown, NULL, __pyx_n_s_62); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19934
  __Pyx_GOTREF(__pyx_t_1);
 
19935
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__dns_shutdown, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19936
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
19937
 
 
19938
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":50
 
19939
 * 
 
19940
 * 
 
19941
 * def dns_err_to_string(int err):             # <<<<<<<<<<<<<<
 
19942
 *     cdef const_char_ptr result = evdns_err_to_string(err)
 
19943
 *     if result:
 
19944
 */
 
19945
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_9dns_err_to_string, NULL, __pyx_n_s_62); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19946
  __Pyx_GOTREF(__pyx_t_1);
 
19947
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__dns_err_to_string, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19948
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
19949
 
 
19950
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":84
 
19951
 * 
 
19952
 * 
 
19953
 * def dns_resolve_ipv4(char *name, int flags, object callback):             # <<<<<<<<<<<<<<
 
19954
 *     """Lookup an A record for a given name.
 
19955
 * 
 
19956
 */
 
19957
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_10dns_resolve_ipv4, NULL, __pyx_n_s_62); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19958
  __Pyx_GOTREF(__pyx_t_1);
 
19959
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__dns_resolve_ipv4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19960
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
19961
 
 
19962
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":97
 
19963
 * 
 
19964
 * 
 
19965
 * def dns_resolve_ipv6(char *name, int flags, object callback):             # <<<<<<<<<<<<<<
 
19966
 *     """Lookup an AAAA record for a given name.
 
19967
 * 
 
19968
 */
 
19969
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_11dns_resolve_ipv6, NULL, __pyx_n_s_62); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19970
  __Pyx_GOTREF(__pyx_t_1);
 
19971
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__dns_resolve_ipv6, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19972
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
19973
 
 
19974
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":110
 
19975
 * 
 
19976
 * 
 
19977
 * def dns_resolve_reverse(char* packed_ip, int flags, object callback):             # <<<<<<<<<<<<<<
 
19978
 *     """Lookup a PTR record for a given IPv4 address.
 
19979
 * 
 
19980
 */
 
19981
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_12dns_resolve_reverse, NULL, __pyx_n_s_62); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19982
  __Pyx_GOTREF(__pyx_t_1);
 
19983
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__dns_resolve_reverse, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19984
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
19985
 
 
19986
  /* "/home/denis/tmp/gevent-0.13/gevent/evdns.pxi":123
 
19987
 * 
 
19988
 * 
 
19989
 * def dns_resolve_reverse_ipv6(char* packed_ip, int flags, object callback):             # <<<<<<<<<<<<<<
 
19990
 *     """Lookup a PTR record for a given IPv6 address.
 
19991
 * 
 
19992
 */
 
19993
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_13dns_resolve_reverse_ipv6, NULL, __pyx_n_s_62); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19994
  __Pyx_GOTREF(__pyx_t_1);
 
19995
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
19996
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
19997
 
 
19998
  /* "gevent/core.pyx":456
17292
19999
 * 
17293
20000
 * # XXX - make sure event queue is always initialized.
17294
20001
 * init()             # <<<<<<<<<<<<<<
17295
20002
 * 
17296
20003
 * if get_version() != get_header_version() and get_header_version() is not None and get_version() != '1.3.99-trunk':
17297
20004
 */
17298
 
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__init); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17299
 
  __Pyx_GOTREF(__pyx_t_4);
17300
 
  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20005
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20006
  __Pyx_GOTREF(__pyx_t_1);
 
20007
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17301
20008
  __Pyx_GOTREF(__pyx_t_3);
17302
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
20009
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17303
20010
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17304
20011
 
17305
 
  /* "/home/denis/work/gevent/gevent/core.pyx":501
 
20012
  /* "gevent/core.pyx":458
17306
20013
 * init()
17307
20014
 * 
17308
20015
 * if get_version() != get_header_version() and get_header_version() is not None and get_version() != '1.3.99-trunk':             # <<<<<<<<<<<<<<
17309
20016
 *     import warnings
17310
20017
 *     msg = "libevent version mismatch: system version is %r but this gevent is compiled against %r" % (get_version(), get_header_version())
17311
20018
 */
17312
 
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_version); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20019
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_version); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17313
20020
  __Pyx_GOTREF(__pyx_t_3);
17314
 
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17315
 
  __Pyx_GOTREF(__pyx_t_4);
 
20021
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20022
  __Pyx_GOTREF(__pyx_t_1);
17316
20023
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17317
 
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_header_version); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20024
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_header_version); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17318
20025
  __Pyx_GOTREF(__pyx_t_3);
17319
 
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20026
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17320
20027
  __Pyx_GOTREF(__pyx_t_2);
17321
20028
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17322
 
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20029
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17323
20030
  __Pyx_GOTREF(__pyx_t_3);
17324
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
20031
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17325
20032
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17326
 
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20033
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17327
20034
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17328
 
  if (__pyx_t_5) {
17329
 
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_header_version); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20035
  if (__pyx_t_4) {
 
20036
    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_header_version); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17330
20037
    __Pyx_GOTREF(__pyx_t_3);
17331
 
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20038
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17332
20039
    __Pyx_GOTREF(__pyx_t_2);
17333
20040
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17334
 
    __pyx_t_6 = (__pyx_t_2 != Py_None);
 
20041
    __pyx_t_5 = (__pyx_t_2 != Py_None);
17335
20042
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17336
 
    if (__pyx_t_6) {
17337
 
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20043
    if (__pyx_t_5) {
 
20044
      __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17338
20045
      __Pyx_GOTREF(__pyx_t_2);
17339
 
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20046
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17340
20047
      __Pyx_GOTREF(__pyx_t_3);
17341
20048
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17342
 
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_s_55), Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20049
      __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_kp_s_66), Py_NE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17343
20050
      __Pyx_GOTREF(__pyx_t_2);
17344
20051
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17345
 
      __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20052
      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17346
20053
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17347
 
      __pyx_t_8 = __pyx_t_7;
 
20054
      __pyx_t_7 = __pyx_t_6;
17348
20055
    } else {
17349
 
      __pyx_t_8 = __pyx_t_6;
 
20056
      __pyx_t_7 = __pyx_t_5;
17350
20057
    }
17351
 
    __pyx_t_6 = __pyx_t_8;
 
20058
    __pyx_t_5 = __pyx_t_7;
17352
20059
  } else {
17353
 
    __pyx_t_6 = __pyx_t_5;
 
20060
    __pyx_t_5 = __pyx_t_4;
17354
20061
  }
17355
 
  if (__pyx_t_6) {
 
20062
  if (__pyx_t_5) {
17356
20063
 
17357
 
    /* "/home/denis/work/gevent/gevent/core.pyx":502
 
20064
    /* "gevent/core.pyx":459
17358
20065
 * 
17359
20066
 * if get_version() != get_header_version() and get_header_version() is not None and get_version() != '1.3.99-trunk':
17360
20067
 *     import warnings             # <<<<<<<<<<<<<<
17361
20068
 *     msg = "libevent version mismatch: system version is %r but this gevent is compiled against %r" % (get_version(), get_header_version())
17362
20069
 *     warnings.warn(msg, UserWarning, stacklevel=2)
17363
20070
 */
17364
 
    __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__warnings), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20071
    __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__warnings), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17365
20072
    __Pyx_GOTREF(__pyx_t_2);
17366
 
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__warnings, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20073
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__warnings, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17367
20074
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17368
20075
 
17369
 
    /* "/home/denis/work/gevent/gevent/core.pyx":503
 
20076
    /* "gevent/core.pyx":460
17370
20077
 * if get_version() != get_header_version() and get_header_version() is not None and get_version() != '1.3.99-trunk':
17371
20078
 *     import warnings
17372
20079
 *     msg = "libevent version mismatch: system version is %r but this gevent is compiled against %r" % (get_version(), get_header_version())             # <<<<<<<<<<<<<<
17373
20080
 *     warnings.warn(msg, UserWarning, stacklevel=2)
17374
20081
 * 
17375
20082
 */
17376
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20083
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17377
20084
    __Pyx_GOTREF(__pyx_t_2);
17378
 
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20085
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17379
20086
    __Pyx_GOTREF(__pyx_t_3);
17380
20087
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17381
 
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_header_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20088
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__get_header_version); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17382
20089
    __Pyx_GOTREF(__pyx_t_2);
17383
 
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17384
 
    __Pyx_GOTREF(__pyx_t_4);
 
20090
    __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20091
    __Pyx_GOTREF(__pyx_t_1);
17385
20092
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17386
 
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17387
 
    __Pyx_GOTREF(__pyx_t_2);
 
20093
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20094
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
17388
20095
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
17389
20096
    __Pyx_GIVEREF(__pyx_t_3);
17390
 
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
17391
 
    __Pyx_GIVEREF(__pyx_t_4);
 
20097
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
 
20098
    __Pyx_GIVEREF(__pyx_t_1);
17392
20099
    __pyx_t_3 = 0;
17393
 
    __pyx_t_4 = 0;
17394
 
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_56), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17395
 
    __Pyx_GOTREF(__pyx_t_4);
17396
 
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17397
 
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__msg, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17398
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
20100
    __pyx_t_1 = 0;
 
20101
    __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_67), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20102
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
20103
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
 
20104
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__msg, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20105
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
17399
20106
 
17400
 
    /* "/home/denis/work/gevent/gevent/core.pyx":504
 
20107
    /* "gevent/core.pyx":461
17401
20108
 *     import warnings
17402
20109
 *     msg = "libevent version mismatch: system version is %r but this gevent is compiled against %r" % (get_version(), get_header_version())
17403
20110
 *     warnings.warn(msg, UserWarning, stacklevel=2)             # <<<<<<<<<<<<<<
17404
20111
 * 
17405
20112
 * include "evbuffer.pxi"
17406
20113
 */
17407
 
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__warnings); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17408
 
    __Pyx_GOTREF(__pyx_t_4);
17409
 
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__warn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20114
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__warnings); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20115
    __Pyx_GOTREF(__pyx_t_1);
 
20116
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__warn); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17410
20117
    __Pyx_GOTREF(__pyx_t_2);
17411
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17412
 
    __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__msg); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17413
 
    __Pyx_GOTREF(__pyx_t_4);
17414
 
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17415
 
    __Pyx_GOTREF(__pyx_t_3);
17416
 
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
17417
 
    __Pyx_GIVEREF(__pyx_t_4);
 
20118
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
20119
    __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__msg); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20120
    __Pyx_GOTREF(__pyx_t_1);
 
20121
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20122
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
20123
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
 
20124
    __Pyx_GIVEREF(__pyx_t_1);
17418
20125
    __Pyx_INCREF(__pyx_builtin_UserWarning);
17419
20126
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_builtin_UserWarning);
17420
20127
    __Pyx_GIVEREF(__pyx_builtin_UserWarning);
17421
 
    __pyx_t_4 = 0;
17422
 
    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17423
 
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
17424
 
    if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__stacklevel), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17425
 
    __pyx_t_1 = PyEval_CallObjectWithKeywords(__pyx_t_2, __pyx_t_3, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17426
 
    __Pyx_GOTREF(__pyx_t_1);
 
20128
    __pyx_t_1 = 0;
 
20129
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20130
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
 
20131
    if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__stacklevel), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20132
    __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_2, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20133
    __Pyx_GOTREF(__pyx_t_8);
17427
20134
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17428
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17429
 
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
17430
 
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
20135
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
 
20136
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
20137
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17431
20138
    goto __pyx_L2;
17432
20139
  }
17433
20140
  __pyx_L2:;
17434
20141
 
17435
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":1
 
20142
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":1
17436
20143
 * __all__ += ['buffer']             # <<<<<<<<<<<<<<
17437
20144
 * 
17438
20145
 * cdef extern from "string.h":
17439
20146
 */
 
20147
  __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s____all__); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20148
  __Pyx_GOTREF(__pyx_t_8);
17440
20149
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17441
20150
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
17442
20151
  __Pyx_INCREF(((PyObject *)__pyx_n_s__buffer));
17443
20152
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__buffer));
17444
20153
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__buffer));
17445
 
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s____all__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17446
 
  __Pyx_GOTREF(__pyx_t_4);
17447
 
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_4, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20154
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_8, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17448
20155
  __Pyx_GOTREF(__pyx_t_3);
 
20156
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17449
20157
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
17450
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17451
20158
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17452
20159
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17453
20160
 
17454
 
  /* "/home/denis/work/gevent/gevent/evbuffer.pxi":105
17455
 
 *         return result
17456
 
 * 
17457
 
 *     def readlines(self, hint=-1):             # <<<<<<<<<<<<<<
 
20161
  /* "/home/denis/tmp/gevent-0.13/gevent/evbuffer.pxi":108
17458
20162
 *         return list(self)
17459
20163
 * 
17460
 
 */
17461
 
  __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17462
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
20164
 *     def write(self, bytes data):             # <<<<<<<<<<<<<<
 
20165
 *         cdef int result = evbuffer_add(self.__obj, data, len(data))
 
20166
 *         if result < 0:
 
20167
 */
 
20168
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s____all__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20169
  __Pyx_GOTREF(__pyx_t_3);
 
20170
 
 
20171
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":1
 
20172
 * __all__ += ['http_request', 'http_connection', 'http']             # <<<<<<<<<<<<<<
 
20173
 * 
 
20174
 * cdef extern from *:
 
20175
 */
 
20176
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20177
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
17463
20178
  __Pyx_INCREF(((PyObject *)__pyx_n_s__http_request));
17464
 
  PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__http_request));
 
20179
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__http_request));
17465
20180
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__http_request));
17466
20181
  __Pyx_INCREF(((PyObject *)__pyx_n_s__http_connection));
17467
 
  PyList_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__http_connection));
 
20182
  PyList_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__http_connection));
17468
20183
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__http_connection));
17469
20184
  __Pyx_INCREF(((PyObject *)__pyx_n_s__http));
17470
 
  PyList_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_n_s__http));
 
20185
  PyList_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_n_s__http));
17471
20186
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__http));
17472
 
  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s____all__); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17473
 
  __Pyx_GOTREF(__pyx_t_4);
17474
 
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_4, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17475
 
  __Pyx_GOTREF(__pyx_t_1);
17476
 
 
17477
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":1
17478
 
 * __all__ += ['http_request', 'http_connection', 'http']             # <<<<<<<<<<<<<<
17479
 
 * 
17480
 
 * EVHTTP_REQUEST      = 0
17481
 
 */
17482
 
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
17483
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17484
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17485
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17486
 
 
17487
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":3
17488
 
 * __all__ += ['http_request', 'http_connection', 'http']
 
20187
  __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_3, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20188
  __Pyx_GOTREF(__pyx_t_8);
 
20189
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
20190
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
20191
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____all__, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20192
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
20193
 
 
20194
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":6
 
20195
 *     cdef void emit_ifdef_modern "#if defined(LIBEVENT_HTTP_MODERN) //" ()
17489
20196
 * 
17490
20197
 * EVHTTP_REQUEST      = 0             # <<<<<<<<<<<<<<
17491
20198
 * EVHTTP_RESPONSE     = 1
17492
20199
 * 
17493
20200
 */
17494
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQUEST, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20201
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQUEST, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17495
20202
 
17496
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":4
 
20203
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":7
17497
20204
 * 
17498
20205
 * EVHTTP_REQUEST      = 0
17499
20206
 * EVHTTP_RESPONSE     = 1             # <<<<<<<<<<<<<<
17500
20207
 * 
17501
 
 * EVHTTP_REQ_GET      = 0
17502
 
 */
17503
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_RESPONSE, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17504
 
 
17505
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":6
17506
 
 * EVHTTP_RESPONSE     = 1
17507
 
 * 
17508
 
 * EVHTTP_REQ_GET      = 0             # <<<<<<<<<<<<<<
17509
 
 * EVHTTP_REQ_POST     = 1
17510
 
 * EVHTTP_REQ_HEAD     = 2
17511
 
 */
17512
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_GET, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17513
 
 
17514
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":7
17515
 
 * 
17516
 
 * EVHTTP_REQ_GET      = 0
17517
 
 * EVHTTP_REQ_POST     = 1             # <<<<<<<<<<<<<<
17518
 
 * EVHTTP_REQ_HEAD     = 2
17519
 
 * EVHTTP_REQ_PUT      = 3
17520
 
 */
17521
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_POST, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17522
 
 
17523
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":8
17524
 
 * EVHTTP_REQ_GET      = 0
17525
 
 * EVHTTP_REQ_POST     = 1
17526
 
 * EVHTTP_REQ_HEAD     = 2             # <<<<<<<<<<<<<<
17527
 
 * EVHTTP_REQ_PUT      = 3
17528
 
 * EVHTTP_REQ_DELETE   = 4
17529
 
 */
17530
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_HEAD, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17531
 
 
17532
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":9
17533
 
 * EVHTTP_REQ_POST     = 1
17534
 
 * EVHTTP_REQ_HEAD     = 2
17535
 
 * EVHTTP_REQ_PUT      = 3             # <<<<<<<<<<<<<<
17536
 
 * EVHTTP_REQ_DELETE   = 4
17537
 
 * 
17538
 
 */
17539
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_PUT, __pyx_int_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17540
 
 
17541
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":10
17542
 
 * EVHTTP_REQ_HEAD     = 2
17543
 
 * EVHTTP_REQ_PUT      = 3
17544
 
 * EVHTTP_REQ_DELETE   = 4             # <<<<<<<<<<<<<<
17545
 
 * 
17546
 
 * HTTP_method2name = { 0: 'GET', 1: 'POST', 2: 'HEAD', 3: 'PUT', 4: 'DELETE' }
17547
 
 */
17548
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_DELETE, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17549
 
 
17550
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":12
17551
 
 * EVHTTP_REQ_DELETE   = 4
17552
 
 * 
17553
 
 * HTTP_method2name = { 0: 'GET', 1: 'POST', 2: 'HEAD', 3: 'PUT', 4: 'DELETE' }             # <<<<<<<<<<<<<<
17554
 
 * 
17555
 
 * cdef extern from *:
17556
 
 */
17557
 
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17558
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
17559
 
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_0, ((PyObject *)__pyx_n_s__GET)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17560
 
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_1, ((PyObject *)__pyx_n_s__POST)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17561
 
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_2, ((PyObject *)__pyx_n_s__HEAD)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17562
 
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_3, ((PyObject *)__pyx_n_s__PUT)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17563
 
  if (PyDict_SetItem(__pyx_t_1, __pyx_int_4, ((PyObject *)__pyx_n_s__DELETE)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17564
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__HTTP_method2name, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17565
 
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
17566
 
 
17567
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":96
 
20208
 * 
 
20209
 */
 
20210
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_RESPONSE, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20211
 
 
20212
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":10
 
20213
 * 
 
20214
 * 
 
20215
 * emit_ifdef_modern()             # <<<<<<<<<<<<<<
 
20216
 * 
 
20217
 * EVHTTP_REQ_GET     = 1 << 0
 
20218
 */
 
20219
  #if defined(LIBEVENT_HTTP_MODERN) //();
 
20220
 
 
20221
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":12
 
20222
 * emit_ifdef_modern()
 
20223
 * 
 
20224
 * EVHTTP_REQ_GET     = 1 << 0             # <<<<<<<<<<<<<<
 
20225
 * EVHTTP_REQ_POST    = 1 << 1
 
20226
 * EVHTTP_REQ_HEAD    = 1 << 2
 
20227
 */
 
20228
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_GET, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20229
 
 
20230
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":13
 
20231
 * 
 
20232
 * EVHTTP_REQ_GET     = 1 << 0
 
20233
 * EVHTTP_REQ_POST    = 1 << 1             # <<<<<<<<<<<<<<
 
20234
 * EVHTTP_REQ_HEAD    = 1 << 2
 
20235
 * EVHTTP_REQ_PUT     = 1 << 3
 
20236
 */
 
20237
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_POST, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20238
 
 
20239
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":14
 
20240
 * EVHTTP_REQ_GET     = 1 << 0
 
20241
 * EVHTTP_REQ_POST    = 1 << 1
 
20242
 * EVHTTP_REQ_HEAD    = 1 << 2             # <<<<<<<<<<<<<<
 
20243
 * EVHTTP_REQ_PUT     = 1 << 3
 
20244
 * EVHTTP_REQ_DELETE  = 1 << 4
 
20245
 */
 
20246
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_HEAD, __pyx_int_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20247
 
 
20248
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":15
 
20249
 * EVHTTP_REQ_POST    = 1 << 1
 
20250
 * EVHTTP_REQ_HEAD    = 1 << 2
 
20251
 * EVHTTP_REQ_PUT     = 1 << 3             # <<<<<<<<<<<<<<
 
20252
 * EVHTTP_REQ_DELETE  = 1 << 4
 
20253
 * EVHTTP_REQ_OPTIONS = 1 << 5
 
20254
 */
 
20255
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_PUT, __pyx_int_8) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20256
 
 
20257
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":16
 
20258
 * EVHTTP_REQ_HEAD    = 1 << 2
 
20259
 * EVHTTP_REQ_PUT     = 1 << 3
 
20260
 * EVHTTP_REQ_DELETE  = 1 << 4             # <<<<<<<<<<<<<<
 
20261
 * EVHTTP_REQ_OPTIONS = 1 << 5
 
20262
 * EVHTTP_REQ_TRACE   = 1 << 6
 
20263
 */
 
20264
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_DELETE, __pyx_int_16) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20265
 
 
20266
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":17
 
20267
 * EVHTTP_REQ_PUT     = 1 << 3
 
20268
 * EVHTTP_REQ_DELETE  = 1 << 4
 
20269
 * EVHTTP_REQ_OPTIONS = 1 << 5             # <<<<<<<<<<<<<<
 
20270
 * EVHTTP_REQ_TRACE   = 1 << 6
 
20271
 * EVHTTP_REQ_CONNECT = 1 << 7
 
20272
 */
 
20273
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_OPTIONS, __pyx_int_32) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20274
 
 
20275
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":18
 
20276
 * EVHTTP_REQ_DELETE  = 1 << 4
 
20277
 * EVHTTP_REQ_OPTIONS = 1 << 5
 
20278
 * EVHTTP_REQ_TRACE   = 1 << 6             # <<<<<<<<<<<<<<
 
20279
 * EVHTTP_REQ_CONNECT = 1 << 7
 
20280
 * EVHTTP_REQ_PATCH   = 1 << 8
 
20281
 */
 
20282
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_TRACE, __pyx_int_64) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20283
 
 
20284
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":19
 
20285
 * EVHTTP_REQ_OPTIONS = 1 << 5
 
20286
 * EVHTTP_REQ_TRACE   = 1 << 6
 
20287
 * EVHTTP_REQ_CONNECT = 1 << 7             # <<<<<<<<<<<<<<
 
20288
 * EVHTTP_REQ_PATCH   = 1 << 8
 
20289
 * 
 
20290
 */
 
20291
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_CONNECT, __pyx_int_128) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20292
 
 
20293
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":20
 
20294
 * EVHTTP_REQ_TRACE   = 1 << 6
 
20295
 * EVHTTP_REQ_CONNECT = 1 << 7
 
20296
 * EVHTTP_REQ_PATCH   = 1 << 8             # <<<<<<<<<<<<<<
 
20297
 * 
 
20298
 * HTTP_method2name = {
 
20299
 */
 
20300
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_PATCH, __pyx_int_256) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20301
 
 
20302
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":22
 
20303
 * EVHTTP_REQ_PATCH   = 1 << 8
 
20304
 * 
 
20305
 * HTTP_method2name = {             # <<<<<<<<<<<<<<
 
20306
 *     EVHTTP_REQ_GET:     "GET",
 
20307
 *     EVHTTP_REQ_POST:    "POST",
 
20308
 */
 
20309
  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20310
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
 
20311
 
 
20312
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":23
 
20313
 * 
 
20314
 * HTTP_method2name = {
 
20315
 *     EVHTTP_REQ_GET:     "GET",             # <<<<<<<<<<<<<<
 
20316
 *     EVHTTP_REQ_POST:    "POST",
 
20317
 *     EVHTTP_REQ_HEAD:    "HEAD",
 
20318
 */
 
20319
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EVHTTP_REQ_GET); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20320
  __Pyx_GOTREF(__pyx_t_1);
 
20321
  if (PyDict_SetItem(__pyx_t_8, __pyx_t_1, ((PyObject *)__pyx_n_s__GET)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20322
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
20323
 
 
20324
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":24
 
20325
 * HTTP_method2name = {
 
20326
 *     EVHTTP_REQ_GET:     "GET",
 
20327
 *     EVHTTP_REQ_POST:    "POST",             # <<<<<<<<<<<<<<
 
20328
 *     EVHTTP_REQ_HEAD:    "HEAD",
 
20329
 *     EVHTTP_REQ_PUT:     "PUT",
 
20330
 */
 
20331
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EVHTTP_REQ_POST); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20332
  __Pyx_GOTREF(__pyx_t_1);
 
20333
  if (PyDict_SetItem(__pyx_t_8, __pyx_t_1, ((PyObject *)__pyx_n_s__POST)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20334
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
20335
 
 
20336
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":25
 
20337
 *     EVHTTP_REQ_GET:     "GET",
 
20338
 *     EVHTTP_REQ_POST:    "POST",
 
20339
 *     EVHTTP_REQ_HEAD:    "HEAD",             # <<<<<<<<<<<<<<
 
20340
 *     EVHTTP_REQ_PUT:     "PUT",
 
20341
 *     EVHTTP_REQ_DELETE:  "DELETE",
 
20342
 */
 
20343
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EVHTTP_REQ_HEAD); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20344
  __Pyx_GOTREF(__pyx_t_1);
 
20345
  if (PyDict_SetItem(__pyx_t_8, __pyx_t_1, ((PyObject *)__pyx_n_s__HEAD)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20346
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
20347
 
 
20348
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":26
 
20349
 *     EVHTTP_REQ_POST:    "POST",
 
20350
 *     EVHTTP_REQ_HEAD:    "HEAD",
 
20351
 *     EVHTTP_REQ_PUT:     "PUT",             # <<<<<<<<<<<<<<
 
20352
 *     EVHTTP_REQ_DELETE:  "DELETE",
 
20353
 *     EVHTTP_REQ_OPTIONS: "OPTIONS",
 
20354
 */
 
20355
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EVHTTP_REQ_PUT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20356
  __Pyx_GOTREF(__pyx_t_1);
 
20357
  if (PyDict_SetItem(__pyx_t_8, __pyx_t_1, ((PyObject *)__pyx_n_s__PUT)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20358
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
20359
 
 
20360
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":27
 
20361
 *     EVHTTP_REQ_HEAD:    "HEAD",
 
20362
 *     EVHTTP_REQ_PUT:     "PUT",
 
20363
 *     EVHTTP_REQ_DELETE:  "DELETE",             # <<<<<<<<<<<<<<
 
20364
 *     EVHTTP_REQ_OPTIONS: "OPTIONS",
 
20365
 *     EVHTTP_REQ_TRACE:   "TRACE",
 
20366
 */
 
20367
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EVHTTP_REQ_DELETE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20368
  __Pyx_GOTREF(__pyx_t_1);
 
20369
  if (PyDict_SetItem(__pyx_t_8, __pyx_t_1, ((PyObject *)__pyx_n_s__DELETE)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20370
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
20371
 
 
20372
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":28
 
20373
 *     EVHTTP_REQ_PUT:     "PUT",
 
20374
 *     EVHTTP_REQ_DELETE:  "DELETE",
 
20375
 *     EVHTTP_REQ_OPTIONS: "OPTIONS",             # <<<<<<<<<<<<<<
 
20376
 *     EVHTTP_REQ_TRACE:   "TRACE",
 
20377
 *     EVHTTP_REQ_CONNECT: "CONNECT",
 
20378
 */
 
20379
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EVHTTP_REQ_OPTIONS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20380
  __Pyx_GOTREF(__pyx_t_1);
 
20381
  if (PyDict_SetItem(__pyx_t_8, __pyx_t_1, ((PyObject *)__pyx_n_s__OPTIONS)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20382
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
20383
 
 
20384
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":29
 
20385
 *     EVHTTP_REQ_DELETE:  "DELETE",
 
20386
 *     EVHTTP_REQ_OPTIONS: "OPTIONS",
 
20387
 *     EVHTTP_REQ_TRACE:   "TRACE",             # <<<<<<<<<<<<<<
 
20388
 *     EVHTTP_REQ_CONNECT: "CONNECT",
 
20389
 *     EVHTTP_REQ_PATCH:   "PATCH"
 
20390
 */
 
20391
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EVHTTP_REQ_TRACE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20392
  __Pyx_GOTREF(__pyx_t_1);
 
20393
  if (PyDict_SetItem(__pyx_t_8, __pyx_t_1, ((PyObject *)__pyx_n_s__TRACE)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20394
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
20395
 
 
20396
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":30
 
20397
 *     EVHTTP_REQ_OPTIONS: "OPTIONS",
 
20398
 *     EVHTTP_REQ_TRACE:   "TRACE",
 
20399
 *     EVHTTP_REQ_CONNECT: "CONNECT",             # <<<<<<<<<<<<<<
 
20400
 *     EVHTTP_REQ_PATCH:   "PATCH"
 
20401
 * }
 
20402
 */
 
20403
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EVHTTP_REQ_CONNECT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20404
  __Pyx_GOTREF(__pyx_t_1);
 
20405
  if (PyDict_SetItem(__pyx_t_8, __pyx_t_1, ((PyObject *)__pyx_n_s__CONNECT)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20406
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
20407
 
 
20408
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":31
 
20409
 *     EVHTTP_REQ_TRACE:   "TRACE",
 
20410
 *     EVHTTP_REQ_CONNECT: "CONNECT",
 
20411
 *     EVHTTP_REQ_PATCH:   "PATCH"             # <<<<<<<<<<<<<<
 
20412
 * }
 
20413
 * 
 
20414
 */
 
20415
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EVHTTP_REQ_PATCH); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20416
  __Pyx_GOTREF(__pyx_t_1);
 
20417
  if (PyDict_SetItem(__pyx_t_8, __pyx_t_1, ((PyObject *)__pyx_n_s__PATCH)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20418
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
20419
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__HTTP_method2name, ((PyObject *)__pyx_t_8)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20420
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
 
20421
 
 
20422
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":34
 
20423
 * }
 
20424
 * 
 
20425
 * emit_else()             # <<<<<<<<<<<<<<
 
20426
 * 
 
20427
 * EVHTTP_REQ_GET     = 0
 
20428
 */
 
20429
  #else //();
 
20430
 
 
20431
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":36
 
20432
 * emit_else()
 
20433
 * 
 
20434
 * EVHTTP_REQ_GET     = 0             # <<<<<<<<<<<<<<
 
20435
 * EVHTTP_REQ_POST    = 1
 
20436
 * EVHTTP_REQ_HEAD    = 2
 
20437
 */
 
20438
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_GET, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20439
 
 
20440
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":37
 
20441
 * 
 
20442
 * EVHTTP_REQ_GET     = 0
 
20443
 * EVHTTP_REQ_POST    = 1             # <<<<<<<<<<<<<<
 
20444
 * EVHTTP_REQ_HEAD    = 2
 
20445
 * 
 
20446
 */
 
20447
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_POST, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20448
 
 
20449
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":38
 
20450
 * EVHTTP_REQ_GET     = 0
 
20451
 * EVHTTP_REQ_POST    = 1
 
20452
 * EVHTTP_REQ_HEAD    = 2             # <<<<<<<<<<<<<<
 
20453
 * 
 
20454
 * HTTP_method2name = {
 
20455
 */
 
20456
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__EVHTTP_REQ_HEAD, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20457
 
 
20458
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":40
 
20459
 * EVHTTP_REQ_HEAD    = 2
 
20460
 * 
 
20461
 * HTTP_method2name = {             # <<<<<<<<<<<<<<
 
20462
 *     EVHTTP_REQ_GET:     "GET",
 
20463
 *     EVHTTP_REQ_POST:    "POST",
 
20464
 */
 
20465
  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20466
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
 
20467
 
 
20468
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":41
 
20469
 * 
 
20470
 * HTTP_method2name = {
 
20471
 *     EVHTTP_REQ_GET:     "GET",             # <<<<<<<<<<<<<<
 
20472
 *     EVHTTP_REQ_POST:    "POST",
 
20473
 *     EVHTTP_REQ_HEAD:    "HEAD",
 
20474
 */
 
20475
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EVHTTP_REQ_GET); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20476
  __Pyx_GOTREF(__pyx_t_1);
 
20477
  if (PyDict_SetItem(__pyx_t_8, __pyx_t_1, ((PyObject *)__pyx_n_s__GET)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20478
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
20479
 
 
20480
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":42
 
20481
 * HTTP_method2name = {
 
20482
 *     EVHTTP_REQ_GET:     "GET",
 
20483
 *     EVHTTP_REQ_POST:    "POST",             # <<<<<<<<<<<<<<
 
20484
 *     EVHTTP_REQ_HEAD:    "HEAD",
 
20485
 * }
 
20486
 */
 
20487
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EVHTTP_REQ_POST); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20488
  __Pyx_GOTREF(__pyx_t_1);
 
20489
  if (PyDict_SetItem(__pyx_t_8, __pyx_t_1, ((PyObject *)__pyx_n_s__POST)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20490
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
20491
 
 
20492
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":43
 
20493
 *     EVHTTP_REQ_GET:     "GET",
 
20494
 *     EVHTTP_REQ_POST:    "POST",
 
20495
 *     EVHTTP_REQ_HEAD:    "HEAD",             # <<<<<<<<<<<<<<
 
20496
 * }
 
20497
 * 
 
20498
 */
 
20499
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__EVHTTP_REQ_HEAD); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20500
  __Pyx_GOTREF(__pyx_t_1);
 
20501
  if (PyDict_SetItem(__pyx_t_8, __pyx_t_1, ((PyObject *)__pyx_n_s__HEAD)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20502
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
20503
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__HTTP_method2name, ((PyObject *)__pyx_t_8)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20504
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
 
20505
 
 
20506
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":46
 
20507
 * }
 
20508
 * 
 
20509
 * emit_endif()             # <<<<<<<<<<<<<<
 
20510
 * 
 
20511
 * 
 
20512
 */
 
20513
  #endif //();
 
20514
 
 
20515
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":132
17568
20516
 * 
17569
20517
 * 
17570
20518
 * class ObjectDeleted(AttributeError):             # <<<<<<<<<<<<<<
17571
20519
 *     pass
17572
20520
 * 
17573
20521
 */
17574
 
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20522
  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20523
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
 
20524
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17575
20525
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
17576
 
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17577
 
  __Pyx_GOTREF(__pyx_t_4);
17578
20526
  __Pyx_INCREF(__pyx_builtin_AttributeError);
17579
 
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_builtin_AttributeError);
 
20527
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_AttributeError);
17580
20528
  __Pyx_GIVEREF(__pyx_builtin_AttributeError);
17581
 
  __pyx_t_3 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_1), __pyx_n_s__ObjectDeleted, "gevent.core"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20529
  __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_8), __pyx_n_s__ObjectDeleted, __pyx_n_s_62); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17582
20530
  __Pyx_GOTREF(__pyx_t_3);
17583
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17584
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ObjectDeleted, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20531
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
20532
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ObjectDeleted, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17585
20533
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17586
 
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
20534
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
17587
20535
 
17588
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":99
17589
 
 *     pass
 
20536
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":136
 
20537
 * 
17590
20538
 * 
17591
20539
 * class HttpRequestDeleted(ObjectDeleted):             # <<<<<<<<<<<<<<
17592
20540
 *     """Raised when an attribute is accessed of http_request instance whose _obj is 0"""
17593
20541
 * 
17594
20542
 */
17595
 
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20543
  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20544
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
 
20545
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ObjectDeleted); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20546
  __Pyx_GOTREF(__pyx_t_3);
 
20547
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17596
20548
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
17597
 
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ObjectDeleted); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17598
 
  __Pyx_GOTREF(__pyx_t_3);
17599
 
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17600
 
  __Pyx_GOTREF(__pyx_t_4);
17601
 
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
 
20549
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
17602
20550
  __Pyx_GIVEREF(__pyx_t_3);
17603
20551
  __pyx_t_3 = 0;
17604
 
  if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_57)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17605
 
  __pyx_t_3 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_1), __pyx_n_s__HttpRequestDeleted, "gevent.core"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20552
  if (PyDict_SetItemString(((PyObject *)__pyx_t_8), "__doc__", ((PyObject *)__pyx_kp_s_68)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20553
  __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_8), __pyx_n_s__HttpRequestDeleted, __pyx_n_s_62); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17606
20554
  __Pyx_GOTREF(__pyx_t_3);
17607
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17608
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__HttpRequestDeleted, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20555
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
20556
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__HttpRequestDeleted, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17609
20557
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17610
 
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
20558
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
17611
20559
 
17612
 
  /* "/home/denis/work/gevent/gevent/evhttp.pxi":102
17613
 
 *     """Raised when an attribute is accessed of http_request instance whose _obj is 0"""
 
20560
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":140
 
20561
 * 
17614
20562
 * 
17615
20563
 * class HttpConnectionDeleted(ObjectDeleted):             # <<<<<<<<<<<<<<
17616
20564
 *     """Raised when an attribute is accessed of http_connection instance whose _obj is 0"""
17617
20565
 * 
17618
20566
 */
17619
 
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20567
  __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20568
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
 
20569
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ObjectDeleted); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20570
  __Pyx_GOTREF(__pyx_t_3);
 
20571
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17620
20572
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
17621
 
  __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__ObjectDeleted); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17622
 
  __Pyx_GOTREF(__pyx_t_3);
17623
 
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17624
 
  __Pyx_GOTREF(__pyx_t_4);
17625
 
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
 
20573
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
17626
20574
  __Pyx_GIVEREF(__pyx_t_3);
17627
20575
  __pyx_t_3 = 0;
17628
 
  if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_58)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17629
 
  __pyx_t_3 = __Pyx_CreateClass(__pyx_t_4, ((PyObject *)__pyx_t_1), __pyx_n_s_32, "gevent.core"); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20576
  if (PyDict_SetItemString(((PyObject *)__pyx_t_8), "__doc__", ((PyObject *)__pyx_kp_s_69)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20577
  __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_8), __pyx_n_s_38, __pyx_n_s_62); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17630
20578
  __Pyx_GOTREF(__pyx_t_3);
17631
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17632
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_32, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17633
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17634
20579
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
17635
 
 
17636
 
  /* "/home/denis/work/gevent/gevent/core.pyx":1
 
20580
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_38, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20581
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
20582
  __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
 
20583
 
 
20584
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":403
 
20585
 *     cdef public object default_response_headers
 
20586
 * 
 
20587
 *     def __init__(self, size_t obj, object default_response_headers=[]):             # <<<<<<<<<<<<<<
 
20588
 *         http_request_base.__init__(self, obj)
 
20589
 *         self.default_response_headers = default_response_headers
 
20590
 */
 
20591
  __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20592
  __Pyx_GOTREF(((PyObject *)__pyx_t_8));
 
20593
  __pyx_k_33 = ((PyObject *)__pyx_t_8);
 
20594
  __Pyx_GIVEREF(__pyx_t_8);
 
20595
  __pyx_t_8 = 0;
 
20596
 
 
20597
  /* "/home/denis/tmp/gevent-0.13/gevent/evhttp.pxi":515
 
20598
 * 
 
20599
 *     @classmethod
 
20600
 *     def new(cls, char* address, unsigned short port):             # <<<<<<<<<<<<<<
 
20601
 *         cdef void* ptr = evhttp_connection_new(address, port)
 
20602
 *         if ptr != NULL:
 
20603
 */
 
20604
  __pyx_t_8 = __Pyx_GetName((PyObject *)__pyx_ptype_6gevent_4core_http_connection, __pyx_n_s__new); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20605
  __Pyx_GOTREF(__pyx_t_8);
 
20606
  __pyx_t_3 = __Pyx_Method_ClassMethod(__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20607
  __Pyx_GOTREF(__pyx_t_3);
 
20608
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
20609
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_4core_http_connection->tp_dict, __pyx_n_s__new, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20610
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
20611
  PyType_Modified(__pyx_ptype_6gevent_4core_http_connection);
 
20612
 
 
20613
  /* "gevent/core.pyx":466
 
20614
 * include "evhttp.pxi"
 
20615
 * 
 
20616
 * def set_exc_info(object type, object value):             # <<<<<<<<<<<<<<
 
20617
 *     cdef PyThreadState* tstate = PyThreadState_GET()
 
20618
 *     Py_XDECREF(tstate.exc_type)
 
20619
 */
 
20620
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_14set_exc_info, NULL, __pyx_n_s_62); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20621
  __Pyx_GOTREF(__pyx_t_3);
 
20622
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__set_exc_info, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20623
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
20624
 
 
20625
  /* "gevent/core.pyx":1
17637
20626
 * #             # <<<<<<<<<<<<<<
17638
20627
 * # event.pyx
17639
20628
 * #
17640
20629
 */
17641
 
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17642
 
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
17643
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__event); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17644
 
  __Pyx_GOTREF(__pyx_t_3);
17645
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__add); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17646
 
  __Pyx_GOTREF(__pyx_t_4);
17647
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17648
 
  __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__");
17649
 
  __Pyx_GOTREF(__pyx_t_3);
17650
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17651
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_59), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17652
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17653
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__event); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17654
 
  __Pyx_GOTREF(__pyx_t_3);
17655
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__cancel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17656
 
  __Pyx_GOTREF(__pyx_t_4);
17657
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17658
 
  __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__");
17659
 
  __Pyx_GOTREF(__pyx_t_3);
17660
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17661
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_60), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17662
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17663
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__init); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17664
 
  __Pyx_GOTREF(__pyx_t_3);
17665
 
  __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
17666
 
  __Pyx_GOTREF(__pyx_t_4);
17667
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17668
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_61), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17669
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17670
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__dispatch); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17671
 
  __Pyx_GOTREF(__pyx_t_4);
17672
 
  __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__");
17673
 
  __Pyx_GOTREF(__pyx_t_3);
17674
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17675
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_62), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17676
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17677
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__loop); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17678
 
  __Pyx_GOTREF(__pyx_t_3);
17679
 
  __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
17680
 
  __Pyx_GOTREF(__pyx_t_4);
17681
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17682
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_63), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17683
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17684
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__get_version); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17685
 
  __Pyx_GOTREF(__pyx_t_4);
17686
 
  __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__");
17687
 
  __Pyx_GOTREF(__pyx_t_3);
17688
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17689
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_64), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17690
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17691
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__get_method); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17692
 
  __Pyx_GOTREF(__pyx_t_3);
17693
 
  __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
17694
 
  __Pyx_GOTREF(__pyx_t_4);
17695
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17696
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_65), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17697
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17698
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__get_header_version); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17699
 
  __Pyx_GOTREF(__pyx_t_4);
17700
 
  __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__");
17701
 
  __Pyx_GOTREF(__pyx_t_3);
17702
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17703
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_66), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17704
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17705
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__reinit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17706
 
  __Pyx_GOTREF(__pyx_t_3);
17707
 
  __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
17708
 
  __Pyx_GOTREF(__pyx_t_4);
17709
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17710
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_67), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17711
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17712
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__dns_init); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17713
 
  __Pyx_GOTREF(__pyx_t_4);
17714
 
  __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__");
17715
 
  __Pyx_GOTREF(__pyx_t_3);
17716
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17717
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_68), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17718
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17719
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__dns_shutdown); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17720
 
  __Pyx_GOTREF(__pyx_t_3);
17721
 
  __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
17722
 
  __Pyx_GOTREF(__pyx_t_4);
17723
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17724
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_69), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17725
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17726
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__dns_resolve_ipv4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17727
 
  __Pyx_GOTREF(__pyx_t_4);
17728
 
  __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__");
17729
 
  __Pyx_GOTREF(__pyx_t_3);
17730
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17731
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_70), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17732
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17733
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s__dns_resolve_ipv6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17734
 
  __Pyx_GOTREF(__pyx_t_3);
17735
 
  __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
17736
 
  __Pyx_GOTREF(__pyx_t_4);
17737
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17738
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_71), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17739
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17740
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__dns_resolve_reverse); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17741
 
  __Pyx_GOTREF(__pyx_t_4);
17742
 
  __pyx_t_3 = __Pyx_GetAttrString(__pyx_t_4, "__doc__");
17743
 
  __Pyx_GOTREF(__pyx_t_3);
17744
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17745
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_72), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17746
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17747
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_m, __pyx_n_s_53); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17748
 
  __Pyx_GOTREF(__pyx_t_3);
17749
 
  __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
17750
 
  __Pyx_GOTREF(__pyx_t_4);
17751
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17752
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_73), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17753
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17754
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__buffer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17755
 
  __Pyx_GOTREF(__pyx_t_4);
17756
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__read); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17757
 
  __Pyx_GOTREF(__pyx_t_3);
17758
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17759
 
  __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
17760
 
  __Pyx_GOTREF(__pyx_t_4);
17761
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17762
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_74), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17763
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17764
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__http_request); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17765
 
  __Pyx_GOTREF(__pyx_t_4);
17766
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__remove_input_header); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17767
 
  __Pyx_GOTREF(__pyx_t_3);
17768
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17769
 
  __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
17770
 
  __Pyx_GOTREF(__pyx_t_4);
17771
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17772
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_75), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17773
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17774
 
  __pyx_t_4 = PyObject_GetAttr(__pyx_m, __pyx_n_s__http_request); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17775
 
  __Pyx_GOTREF(__pyx_t_4);
17776
 
  __pyx_t_3 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s_77); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17777
 
  __Pyx_GOTREF(__pyx_t_3);
17778
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17779
 
  __pyx_t_4 = __Pyx_GetAttrString(__pyx_t_3, "__doc__");
17780
 
  __Pyx_GOTREF(__pyx_t_4);
17781
 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17782
 
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_76), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17783
 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17784
 
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
17785
 
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
 
20630
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20631
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
 
20632
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
20633
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
17786
20634
  goto __pyx_L0;
17787
20635
  __pyx_L1_error:;
17788
20636
  __Pyx_XDECREF(__pyx_t_1);
17789
20637
  __Pyx_XDECREF(__pyx_t_2);
17790
20638
  __Pyx_XDECREF(__pyx_t_3);
17791
 
  __Pyx_XDECREF(__pyx_t_4);
 
20639
  __Pyx_XDECREF(__pyx_t_8);
17792
20640
  if (__pyx_m) {
17793
20641
    __Pyx_AddTraceback("init gevent.core");
17794
20642
    Py_DECREF(__pyx_m); __pyx_m = 0;
17804
20652
  #endif
17805
20653
}
17806
20654
 
17807
 
static const char *__pyx_filenames[] = {
17808
 
  "core.pyx",
17809
 
  "evhttp.pxi",
17810
 
  "evbuffer.pxi",
17811
 
  "evdns.pxi",
17812
 
};
17813
 
 
17814
20655
/* Runtime support code */
17815
20656
 
17816
 
static void __pyx_init_filenames(void) {
17817
 
  __pyx_f = __pyx_filenames;
 
20657
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
 
20658
    PyObject *result;
 
20659
    result = PyObject_GetAttr(dict, name);
 
20660
    if (!result)
 
20661
        PyErr_SetObject(PyExc_NameError, name);
 
20662
    return result;
17818
20663
}
17819
20664
 
17820
20665
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
17890
20735
}
17891
20736
 
17892
20737
 
17893
 
static void __Pyx_RaiseDoubleKeywordsError(
17894
 
    const char* func_name,
17895
 
    PyObject* kw_name)
17896
 
{
17897
 
    PyErr_Format(PyExc_TypeError,
17898
 
        #if PY_MAJOR_VERSION >= 3
17899
 
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
17900
 
        #else
17901
 
        "%s() got multiple values for keyword argument '%s'", func_name,
17902
 
        PyString_AS_STRING(kw_name));
17903
 
        #endif
17904
 
}
17905
 
 
17906
20738
static void __Pyx_RaiseArgtupleInvalid(
17907
20739
    const char* func_name,
17908
20740
    int exact,
17933
20765
        func_name, more_or_less, num_expected, number, num_found);
17934
20766
}
17935
20767
 
 
20768
static void __Pyx_RaiseDoubleKeywordsError(
 
20769
    const char* func_name,
 
20770
    PyObject* kw_name)
 
20771
{
 
20772
    PyErr_Format(PyExc_TypeError,
 
20773
        #if PY_MAJOR_VERSION >= 3
 
20774
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
 
20775
        #else
 
20776
        "%s() got multiple values for keyword argument '%s'", func_name,
 
20777
        PyString_AS_STRING(kw_name));
 
20778
        #endif
 
20779
}
 
20780
 
17936
20781
static int __Pyx_ParseOptionalKeywords(
17937
20782
    PyObject *kwds,
17938
20783
    PyObject **argnames[],
18022
20867
                 (index == 1) ? "" : "s");
18023
20868
}
18024
20869
 
18025
 
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(void) {
18026
 
    PyErr_SetString(PyExc_ValueError, "too many values to unpack");
 
20870
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
 
20871
    PyErr_Format(PyExc_ValueError,
 
20872
        #if PY_VERSION_HEX < 0x02050000
 
20873
            "too many values to unpack (expected %d)", (int)expected);
 
20874
        #else
 
20875
            "too many values to unpack (expected %zd)", expected);
 
20876
        #endif
18027
20877
}
18028
20878
 
18029
20879
static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
18036
20886
    return item;
18037
20887
}
18038
20888
 
18039
 
static int __Pyx_EndUnpack(PyObject *iter) {
 
20889
static int __Pyx_EndUnpack(PyObject *iter, Py_ssize_t expected) {
18040
20890
    PyObject *item;
18041
20891
    if ((item = PyIter_Next(iter))) {
18042
20892
        Py_DECREF(item);
18043
 
        __Pyx_RaiseTooManyValuesError();
 
20893
        __Pyx_RaiseTooManyValuesError(expected);
18044
20894
        return -1;
18045
20895
    }
18046
20896
    else if (!PyErr_Occurred())
18049
20899
        return -1;
18050
20900
}
18051
20901
 
 
20902
#if PY_MAJOR_VERSION < 3
 
20903
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
 
20904
    Py_XINCREF(type);
 
20905
    Py_XINCREF(value);
 
20906
    Py_XINCREF(tb);
 
20907
    /* First, check the traceback argument, replacing None with NULL. */
 
20908
    if (tb == Py_None) {
 
20909
        Py_DECREF(tb);
 
20910
        tb = 0;
 
20911
    }
 
20912
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
 
20913
        PyErr_SetString(PyExc_TypeError,
 
20914
            "raise: arg 3 must be a traceback or None");
 
20915
        goto raise_error;
 
20916
    }
 
20917
    /* Next, replace a missing value with None */
 
20918
    if (value == NULL) {
 
20919
        value = Py_None;
 
20920
        Py_INCREF(value);
 
20921
    }
 
20922
    #if PY_VERSION_HEX < 0x02050000
 
20923
    if (!PyClass_Check(type))
 
20924
    #else
 
20925
    if (!PyType_Check(type))
 
20926
    #endif
 
20927
    {
 
20928
        /* Raising an instance.  The value should be a dummy. */
 
20929
        if (value != Py_None) {
 
20930
            PyErr_SetString(PyExc_TypeError,
 
20931
                "instance exception may not have a separate value");
 
20932
            goto raise_error;
 
20933
        }
 
20934
        /* Normalize to raise <class>, <instance> */
 
20935
        Py_DECREF(value);
 
20936
        value = type;
 
20937
        #if PY_VERSION_HEX < 0x02050000
 
20938
            if (PyInstance_Check(type)) {
 
20939
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
 
20940
                Py_INCREF(type);
 
20941
            }
 
20942
            else {
 
20943
                type = 0;
 
20944
                PyErr_SetString(PyExc_TypeError,
 
20945
                    "raise: exception must be an old-style class or instance");
 
20946
                goto raise_error;
 
20947
            }
 
20948
        #else
 
20949
            type = (PyObject*) Py_TYPE(type);
 
20950
            Py_INCREF(type);
 
20951
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
 
20952
                PyErr_SetString(PyExc_TypeError,
 
20953
                    "raise: exception class must be a subclass of BaseException");
 
20954
                goto raise_error;
 
20955
            }
 
20956
        #endif
 
20957
    }
 
20958
 
 
20959
    __Pyx_ErrRestore(type, value, tb);
 
20960
    return;
 
20961
raise_error:
 
20962
    Py_XDECREF(value);
 
20963
    Py_XDECREF(type);
 
20964
    Py_XDECREF(tb);
 
20965
    return;
 
20966
}
 
20967
 
 
20968
#else /* Python 3+ */
 
20969
 
 
20970
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
 
20971
    if (tb == Py_None) {
 
20972
        tb = 0;
 
20973
    } else if (tb && !PyTraceBack_Check(tb)) {
 
20974
        PyErr_SetString(PyExc_TypeError,
 
20975
            "raise: arg 3 must be a traceback or None");
 
20976
        goto bad;
 
20977
    }
 
20978
    if (value == Py_None)
 
20979
        value = 0;
 
20980
 
 
20981
    if (PyExceptionInstance_Check(type)) {
 
20982
        if (value) {
 
20983
            PyErr_SetString(PyExc_TypeError,
 
20984
                "instance exception may not have a separate value");
 
20985
            goto bad;
 
20986
        }
 
20987
        value = type;
 
20988
        type = (PyObject*) Py_TYPE(value);
 
20989
    } else if (!PyExceptionClass_Check(type)) {
 
20990
        PyErr_SetString(PyExc_TypeError,
 
20991
            "raise: exception class must be a subclass of BaseException");
 
20992
        goto bad;
 
20993
    }
 
20994
 
 
20995
    PyErr_SetObject(type, value);
 
20996
 
 
20997
    if (tb) {
 
20998
        PyThreadState *tstate = PyThreadState_GET();
 
20999
        PyObject* tmp_tb = tstate->curexc_traceback;
 
21000
        if (tb != tmp_tb) {
 
21001
            Py_INCREF(tb);
 
21002
            tstate->curexc_traceback = tb;
 
21003
            Py_XDECREF(tmp_tb);
 
21004
        }
 
21005
    }
 
21006
 
 
21007
bad:
 
21008
    return;
 
21009
}
 
21010
#endif
 
21011
 
18052
21012
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
18053
21013
    PyObject *kwdict,
18054
21014
    const char* function_name,
18098
21058
    }
18099
21059
}
18100
21060
 
 
21061
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
 
21062
    const char *name, int exact)
 
21063
{
 
21064
    if (!type) {
 
21065
        PyErr_Format(PyExc_SystemError, "Missing type object");
 
21066
        return 0;
 
21067
    }
 
21068
    if (none_allowed && obj == Py_None) return 1;
 
21069
    else if (exact) {
 
21070
        if (Py_TYPE(obj) == type) return 1;
 
21071
    }
 
21072
    else {
 
21073
        if (PyObject_TypeCheck(obj, type)) return 1;
 
21074
    }
 
21075
    PyErr_Format(PyExc_TypeError,
 
21076
        "Argument '%s' has incorrect type (expected %s, got %s)",
 
21077
        name, type->tp_name, Py_TYPE(obj)->tp_name);
 
21078
    return 0;
 
21079
}
 
21080
 
18101
21081
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
18102
21082
    if (unlikely(!type)) {
18103
21083
        PyErr_Format(PyExc_SystemError, "Missing type object");
18136
21116
}
18137
21117
 
18138
21118
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
18139
 
    PyObject *__import__ = 0;
 
21119
    PyObject *py_import = 0;
18140
21120
    PyObject *empty_list = 0;
18141
21121
    PyObject *module = 0;
18142
21122
    PyObject *global_dict = 0;
18143
21123
    PyObject *empty_dict = 0;
18144
21124
    PyObject *list;
18145
 
    __import__ = __Pyx_GetAttrString(__pyx_b, "__import__");
18146
 
    if (!__import__)
 
21125
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
 
21126
    if (!py_import)
18147
21127
        goto bad;
18148
21128
    if (from_list)
18149
21129
        list = from_list;
18159
21139
    empty_dict = PyDict_New();
18160
21140
    if (!empty_dict)
18161
21141
        goto bad;
18162
 
    module = PyObject_CallFunctionObjArgs(__import__,
 
21142
    module = PyObject_CallFunctionObjArgs(py_import,
18163
21143
        name, global_dict, empty_dict, list, NULL);
18164
21144
bad:
18165
21145
    Py_XDECREF(empty_list);
18166
 
    Py_XDECREF(__import__);
 
21146
    Py_XDECREF(py_import);
18167
21147
    Py_XDECREF(empty_dict);
18168
21148
    return module;
18169
21149
}
18170
21150
 
18171
 
static PyObject *__Pyx_CreateClass(
18172
 
    PyObject *bases, PyObject *dict, PyObject *name, const char *modname)
18173
 
{
18174
 
    PyObject *py_modname;
18175
 
    PyObject *result = 0;
18176
 
 
18177
 
    #if PY_MAJOR_VERSION < 3
18178
 
    py_modname = PyString_FromString(modname);
18179
 
    #else
18180
 
    py_modname = PyUnicode_FromString(modname);
18181
 
    #endif
18182
 
    if (!py_modname)
18183
 
        goto bad;
18184
 
    if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
18185
 
        goto bad;
18186
 
    #if PY_MAJOR_VERSION < 3
18187
 
    result = PyClass_New(bases, dict, name);
18188
 
    #else
18189
 
    result = PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, name, bases, dict, NULL);
18190
 
    #endif
18191
 
bad:
18192
 
    Py_XDECREF(py_modname);
18193
 
    return result;
 
21151
static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
 
21152
    PyObject *metaclass;
 
21153
    /* Default metaclass */
 
21154
#if PY_MAJOR_VERSION < 3
 
21155
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
 
21156
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
 
21157
        metaclass = PyObject_GetAttrString(base, "__class__");
 
21158
        if (!metaclass) {
 
21159
            PyErr_Clear();
 
21160
            metaclass = (PyObject*) Py_TYPE(base);
 
21161
        }
 
21162
    } else {
 
21163
        metaclass = (PyObject *) &PyClass_Type;
 
21164
    }
 
21165
#else
 
21166
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
 
21167
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
 
21168
        metaclass = (PyObject*) Py_TYPE(base);
 
21169
    } else {
 
21170
        metaclass = (PyObject *) &PyType_Type;
 
21171
    }
 
21172
#endif
 
21173
    Py_INCREF(metaclass);
 
21174
    return metaclass;
18194
21175
}
18195
21176
 
18196
 
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
 
21177
static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
 
21178
                                   PyObject *modname) {
18197
21179
    PyObject *result;
18198
 
    result = PyObject_GetAttr(dict, name);
18199
 
    if (!result)
18200
 
        PyErr_SetObject(PyExc_NameError, name);
 
21180
    PyObject *metaclass;
 
21181
 
 
21182
    if (PyDict_SetItemString(dict, "__module__", modname) < 0)
 
21183
        return NULL;
 
21184
 
 
21185
    /* Python2 __metaclass__ */
 
21186
    metaclass = PyDict_GetItemString(dict, "__metaclass__");
 
21187
    if (metaclass) {
 
21188
        Py_INCREF(metaclass);
 
21189
    } else {
 
21190
        metaclass = __Pyx_FindPy2Metaclass(bases);
 
21191
    }
 
21192
    result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL);
 
21193
    Py_DECREF(metaclass);
18201
21194
    return result;
18202
21195
}
18203
21196
 
18204
 
#if PY_MAJOR_VERSION < 3
18205
 
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
18206
 
    Py_XINCREF(type);
18207
 
    Py_XINCREF(value);
18208
 
    Py_XINCREF(tb);
18209
 
    /* First, check the traceback argument, replacing None with NULL. */
18210
 
    if (tb == Py_None) {
18211
 
        Py_DECREF(tb);
18212
 
        tb = 0;
18213
 
    }
18214
 
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
18215
 
        PyErr_SetString(PyExc_TypeError,
18216
 
            "raise: arg 3 must be a traceback or None");
18217
 
        goto raise_error;
18218
 
    }
18219
 
    /* Next, replace a missing value with None */
18220
 
    if (value == NULL) {
18221
 
        value = Py_None;
18222
 
        Py_INCREF(value);
18223
 
    }
18224
 
    #if PY_VERSION_HEX < 0x02050000
18225
 
    if (!PyClass_Check(type))
18226
 
    #else
18227
 
    if (!PyType_Check(type))
18228
 
    #endif
18229
 
    {
18230
 
        /* Raising an instance.  The value should be a dummy. */
18231
 
        if (value != Py_None) {
18232
 
            PyErr_SetString(PyExc_TypeError,
18233
 
                "instance exception may not have a separate value");
18234
 
            goto raise_error;
18235
 
        }
18236
 
        /* Normalize to raise <class>, <instance> */
18237
 
        Py_DECREF(value);
18238
 
        value = type;
18239
 
        #if PY_VERSION_HEX < 0x02050000
18240
 
            if (PyInstance_Check(type)) {
18241
 
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
18242
 
                Py_INCREF(type);
18243
 
            }
18244
 
            else {
18245
 
                type = 0;
18246
 
                PyErr_SetString(PyExc_TypeError,
18247
 
                    "raise: exception must be an old-style class or instance");
18248
 
                goto raise_error;
18249
 
            }
 
21197
 
 
21198
static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module) {
 
21199
        __pyx_binding_PyCFunctionType_object *op = PyObject_GC_New(__pyx_binding_PyCFunctionType_object, __pyx_binding_PyCFunctionType);
 
21200
    if (op == NULL)
 
21201
        return NULL;
 
21202
        op->func.m_ml = ml;
 
21203
        Py_XINCREF(self);
 
21204
        op->func.m_self = self;
 
21205
        Py_XINCREF(module);
 
21206
        op->func.m_module = module;
 
21207
        PyObject_GC_Track(op);
 
21208
        return (PyObject *)op;
 
21209
}
 
21210
 
 
21211
static void __pyx_binding_PyCFunctionType_dealloc(__pyx_binding_PyCFunctionType_object *m) {
 
21212
        PyObject_GC_UnTrack(m);
 
21213
        Py_XDECREF(m->func.m_self);
 
21214
        Py_XDECREF(m->func.m_module);
 
21215
    PyObject_GC_Del(m);
 
21216
}
 
21217
 
 
21218
static PyObject *__pyx_binding_PyCFunctionType_descr_get(PyObject *func, PyObject *obj, PyObject *type) {
 
21219
        if (obj == Py_None)
 
21220
                obj = NULL;
 
21221
        return PyMethod_New(func, obj, type);
 
21222
}
 
21223
 
 
21224
static int __pyx_binding_PyCFunctionType_init(void) {
 
21225
    __pyx_binding_PyCFunctionType_type = PyCFunction_Type;
 
21226
    __pyx_binding_PyCFunctionType_type.tp_name = __Pyx_NAMESTR("cython_binding_builtin_function_or_method");
 
21227
    __pyx_binding_PyCFunctionType_type.tp_dealloc = (destructor)__pyx_binding_PyCFunctionType_dealloc;
 
21228
    __pyx_binding_PyCFunctionType_type.tp_descr_get = __pyx_binding_PyCFunctionType_descr_get;
 
21229
    if (PyType_Ready(&__pyx_binding_PyCFunctionType_type) < 0) {
 
21230
        return -1;
 
21231
    }
 
21232
    __pyx_binding_PyCFunctionType = &__pyx_binding_PyCFunctionType_type;
 
21233
    return 0;
 
21234
 
 
21235
}
 
21236
 
 
21237
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
 
21238
    /* It appears that PyMethodDescr_Type is not anywhere exposed in the Python/C API */
 
21239
    static PyTypeObject *methoddescr_type = NULL;
 
21240
    if (methoddescr_type == NULL) {
 
21241
       PyObject *meth = __Pyx_GetAttrString((PyObject*)&PyList_Type, "append");
 
21242
       if (!meth) return NULL;
 
21243
       methoddescr_type = Py_TYPE(meth);
 
21244
       Py_DECREF(meth);
 
21245
    }
 
21246
    if (PyObject_TypeCheck(method, methoddescr_type)) { /* cdef classes */
 
21247
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
 
21248
        #if PY_VERSION_HEX < 0x03020000
 
21249
        PyTypeObject *d_type = descr->d_type;
18250
21250
        #else
18251
 
            type = (PyObject*) Py_TYPE(type);
18252
 
            Py_INCREF(type);
18253
 
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
18254
 
                PyErr_SetString(PyExc_TypeError,
18255
 
                    "raise: exception class must be a subclass of BaseException");
18256
 
                goto raise_error;
18257
 
            }
 
21251
        PyTypeObject *d_type = descr->d_common.d_type;
18258
21252
        #endif
18259
 
    }
18260
 
 
18261
 
    __Pyx_ErrRestore(type, value, tb);
18262
 
    return;
18263
 
raise_error:
18264
 
    Py_XDECREF(value);
18265
 
    Py_XDECREF(type);
18266
 
    Py_XDECREF(tb);
18267
 
    return;
18268
 
}
18269
 
 
18270
 
#else /* Python 3+ */
18271
 
 
18272
 
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
18273
 
    if (tb == Py_None) {
18274
 
        tb = 0;
18275
 
    } else if (tb && !PyTraceBack_Check(tb)) {
18276
 
        PyErr_SetString(PyExc_TypeError,
18277
 
            "raise: arg 3 must be a traceback or None");
18278
 
        goto bad;
18279
 
    }
18280
 
    if (value == Py_None)
18281
 
        value = 0;
18282
 
 
18283
 
    if (PyExceptionInstance_Check(type)) {
18284
 
        if (value) {
18285
 
            PyErr_SetString(PyExc_TypeError,
18286
 
                "instance exception may not have a separate value");
18287
 
            goto bad;
18288
 
        }
18289
 
        value = type;
18290
 
        type = (PyObject*) Py_TYPE(value);
18291
 
    } else if (!PyExceptionClass_Check(type)) {
18292
 
        PyErr_SetString(PyExc_TypeError,
18293
 
            "raise: exception class must be a subclass of BaseException");
18294
 
        goto bad;
18295
 
    }
18296
 
 
18297
 
    PyErr_SetObject(type, value);
18298
 
 
18299
 
    if (tb) {
18300
 
        PyThreadState *tstate = PyThreadState_GET();
18301
 
        PyObject* tmp_tb = tstate->curexc_traceback;
18302
 
        if (tb != tmp_tb) {
18303
 
            Py_INCREF(tb);
18304
 
            tstate->curexc_traceback = tb;
18305
 
            Py_XDECREF(tmp_tb);
18306
 
        }
18307
 
    }
18308
 
 
18309
 
bad:
18310
 
    return;
18311
 
}
 
21253
        return PyDescr_NewClassMethod(d_type, descr->d_method);
 
21254
    }
 
21255
    else if (PyMethod_Check(method)) { /* python classes */
 
21256
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
 
21257
    }
 
21258
    else if (PyCFunction_Check(method)) {
 
21259
        return PyClassMethod_New(method);
 
21260
    }
 
21261
#ifdef __pyx_binding_PyCFunctionType_USED
 
21262
    else if (PyObject_TypeCheck(method, __pyx_binding_PyCFunctionType)) { /* binded CFunction */
 
21263
        return PyClassMethod_New(method);
 
21264
    }
18312
21265
#endif
 
21266
    PyErr_Format(PyExc_TypeError,
 
21267
                 "Class-level classmethod() can only be called on "
 
21268
                 "a method_descriptor or instance method.");
 
21269
    return NULL;
 
21270
}
18313
21271
 
18314
21272
static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_ev_uint16_t(ev_uint16_t val) {
18315
 
    const ev_uint16_t neg_one = (ev_uint16_t)-1, const_zero = 0;
18316
 
    const int is_unsigned = neg_one > const_zero;
18317
 
    if (sizeof(ev_uint16_t) <  sizeof(long)) {
 
21273
    const ev_uint16_t neg_one = (ev_uint16_t)-1, const_zero = (ev_uint16_t)0;
 
21274
    const int is_unsigned = const_zero < neg_one;
 
21275
    if ((sizeof(ev_uint16_t) == sizeof(char))  ||
 
21276
        (sizeof(ev_uint16_t) == sizeof(short))) {
18318
21277
        return PyInt_FromLong((long)val);
18319
 
    } else if (sizeof(ev_uint16_t) == sizeof(long)) {
 
21278
    } else if ((sizeof(ev_uint16_t) == sizeof(int)) ||
 
21279
               (sizeof(ev_uint16_t) == sizeof(long))) {
18320
21280
        if (is_unsigned)
18321
21281
            return PyLong_FromUnsignedLong((unsigned long)val);
18322
21282
        else
18323
21283
            return PyInt_FromLong((long)val);
18324
 
    } else { /* (sizeof(ev_uint16_t) > sizeof(long)) */
 
21284
    } else if (sizeof(ev_uint16_t) == sizeof(PY_LONG_LONG)) {
18325
21285
        if (is_unsigned)
18326
21286
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
18327
21287
        else
18328
21288
            return PyLong_FromLongLong((PY_LONG_LONG)val);
 
21289
    } else {
 
21290
        int one = 1; int little = (int)*(unsigned char *)&one;
 
21291
        unsigned char *bytes = (unsigned char *)&val;
 
21292
        return _PyLong_FromByteArray(bytes, sizeof(ev_uint16_t), 
 
21293
                                     little, !is_unsigned);
18329
21294
    }
18330
21295
}
18331
21296
 
18500
21465
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
18501
21466
}
18502
21467
 
 
21468
static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
 
21469
    const int neg_one = (int)-1, const_zero = 0;
 
21470
    const int is_unsigned = neg_one > const_zero;
 
21471
    if (sizeof(int) < sizeof(long)) {
 
21472
        long val = __Pyx_PyInt_AsLong(x);
 
21473
        if (unlikely(val != (long)(int)val)) {
 
21474
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
21475
                PyErr_SetString(PyExc_OverflowError,
 
21476
                    (is_unsigned && unlikely(val < 0)) ?
 
21477
                    "can't convert negative value to int" :
 
21478
                    "value too large to convert to int");
 
21479
            }
 
21480
            return (int)-1;
 
21481
        }
 
21482
        return (int)val;
 
21483
    }
 
21484
    return (int)__Pyx_PyInt_AsLong(x);
 
21485
}
 
21486
 
18503
21487
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
18504
21488
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
18505
21489
    const int is_unsigned = neg_one > const_zero;
18729
21713
}
18730
21714
 
18731
21715
static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
18732
 
#if PY_VERSION_HEX < 0x03010000
 
21716
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
 
21717
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
 
21718
#else
18733
21719
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
18734
 
#else
18735
 
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
18736
21720
#endif
18737
21721
    if (!ob)
18738
21722
        goto bad;
18848
21832
/* Type Conversion Functions */
18849
21833
 
18850
21834
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
18851
 
   if (x == Py_True) return 1;
18852
 
   else if ((x == Py_False) | (x == Py_None)) return 0;
 
21835
   int is_true = x == Py_True;
 
21836
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
18853
21837
   else return PyObject_IsTrue(x);
18854
21838
}
18855
21839