/* Generated by Cython 0.14.1 on Thu May  3 22:32:38 2012 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#else

#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif

#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif

#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif

#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif

#if PY_VERSION_HEX < 0x02040000
  #define METH_COEXIST 0
  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
#endif

#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
  #define PyNumber_Index(o)    PyNumber_Int(o)
  #define PyIndex_Check(o)     PyNumber_Check(o)
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
#endif

#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)

  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;

  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)

#endif

#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#endif

#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif

#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif

#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#endif

#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif

#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)

#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif


#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif

#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE_API__pulsar__lib___pulsar
#include "stdlib.h"
#include "stdio.h"
#include "pythread.h"
#include "http_parser.h"

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif


/* inline attribute */
#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

/* unused attribute */
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || defined(__INTEL_COMPILER)
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif

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*/


/* Type Conversion Predeclarations */

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))

#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);

#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))


#ifdef __GNUC__
/* Test for GCC > 2.95 */
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
#define likely(x)   __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ > 2 ... */
#define likely(x)   (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x)   (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "parser.pyx",
  "http.pxd",
  "bool.pxd",
  "complex.pxd",
};

/* Type declarations */

/* "lib/src/parser.pyx":62
 * 
 * 
 * cdef class HttpParser:             # <<<<<<<<<<<<<<
 *     """Cython HTTP parser wrapping http_parser."""
 * 
 */

struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser {
  PyObject_HEAD
  struct http_parser _parser;
  struct http_parser_settings _settings;
  PyObject *_data;
  PyObject *_path;
  PyObject *_query_string;
  PyObject *_fragment;
  PyObject *_parsed_url;
};

#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif

#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
  end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
  }
  #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
#else
  #define __Pyx_RefNannySetupContext(name)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
#endif /* CYTHON_REFNANNY */
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name, PyObject* kw_name); /*proto*/

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/

static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (PyList_Append(L, x) < 0) return NULL;
        Py_INCREF(Py_None);
        return Py_None; /* this is just to have an accurate signature */
    }
    else {
        PyObject *r, *m;
        m = __Pyx_GetAttrString(L, "append");
        if (!m) return NULL;
        r = PyObject_CallFunctionObjArgs(m, x, NULL);
        Py_DECREF(m);
        return r;
    }
}


static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}


#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_List_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
    if (likely(o != Py_None)) {
        if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
            PyObject *r = PyList_GET_ITEM(o, i);
            Py_INCREF(r);
            return r;
        }
        else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
            PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
            Py_INCREF(r);
            return r;
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
    if (likely(o != Py_None)) {
        if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, i);
            Py_INCREF(r);
            return r;
        }
        else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
            PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
            Py_INCREF(r);
            return r;
        }
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}


#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Fast(o, i) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
    PyObject *r;
    if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
    }
    else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
    }
    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
        r = PySequence_GetItem(o, i);
    }
    else {
        r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
    }
    return r;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *modname); /*proto*/

#define __pyx_binding_PyCFunctionType_USED 1

typedef struct {
    PyCFunctionObject func;
} __pyx_binding_PyCFunctionType_object;

static PyTypeObject __pyx_binding_PyCFunctionType_type;
static PyTypeObject *__pyx_binding_PyCFunctionType = NULL;

static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module); /* proto */
#define __pyx_binding_PyCFunctionType_New(ml, self) __pyx_binding_PyCFunctionType_NewEx(ml, self, NULL)

static int __pyx_binding_PyCFunctionType_init(void); /* proto */

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static void __Pyx_WriteUnraisable(const char *name); /*proto*/

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict);  /*proto*/

static PyObject *__Pyx_ImportModule(const char *name); /*proto*/

static void __Pyx_AddTraceback(const char *funcname); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
/* Module declarations from libc.stdlib */

/* Module declarations from cpython.version */

/* Module declarations from cpython.ref */

/* Module declarations from cpython.exc */

/* Module declarations from cpython.module */

/* Module declarations from cpython.mem */

/* Module declarations from cpython.tuple */

/* Module declarations from cpython.list */

/* Module declarations from libc.stdio */

/* Module declarations from cpython.object */

/* Module declarations from cpython.sequence */

/* Module declarations from cpython.mapping */

/* Module declarations from cpython.iterator */

/* Module declarations from cpython.type */

/* Module declarations from cpython.number */

/* Module declarations from cpython.int */

/* Module declarations from __builtin__ */

/* Module declarations from cpython.bool */

static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
/* Module declarations from cpython.long */

/* Module declarations from cpython.float */

/* Module declarations from __builtin__ */

/* Module declarations from cpython.complex */

static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
/* Module declarations from cpython.string */

/* Module declarations from cpython.unicode */

/* Module declarations from cpython.dict */

/* Module declarations from cpython.instance */

/* Module declarations from cpython.function */

/* Module declarations from cpython.method */

/* Module declarations from cpython.weakref */

/* Module declarations from cpython.getargs */

/* Module declarations from cpython.pythread */

/* Module declarations from cpython.cobject */

/* Module declarations from cpython.oldbuffer */

/* Module declarations from cpython.set */

/* Module declarations from cpython.buffer */

/* Module declarations from cpython.bytes */

/* Module declarations from cpython.pycapsule */

/* Module declarations from cpython */

/* Module declarations from http */

static CYTHON_INLINE PyObject *__pyx_f_4http_bytes_to_str(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_4http_on_url_cb(struct http_parser *, char *, size_t); /*proto*/
static CYTHON_INLINE int __pyx_f_4http_on_header_field_cb(struct http_parser *, char *, size_t); /*proto*/
static CYTHON_INLINE int __pyx_f_4http_on_header_value_cb(struct http_parser *, char *, size_t); /*proto*/
static CYTHON_INLINE int __pyx_f_4http_on_headers_complete_cb(struct http_parser *); /*proto*/
static CYTHON_INLINE int __pyx_f_4http_on_message_begin_cb(struct http_parser *); /*proto*/
static CYTHON_INLINE int __pyx_f_4http_on_body_cb(struct http_parser *, char *, size_t); /*proto*/
static CYTHON_INLINE int __pyx_f_4http_on_message_complete_cb(struct http_parser *); /*proto*/
/* Module declarations from pulsar.lib._pulsar */

static PyTypeObject *__pyx_ptype_6pulsar_3lib_7_pulsar_HttpParser = 0;
#define __Pyx_MODULE_NAME "pulsar.lib._pulsar"
static int __pyx_module_is_main_pulsar__lib___pulsar = 0;

/* Implementation of pulsar.lib._pulsar */
static PyObject *__pyx_builtin_TypeError;
static char __pyx_k_2[] = "";
static char __pyx_k_4[] = "transfer-encoding";
static char __pyx_k_6[] = "content-encoding";
static char __pyx_k_8[] = "Original code from https://github.com/benoitc/http-parser\n\n2011 (c) Beno\303\256t Chesneau <benoitc@e-engura.org>\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\nModified and adapted for pulsar.\n";
static char __pyx_k_9[] = "urllib.parse";
static char __pyx_k_10[] = "pulsar.lib._pulsar";
static char __pyx_k__os[] = "os";
static char __pyx_k__get[] = "get";
static char __pyx_k__sys[] = "sys";
static char __pyx_k__url[] = "url";
static char __pyx_k__body[] = "body";
static char __pyx_k__data[] = "data";
static char __pyx_k__gzip[] = "gzip";
static char __pyx_k__join[] = "join";
static char __pyx_k__kind[] = "kind";
static char __pyx_k__path[] = "path";
static char __pyx_k__self[] = "self";
static char __pyx_k__zlib[] = "zlib";
static char __pyx_k___data[] = "_data";
static char __pyx_k___path[] = "_path";
static char __pyx_k__items[] = "items";
static char __pyx_k__lower[] = "lower";
static char __pyx_k__query[] = "query";
static char __pyx_k__ispy3k[] = "ispy3k";
static char __pyx_k__latin1[] = "latin1";
static char __pyx_k__length[] = "length";
static char __pyx_k__method[] = "method";
static char __pyx_k__on_url[] = "on_url";
static char __pyx_k__RAW_URI[] = "RAW_URI";
static char __pyx_k___parser[] = "_parser";
static char __pyx_k__chunked[] = "chunked";
static char __pyx_k__deflate[] = "deflate";
static char __pyx_k__environ[] = "environ";
static char __pyx_k__get_url[] = "get_url";
static char __pyx_k__headers[] = "headers";
static char __pyx_k__on_body[] = "on_body";
static char __pyx_k____init__[] = "__init__";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__fragment[] = "fragment";
static char __pyx_k__urlparse[] = "urlparse";
static char __pyx_k__urlsplit[] = "urlsplit";
static char __pyx_k__MAX_WBITS[] = "MAX_WBITS";
static char __pyx_k__TypeError[] = "TypeError";
static char __pyx_k___fragment[] = "_fragment";
static char __pyx_k___settings[] = "_settings";
static char __pyx_k__decompress[] = "decompress";
static char __pyx_k__http_major[] = "http_major";
static char __pyx_k__http_minor[] = "http_minor";
static char __pyx_k___ParserData[] = "_ParserData";
static char __pyx_k___last_field[] = "_last_field";
static char __pyx_k___parsed_url[] = "_parsed_url";
static char __pyx_k__status_code[] = "status_code";
static char __pyx_k__partial_body[] = "partial_body";
static char __pyx_k__version_info[] = "version_info";
static char __pyx_k___query_string[] = "_query_string";
static char __pyx_k__decompressobj[] = "decompressobj";
static char __pyx_k__message_begin[] = "message_begin";
static char __pyx_k___last_was_value[] = "_last_was_value";
static char __pyx_k___parser_upgrade[] = "_parser_upgrade";
static char __pyx_k__maybe_parse_url[] = "maybe_parse_url";
static char __pyx_k__on_header_field[] = "on_header_field";
static char __pyx_k__on_header_value[] = "on_header_value";
static char __pyx_k__headers_complete[] = "headers_complete";
static char __pyx_k__message_complete[] = "message_complete";
static char __pyx_k__on_message_begin[] = "on_message_begin";
static char __pyx_k__on_headers_complete[] = "on_headers_complete";
static char __pyx_k__on_message_complete[] = "on_message_complete";
static PyObject *__pyx_n_s_10;
static PyObject *__pyx_kp_b_2;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_4;
static PyObject *__pyx_kp_s_6;
static PyObject *__pyx_n_s_9;
static PyObject *__pyx_n_s__MAX_WBITS;
static PyObject *__pyx_n_s__RAW_URI;
static PyObject *__pyx_n_s__TypeError;
static PyObject *__pyx_n_s___ParserData;
static PyObject *__pyx_n_s____init__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s___data;
static PyObject *__pyx_n_s___fragment;
static PyObject *__pyx_n_s___last_field;
static PyObject *__pyx_n_s___last_was_value;
static PyObject *__pyx_n_s___parsed_url;
static PyObject *__pyx_n_s___parser;
static PyObject *__pyx_n_s___parser_upgrade;
static PyObject *__pyx_n_s___path;
static PyObject *__pyx_n_s___query_string;
static PyObject *__pyx_n_s___settings;
static PyObject *__pyx_n_s__body;
static PyObject *__pyx_n_s__chunked;
static PyObject *__pyx_n_s__data;
static PyObject *__pyx_n_s__decompress;
static PyObject *__pyx_n_s__decompressobj;
static PyObject *__pyx_n_s__deflate;
static PyObject *__pyx_n_s__environ;
static PyObject *__pyx_n_s__fragment;
static PyObject *__pyx_n_s__get;
static PyObject *__pyx_n_s__get_url;
static PyObject *__pyx_n_s__gzip;
static PyObject *__pyx_n_s__headers;
static PyObject *__pyx_n_s__headers_complete;
static PyObject *__pyx_n_s__http_major;
static PyObject *__pyx_n_s__http_minor;
static PyObject *__pyx_n_s__ispy3k;
static PyObject *__pyx_n_s__items;
static PyObject *__pyx_n_s__join;
static PyObject *__pyx_n_s__kind;
static PyObject *__pyx_n_s__latin1;
static PyObject *__pyx_n_s__length;
static PyObject *__pyx_n_s__lower;
static PyObject *__pyx_n_s__maybe_parse_url;
static PyObject *__pyx_n_s__message_begin;
static PyObject *__pyx_n_s__message_complete;
static PyObject *__pyx_n_s__method;
static PyObject *__pyx_n_s__on_body;
static PyObject *__pyx_n_s__on_header_field;
static PyObject *__pyx_n_s__on_header_value;
static PyObject *__pyx_n_s__on_headers_complete;
static PyObject *__pyx_n_s__on_message_begin;
static PyObject *__pyx_n_s__on_message_complete;
static PyObject *__pyx_n_s__on_url;
static PyObject *__pyx_n_s__os;
static PyObject *__pyx_n_s__partial_body;
static PyObject *__pyx_n_s__path;
static PyObject *__pyx_n_s__query;
static PyObject *__pyx_n_s__self;
static PyObject *__pyx_n_s__status_code;
static PyObject *__pyx_n_s__sys;
static PyObject *__pyx_n_s__url;
static PyObject *__pyx_n_s__urlparse;
static PyObject *__pyx_n_s__urlsplit;
static PyObject *__pyx_n_s__version_info;
static PyObject *__pyx_n_s__zlib;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_16;
static PyObject *__pyx_k_1;
static PyObject *__pyx_k_3;
static PyObject *__pyx_k_tuple_5;
static PyObject *__pyx_k_tuple_7;

/* "lib/src/parser.pyx":42
 * class _ParserData:
 * 
 *     def __init__(self, decompress=False):             # <<<<<<<<<<<<<<
 *         self.url = ""
 *         self.body = []
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_11_ParserData___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_6pulsar_3lib_7_pulsar_11_ParserData___init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_11_ParserData___init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_11_ParserData___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_decompress = 0;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__decompress,0};
  __Pyx_RefNannySetupContext("__init__");
  __pyx_self = __pyx_self;
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k_1;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__decompress);
        if (value) { values[1] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_self = values[0];
    __pyx_v_decompress = values[1];
  } else {
    __pyx_v_decompress = __pyx_k_1;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: __pyx_v_decompress = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pulsar.lib._pulsar._ParserData.__init__");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "lib/src/parser.pyx":43
 * 
 *     def __init__(self, decompress=False):
 *         self.url = ""             # <<<<<<<<<<<<<<
 *         self.body = []
 *         self.headers = {}
 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__url, ((PyObject *)__pyx_kp_s_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "lib/src/parser.pyx":44
 *     def __init__(self, decompress=False):
 *         self.url = ""
 *         self.body = []             # <<<<<<<<<<<<<<
 *         self.headers = {}
 *         self.environ = {}
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__body, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "lib/src/parser.pyx":45
 *         self.url = ""
 *         self.body = []
 *         self.headers = {}             # <<<<<<<<<<<<<<
 *         self.environ = {}
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__headers, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "lib/src/parser.pyx":46
 *         self.body = []
 *         self.headers = {}
 *         self.environ = {}             # <<<<<<<<<<<<<<
 * 
 *         self.decompress = decompress
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__environ, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "lib/src/parser.pyx":48
 *         self.environ = {}
 * 
 *         self.decompress = decompress             # <<<<<<<<<<<<<<
 *         self.decompressobj = None
 * 
 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__decompress, __pyx_v_decompress) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "lib/src/parser.pyx":49
 * 
 *         self.decompress = decompress
 *         self.decompressobj = None             # <<<<<<<<<<<<<<
 * 
 *         self.chunked = False
 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__decompressobj, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "lib/src/parser.pyx":51
 *         self.decompressobj = None
 * 
 *         self.chunked = False             # <<<<<<<<<<<<<<
 * 
 *         self.headers_complete = False
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__chunked, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "lib/src/parser.pyx":53
 *         self.chunked = False
 * 
 *         self.headers_complete = False             # <<<<<<<<<<<<<<
 *         self.partial_body = False
 *         self.message_begin = False
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__headers_complete, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "lib/src/parser.pyx":54
 * 
 *         self.headers_complete = False
 *         self.partial_body = False             # <<<<<<<<<<<<<<
 *         self.message_begin = False
 *         self.message_complete = False
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__partial_body, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "lib/src/parser.pyx":55
 *         self.headers_complete = False
 *         self.partial_body = False
 *         self.message_begin = False             # <<<<<<<<<<<<<<
 *         self.message_complete = False
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__message_begin, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "lib/src/parser.pyx":56
 *         self.partial_body = False
 *         self.message_begin = False
 *         self.message_complete = False             # <<<<<<<<<<<<<<
 * 
 *         self._last_field = ""
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__message_complete, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "lib/src/parser.pyx":58
 *         self.message_complete = False
 * 
 *         self._last_field = ""             # <<<<<<<<<<<<<<
 *         self._last_was_value = False
 * 
 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___last_field, ((PyObject *)__pyx_kp_s_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "lib/src/parser.pyx":59
 * 
 *         self._last_field = ""
 *         self._last_was_value = False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s___last_was_value, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pulsar.lib._pulsar._ParserData.__init__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":74
 *     cdef object _parsed_url
 * 
 *     def __init__(self, kind=2, decompress=False):             # <<<<<<<<<<<<<<
 *         """ constructor of HttpParser object.
 * :attr kind: Int,  could be 0 to parseonly requests,
 */

static int __pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser___init__[] = " constructor of HttpParser object.\n:attr kind: Int,  could be 0 to parseonly requests, \n1 to parse only responses or 2 if we want to let\nthe parser detect the type. \n        ";
struct wrapperbase __pyx_wrapperbase_6pulsar_3lib_7_pulsar_10HttpParser___init__;
static int __pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_kind = 0;
  PyObject *__pyx_v_decompress = 0;
  PyObject *__pyx_v_parser_type;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  struct http_parser *__pyx_t_3;
  enum http_parser_type __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__kind,&__pyx_n_s__decompress,0};
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)__pyx_int_2);
    values[1] = __pyx_k_3;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__kind);
        if (value) { values[0] = value; kw_args--; }
      }
      case  1:
      if (kw_args > 0) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__decompress);
        if (value) { values[1] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_kind = values[0];
    __pyx_v_decompress = values[1];
  } else {
    __pyx_v_kind = ((PyObject *)__pyx_int_2);
    __pyx_v_decompress = __pyx_k_3;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: __pyx_v_decompress = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_kind = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.__init__");
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_v_parser_type = Py_None; __Pyx_INCREF(Py_None);

  /* "lib/src/parser.pyx":81
 *         """
 *         # set parser type
 *         if kind == 2:             # <<<<<<<<<<<<<<
 *             parser_type = HTTP_BOTH
 *         elif kind == 1:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_kind, __pyx_int_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "lib/src/parser.pyx":82
 *         # set parser type
 *         if kind == 2:
 *             parser_type = HTTP_BOTH             # <<<<<<<<<<<<<<
 *         elif kind == 1:
 *             parser_type = HTTP_RESPONSE
 */
    __pyx_t_1 = PyInt_FromLong(HTTP_BOTH); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_parser_type);
    __pyx_v_parser_type = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L6;
  }

  /* "lib/src/parser.pyx":83
 *         if kind == 2:
 *             parser_type = HTTP_BOTH
 *         elif kind == 1:             # <<<<<<<<<<<<<<
 *             parser_type = HTTP_RESPONSE
 *         elif kind == 0:
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_kind, __pyx_int_1, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "lib/src/parser.pyx":84
 *             parser_type = HTTP_BOTH
 *         elif kind == 1:
 *             parser_type = HTTP_RESPONSE             # <<<<<<<<<<<<<<
 *         elif kind == 0:
 *             parser_type = HTTP_REQUEST
 */
    __pyx_t_1 = PyInt_FromLong(HTTP_RESPONSE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_parser_type);
    __pyx_v_parser_type = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L6;
  }

  /* "lib/src/parser.pyx":85
 *         elif kind == 1:
 *             parser_type = HTTP_RESPONSE
 *         elif kind == 0:             # <<<<<<<<<<<<<<
 *             parser_type = HTTP_REQUEST
 * 
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_kind, __pyx_int_0, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "lib/src/parser.pyx":86
 *             parser_type = HTTP_RESPONSE
 *         elif kind == 0:
 *             parser_type = HTTP_REQUEST             # <<<<<<<<<<<<<<
 * 
 *         # initialize parser
 */
    __pyx_t_1 = PyInt_FromLong(HTTP_REQUEST); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_v_parser_type);
    __pyx_v_parser_type = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "lib/src/parser.pyx":89
 * 
 *         # initialize parser
 *         http_parser_init(&self._parser, parser_type)             # <<<<<<<<<<<<<<
 *         self._data = _ParserData(decompress=decompress)
 *         self._parser.data = <void *>self._data
 */
  __pyx_t_3 = (&((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_parser);
  __pyx_t_4 = ((enum http_parser_type)PyInt_AsLong(__pyx_v_parser_type)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  http_parser_init(__pyx_t_3, __pyx_t_4);

  /* "lib/src/parser.pyx":90
 *         # initialize parser
 *         http_parser_init(&self._parser, parser_type)
 *         self._data = _ParserData(decompress=decompress)             # <<<<<<<<<<<<<<
 *         self._parser.data = <void *>self._data
 *         self._parsed_url = None
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___ParserData); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__decompress), __pyx_v_decompress) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data);
  __Pyx_DECREF(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data);
  ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "lib/src/parser.pyx":91
 *         http_parser_init(&self._parser, parser_type)
 *         self._data = _ParserData(decompress=decompress)
 *         self._parser.data = <void *>self._data             # <<<<<<<<<<<<<<
 *         self._parsed_url = None
 *         self._path = ""
 */
  ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_parser.data = ((void *)((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data);

  /* "lib/src/parser.pyx":92
 *         self._data = _ParserData(decompress=decompress)
 *         self._parser.data = <void *>self._data
 *         self._parsed_url = None             # <<<<<<<<<<<<<<
 *         self._path = ""
 *         self._query_string = ""
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_parsed_url);
  __Pyx_DECREF(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_parsed_url);
  ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_parsed_url = Py_None;

  /* "lib/src/parser.pyx":93
 *         self._parser.data = <void *>self._data
 *         self._parsed_url = None
 *         self._path = ""             # <<<<<<<<<<<<<<
 *         self._query_string = ""
 *         self._fragment = ""
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
  __Pyx_GOTREF(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_path);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_path));
  ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_path = __pyx_kp_s_2;

  /* "lib/src/parser.pyx":94
 *         self._parsed_url = None
 *         self._path = ""
 *         self._query_string = ""             # <<<<<<<<<<<<<<
 *         self._fragment = ""
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
  __Pyx_GOTREF(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_query_string);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_query_string));
  ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_query_string = __pyx_kp_s_2;

  /* "lib/src/parser.pyx":95
 *         self._path = ""
 *         self._query_string = ""
 *         self._fragment = ""             # <<<<<<<<<<<<<<
 * 
 *         # set callback
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
  __Pyx_GOTREF(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_fragment);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_fragment));
  ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_fragment = __pyx_kp_s_2;

  /* "lib/src/parser.pyx":98
 * 
 *         # set callback
 *         self._settings.on_url = <http_data_cb>on_url_cb             # <<<<<<<<<<<<<<
 *         self._settings.on_body = <http_data_cb>on_body_cb
 *         self._settings.on_header_field = <http_data_cb>on_header_field_cb
 */
  ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_settings.on_url = ((http_data_cb)__pyx_f_4http_on_url_cb);

  /* "lib/src/parser.pyx":99
 *         # set callback
 *         self._settings.on_url = <http_data_cb>on_url_cb
 *         self._settings.on_body = <http_data_cb>on_body_cb             # <<<<<<<<<<<<<<
 *         self._settings.on_header_field = <http_data_cb>on_header_field_cb
 *         self._settings.on_header_value = <http_data_cb>on_header_value_cb
 */
  ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_settings.on_body = ((http_data_cb)__pyx_f_4http_on_body_cb);

  /* "lib/src/parser.pyx":100
 *         self._settings.on_url = <http_data_cb>on_url_cb
 *         self._settings.on_body = <http_data_cb>on_body_cb
 *         self._settings.on_header_field = <http_data_cb>on_header_field_cb             # <<<<<<<<<<<<<<
 *         self._settings.on_header_value = <http_data_cb>on_header_value_cb
 *         self._settings.on_headers_complete = <http_cb>on_headers_complete_cb
 */
  ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_settings.on_header_field = ((http_data_cb)__pyx_f_4http_on_header_field_cb);

  /* "lib/src/parser.pyx":101
 *         self._settings.on_body = <http_data_cb>on_body_cb
 *         self._settings.on_header_field = <http_data_cb>on_header_field_cb
 *         self._settings.on_header_value = <http_data_cb>on_header_value_cb             # <<<<<<<<<<<<<<
 *         self._settings.on_headers_complete = <http_cb>on_headers_complete_cb
 *         self._settings.on_message_begin = <http_cb>on_message_begin_cb
 */
  ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_settings.on_header_value = ((http_data_cb)__pyx_f_4http_on_header_value_cb);

  /* "lib/src/parser.pyx":102
 *         self._settings.on_header_field = <http_data_cb>on_header_field_cb
 *         self._settings.on_header_value = <http_data_cb>on_header_value_cb
 *         self._settings.on_headers_complete = <http_cb>on_headers_complete_cb             # <<<<<<<<<<<<<<
 *         self._settings.on_message_begin = <http_cb>on_message_begin_cb
 *         self._settings.on_message_complete = <http_cb>on_message_complete_cb
 */
  ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_settings.on_headers_complete = ((http_cb)__pyx_f_4http_on_headers_complete_cb);

  /* "lib/src/parser.pyx":103
 *         self._settings.on_header_value = <http_data_cb>on_header_value_cb
 *         self._settings.on_headers_complete = <http_cb>on_headers_complete_cb
 *         self._settings.on_message_begin = <http_cb>on_message_begin_cb             # <<<<<<<<<<<<<<
 *         self._settings.on_message_complete = <http_cb>on_message_complete_cb
 * 
 */
  ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_settings.on_message_begin = ((http_cb)__pyx_f_4http_on_message_begin_cb);

  /* "lib/src/parser.pyx":104
 *         self._settings.on_headers_complete = <http_cb>on_headers_complete_cb
 *         self._settings.on_message_begin = <http_cb>on_message_begin_cb
 *         self._settings.on_message_complete = <http_cb>on_message_complete_cb             # <<<<<<<<<<<<<<
 * 
 *     def execute(self, char *data, size_t length):
 */
  ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_settings.on_message_complete = ((http_cb)__pyx_f_4http_on_message_complete_cb);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_parser_type);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":106
 *         self._settings.on_message_complete = <http_cb>on_message_complete_cb
 * 
 *     def execute(self, char *data, size_t length):             # <<<<<<<<<<<<<<
 *         """ Execute the parser with the last chunk. We pass the length
 *         to let the parser know when EOF has been received. In this case
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_1execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_1execute[] = " Execute the parser with the last chunk. We pass the length\n        to let the parser know when EOF has been received. In this case\n        length == 0.\n\n        :return recved: Int, received length of the data parsed. if\n        recvd != length you should return an error.\n        ";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_1execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  char *__pyx_v_data;
  size_t __pyx_v_length;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,&__pyx_n_s__length,0};
  __Pyx_RefNannySetupContext("execute");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__length);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("execute", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "execute") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_data = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_data) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_length = __Pyx_PyInt_AsSize_t(values[1]); if (unlikely((__pyx_v_length == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_data = PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_data) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_length = __Pyx_PyInt_AsSize_t(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((__pyx_v_length == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("execute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.execute");
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "lib/src/parser.pyx":114
 *         recvd != length you should return an error.
 *         """
 *         return http_parser_execute(&self._parser, &self._settings,             # <<<<<<<<<<<<<<
 *                 data, length)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "lib/src/parser.pyx":115
 *         """
 *         return http_parser_execute(&self._parser, &self._settings,
 *                 data, length)             # <<<<<<<<<<<<<<
 * 
 *     def get_version(self):
 */
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(http_parser_execute((&((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_parser), (&((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_settings), __pyx_v_data, __pyx_v_length)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.execute");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":117
 *                 data, length)
 * 
 *     def get_version(self):             # <<<<<<<<<<<<<<
 *         """ get HTTP version """
 *         return (self._parser.http_major, self._parser.http_minor)
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_2get_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_2get_version[] = " get HTTP version ";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_2get_version(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("get_version");

  /* "lib/src/parser.pyx":119
 *     def get_version(self):
 *         """ get HTTP version """
 *         return (self._parser.http_major, self._parser.http_minor)             # <<<<<<<<<<<<<<
 * 
 *     def get_method(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_parser.http_major); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_parser.http_minor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject *)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.get_version");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":121
 *         return (self._parser.http_major, self._parser.http_minor)
 * 
 *     def get_method(self):             # <<<<<<<<<<<<<<
 *         """ get HTTP method as string"""
 *         return http_method_str(<http_method>self._parser.method)
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_3get_method(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_3get_method[] = " get HTTP method as string";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_3get_method(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_method");

  /* "lib/src/parser.pyx":123
 *     def get_method(self):
 *         """ get HTTP method as string"""
 *         return http_method_str(<http_method>self._parser.method)             # <<<<<<<<<<<<<<
 * 
 *     def get_status_code(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromString(http_method_str(((enum http_method)((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_parser.method))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.get_method");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":125
 *         return http_method_str(<http_method>self._parser.method)
 * 
 *     def get_status_code(self):             # <<<<<<<<<<<<<<
 *         """ get status code of a response as integer """
 *         return self._parser.status_code
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_4get_status_code(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_4get_status_code[] = " get status code of a response as integer ";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_4get_status_code(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_status_code");

  /* "lib/src/parser.pyx":127
 *     def get_status_code(self):
 *         """ get status code of a response as integer """
 *         return self._parser.status_code             # <<<<<<<<<<<<<<
 * 
 *     def get_url(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_parser.status_code); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.get_status_code");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":129
 *         return self._parser.status_code
 * 
 *     def get_url(self):             # <<<<<<<<<<<<<<
 *         """ get full url of the request """
 *         return self._data.url
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_5get_url(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_5get_url[] = " get full url of the request ";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_5get_url(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_url");

  /* "lib/src/parser.pyx":131
 *     def get_url(self):
 *         """ get full url of the request """
 *         return self._data.url             # <<<<<<<<<<<<<<
 * 
 *     def maybe_parse_url(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.get_url");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":133
 *         return self._data.url
 * 
 *     def maybe_parse_url(self):             # <<<<<<<<<<<<<<
 *         raw_url = self.get_url()
 *         if not self._parsed_url and raw_url:
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_6maybe_parse_url(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_6maybe_parse_url(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_v_raw_url;
  PyObject *__pyx_v_parts;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("maybe_parse_url");
  __pyx_v_raw_url = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_parts = Py_None; __Pyx_INCREF(Py_None);

  /* "lib/src/parser.pyx":134
 * 
 *     def maybe_parse_url(self):
 *         raw_url = self.get_url()             # <<<<<<<<<<<<<<
 *         if not self._parsed_url and raw_url:
 *             parts = urlsplit(raw_url)
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __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 = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_raw_url);
  __pyx_v_raw_url = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "lib/src/parser.pyx":135
 *     def maybe_parse_url(self):
 *         raw_url = self.get_url()
 *         if not self._parsed_url and raw_url:             # <<<<<<<<<<<<<<
 *             parts = urlsplit(raw_url)
 *             self._parsed_url = parts
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_parsed_url); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = (!__pyx_t_3);
  if (__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_raw_url); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_5 = __pyx_t_3;
  } else {
    __pyx_t_5 = __pyx_t_4;
  }
  if (__pyx_t_5) {

    /* "lib/src/parser.pyx":136
 *         raw_url = self.get_url()
 *         if not self._parsed_url and raw_url:
 *             parts = urlsplit(raw_url)             # <<<<<<<<<<<<<<
 *             self._parsed_url = parts
 *             self._path = parts.path or ""
 */
    __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__urlsplit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(__pyx_v_raw_url);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_raw_url);
    __Pyx_GIVEREF(__pyx_v_raw_url);
    __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_parts);
    __pyx_v_parts = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "lib/src/parser.pyx":137
 *         if not self._parsed_url and raw_url:
 *             parts = urlsplit(raw_url)
 *             self._parsed_url = parts             # <<<<<<<<<<<<<<
 *             self._path = parts.path or ""
 *             self._query_string = parts.query or ""
 */
    __Pyx_INCREF(__pyx_v_parts);
    __Pyx_GIVEREF(__pyx_v_parts);
    __Pyx_GOTREF(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_parsed_url);
    __Pyx_DECREF(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_parsed_url);
    ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_parsed_url = __pyx_v_parts;

    /* "lib/src/parser.pyx":138
 *             parts = urlsplit(raw_url)
 *             self._parsed_url = parts
 *             self._path = parts.path or ""             # <<<<<<<<<<<<<<
 *             self._query_string = parts.query or ""
 *             self._fragment = parts.fragment or ""
 */
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_parts, __pyx_n_s__path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!__pyx_t_5) {
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
      __pyx_t_1 = __pyx_kp_s_2;
    } else {
      __pyx_t_1 = __pyx_t_6;
      __pyx_t_6 = 0;
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_path);
    __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_path));
    ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_path = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;

    /* "lib/src/parser.pyx":139
 *             self._parsed_url = parts
 *             self._path = parts.path or ""
 *             self._query_string = parts.query or ""             # <<<<<<<<<<<<<<
 *             self._fragment = parts.fragment or ""
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_parts, __pyx_n_s__query); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!__pyx_t_5) {
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
      __pyx_t_6 = __pyx_kp_s_2;
    } else {
      __pyx_t_6 = __pyx_t_1;
      __pyx_t_1 = 0;
    }
    if (!(likely(PyString_CheckExact(__pyx_t_6))||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_6);
    __Pyx_GOTREF(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_query_string);
    __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_query_string));
    ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_query_string = ((PyObject*)__pyx_t_6);
    __pyx_t_6 = 0;

    /* "lib/src/parser.pyx":140
 *             self._path = parts.path or ""
 *             self._query_string = parts.query or ""
 *             self._fragment = parts.fragment or ""             # <<<<<<<<<<<<<<
 * 
 *     def get_path(self):
 */
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_parts, __pyx_n_s__fragment); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!__pyx_t_5) {
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
      __pyx_t_1 = __pyx_kp_s_2;
    } else {
      __pyx_t_1 = __pyx_t_6;
      __pyx_t_6 = 0;
    }
    if (!(likely(PyString_CheckExact(__pyx_t_1))||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GIVEREF(__pyx_t_1);
    __Pyx_GOTREF(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_fragment);
    __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_fragment));
    ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_fragment = ((PyObject*)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.maybe_parse_url");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_raw_url);
  __Pyx_DECREF(__pyx_v_parts);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":142
 *             self._fragment = parts.fragment or ""
 * 
 *     def get_path(self):             # <<<<<<<<<<<<<<
 *         """ get path of the request (url without query string and
 *         fragment """
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_7get_path(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_7get_path[] = " get path of the request (url without query string and\n        fragment ";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_7get_path(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_path");

  /* "lib/src/parser.pyx":145
 *         """ get path of the request (url without query string and
 *         fragment """
 *         self.maybe_parse_url()             # <<<<<<<<<<<<<<
 *         return self._path
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__maybe_parse_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __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 = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "lib/src/parser.pyx":146
 *         fragment """
 *         self.maybe_parse_url()
 *         return self._path             # <<<<<<<<<<<<<<
 * 
 *     def get_query_string(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_path));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_path);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.get_path");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":148
 *         return self._path
 * 
 *     def get_query_string(self):             # <<<<<<<<<<<<<<
 *         """ get query string of the url """
 *         self.maybe_parse_url()
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_8get_query_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_8get_query_string[] = " get query string of the url ";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_8get_query_string(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_query_string");

  /* "lib/src/parser.pyx":150
 *     def get_query_string(self):
 *         """ get query string of the url """
 *         self.maybe_parse_url()             # <<<<<<<<<<<<<<
 *         return self._query_string
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__maybe_parse_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __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 = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "lib/src/parser.pyx":151
 *         """ get query string of the url """
 *         self.maybe_parse_url()
 *         return self._query_string             # <<<<<<<<<<<<<<
 * 
 *     def get_fragment(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_query_string));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_query_string);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.get_query_string");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":153
 *         return self._query_string
 * 
 *     def get_fragment(self):             # <<<<<<<<<<<<<<
 *         """ get fragment of the url """
 *         self.maybe_parse_url()
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_9get_fragment(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_9get_fragment[] = " get fragment of the url ";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_9get_fragment(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_fragment");

  /* "lib/src/parser.pyx":155
 *     def get_fragment(self):
 *         """ get fragment of the url """
 *         self.maybe_parse_url()             # <<<<<<<<<<<<<<
 *         return self._fragment
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__maybe_parse_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __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 = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "lib/src/parser.pyx":156
 *         """ get fragment of the url """
 *         self.maybe_parse_url()
 *         return self._fragment             # <<<<<<<<<<<<<<
 * 
 *     def get_headers(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_fragment));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_fragment);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.get_fragment");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":158
 *         return self._fragment
 * 
 *     def get_headers(self):             # <<<<<<<<<<<<<<
 *         """get request/response headers dictionary."""
 *         return list(self._data.headers.items())
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_10get_headers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_10get_headers[] = "get request/response headers dictionary.";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_10get_headers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("get_headers");

  /* "lib/src/parser.pyx":160
 *     def get_headers(self):
 *         """get request/response headers dictionary."""
 *         return list(self._data.headers.items())             # <<<<<<<<<<<<<<
 * 
 *     def get_protocol(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__headers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __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 = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.get_headers");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":162
 *         return list(self._data.headers.items())
 * 
 *     def get_protocol(self):             # <<<<<<<<<<<<<<
 *         return None
 * 
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_11get_protocol(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_11get_protocol(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannySetupContext("get_protocol");

  /* "lib/src/parser.pyx":163
 * 
 *     def get_protocol(self):
 *         return None             # <<<<<<<<<<<<<<
 * 
 *     def get_body(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":165
 *         return None
 * 
 *     def get_body(self):             # <<<<<<<<<<<<<<
 *         return self._data.body
 * 
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_12get_body(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_12get_body(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_body");

  /* "lib/src/parser.pyx":166
 * 
 *     def get_body(self):
 *         return self._data.body             # <<<<<<<<<<<<<<
 * 
 *     def recv_body(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__body); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.get_body");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":168
 *         return self._data.body
 * 
 *     def recv_body(self):             # <<<<<<<<<<<<<<
 *         """ return last chunk of the parsed body"""
 *         body = b''.join(self._data.body)
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_13recv_body(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_13recv_body[] = " return last chunk of the parsed body";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_13recv_body(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_v_body;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("recv_body");
  __pyx_v_body = Py_None; __Pyx_INCREF(Py_None);

  /* "lib/src/parser.pyx":170
 *     def recv_body(self):
 *         """ return last chunk of the parsed body"""
 *         body = b''.join(self._data.body)             # <<<<<<<<<<<<<<
 *         self._data.body = []
 *         self._data.partial_body = False
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_b_2), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__body); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __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 = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_body);
  __pyx_v_body = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "lib/src/parser.pyx":171
 *         """ return last chunk of the parsed body"""
 *         body = b''.join(self._data.body)
 *         self._data.body = []             # <<<<<<<<<<<<<<
 *         self._data.partial_body = False
 *         return body
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyObject_SetAttr(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__body, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "lib/src/parser.pyx":172
 *         body = b''.join(self._data.body)
 *         self._data.body = []
 *         self._data.partial_body = False             # <<<<<<<<<<<<<<
 *         return body
 * 
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetAttr(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__partial_body, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "lib/src/parser.pyx":173
 *         self._data.body = []
 *         self._data.partial_body = False
 *         return body             # <<<<<<<<<<<<<<
 * 
 *     def recv_body_into(self, barray):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_body);
  __pyx_r = __pyx_v_body;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.recv_body");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_body);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":175
 *         return body
 * 
 *     def recv_body_into(self, barray):             # <<<<<<<<<<<<<<
 *         """ Receive the last chunk of the parsed body and store the data
 *         in a buffer rather than creating a new string. """
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_14recv_body_into(PyObject *__pyx_v_self, PyObject *__pyx_v_barray); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_14recv_body_into[] = " Receive the last chunk of the parsed body and store the data\n        in a buffer rather than creating a new string. ";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_14recv_body_into(PyObject *__pyx_v_self, PyObject *__pyx_v_barray) {
  Py_ssize_t __pyx_v_l;
  PyObject *__pyx_v_body;
  Py_ssize_t __pyx_v_m;
  PyObject *__pyx_v_data;
  PyObject *__pyx_v_rest;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("recv_body_into");
  __pyx_v_body = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_data = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_rest = Py_None; __Pyx_INCREF(Py_None);

  /* "lib/src/parser.pyx":178
 *         """ Receive the last chunk of the parsed body and store the data
 *         in a buffer rather than creating a new string. """
 *         l = len(barray)             # <<<<<<<<<<<<<<
 *         body = b''.join(self._data.body)
 *         m = min(len(body), l)
 */
  __pyx_t_1 = __pyx_v_barray;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_l = __pyx_t_2;

  /* "lib/src/parser.pyx":179
 *         in a buffer rather than creating a new string. """
 *         l = len(barray)
 *         body = b''.join(self._data.body)             # <<<<<<<<<<<<<<
 *         m = min(len(body), l)
 *         data, rest = body[:m], body[m:]
 */
  __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_b_2), __pyx_n_s__join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_GetAttr(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__body); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_v_body);
  __pyx_v_body = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "lib/src/parser.pyx":180
 *         l = len(barray)
 *         body = b''.join(self._data.body)
 *         m = min(len(body), l)             # <<<<<<<<<<<<<<
 *         data, rest = body[:m], body[m:]
 *         barray[0:m] = data
 */
  __pyx_t_2 = __pyx_v_l;
  __pyx_t_5 = PyObject_Length(__pyx_v_body); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if ((__pyx_t_2 < __pyx_t_5)) {
    __pyx_t_6 = __pyx_t_2;
  } else {
    __pyx_t_6 = __pyx_t_5;
  }
  __pyx_v_m = __pyx_t_6;

  /* "lib/src/parser.pyx":181
 *         body = b''.join(self._data.body)
 *         m = min(len(body), l)
 *         data, rest = body[:m], body[m:]             # <<<<<<<<<<<<<<
 *         barray[0:m] = data
 *         if not rest:
 */
  __pyx_t_3 = __Pyx_PySequence_GetSlice(__pyx_v_body, 0, __pyx_v_m); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PySequence_GetSlice(__pyx_v_body, __pyx_v_m, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_v_data);
  __pyx_v_data = __pyx_t_3;
  __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_v_rest);
  __pyx_v_rest = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "lib/src/parser.pyx":182
 *         m = min(len(body), l)
 *         data, rest = body[:m], body[m:]
 *         barray[0:m] = data             # <<<<<<<<<<<<<<
 *         if not rest:
 *             self._data.body = []
 */
  if (__Pyx_PySequence_SetSlice(__pyx_v_barray, 0, __pyx_v_m, __pyx_v_data) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "lib/src/parser.pyx":183
 *         data, rest = body[:m], body[m:]
 *         barray[0:m] = data
 *         if not rest:             # <<<<<<<<<<<<<<
 *             self._data.body = []
 *             self._data.partial_body = False
 */
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_rest); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_8 = (!__pyx_t_7);
  if (__pyx_t_8) {

    /* "lib/src/parser.pyx":184
 *         barray[0:m] = data
 *         if not rest:
 *             self._data.body = []             # <<<<<<<<<<<<<<
 *             self._data.partial_body = False
 *         else:
 */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    if (PyObject_SetAttr(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__body, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;

    /* "lib/src/parser.pyx":185
 *         if not rest:
 *             self._data.body = []
 *             self._data.partial_body = False             # <<<<<<<<<<<<<<
 *         else:
 *             self._data.body = [rest]
 */
    __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    if (PyObject_SetAttr(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__partial_body, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "lib/src/parser.pyx":187
 *             self._data.partial_body = False
 *         else:
 *             self._data.body = [rest]             # <<<<<<<<<<<<<<
 *         return m
 * 
 */
    __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(__pyx_v_rest);
    PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_rest);
    __Pyx_GIVEREF(__pyx_v_rest);
    if (PyObject_SetAttr(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__body, ((PyObject *)__pyx_t_4)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  }
  __pyx_L5:;

  /* "lib/src/parser.pyx":188
 *         else:
 *             self._data.body = [rest]
 *         return m             # <<<<<<<<<<<<<<
 * 
 *     def is_upgrade(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_m); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.recv_body_into");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_body);
  __Pyx_DECREF(__pyx_v_data);
  __Pyx_DECREF(__pyx_v_rest);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":190
 *         return m
 * 
 *     def is_upgrade(self):             # <<<<<<<<<<<<<<
 *         """ Do we get upgrade header in the request. Useful for
 *         websockets """
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_15is_upgrade(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_15is_upgrade[] = " Do we get upgrade header in the request. Useful for\n        websockets ";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_15is_upgrade(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_upgrade");

  /* "lib/src/parser.pyx":193
 *         """ Do we get upgrade header in the request. Useful for
 *         websockets """
 *         return self._parser_upgrade             # <<<<<<<<<<<<<<
 * 
 *     def is_headers_complete(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s___parser_upgrade); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.is_upgrade");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":195
 *         return self._parser_upgrade
 * 
 *     def is_headers_complete(self):             # <<<<<<<<<<<<<<
 *         """ return True if all headers have been parsed. """
 *         return self._data.headers_complete
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_16is_headers_complete(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_16is_headers_complete[] = " return True if all headers have been parsed. ";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_16is_headers_complete(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_headers_complete");

  /* "lib/src/parser.pyx":197
 *     def is_headers_complete(self):
 *         """ return True if all headers have been parsed. """
 *         return self._data.headers_complete             # <<<<<<<<<<<<<<
 * 
 *     def is_partial_body(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__headers_complete); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.is_headers_complete");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":199
 *         return self._data.headers_complete
 * 
 *     def is_partial_body(self):             # <<<<<<<<<<<<<<
 *         """ return True if a chunk of body have been parsed """
 *         return self._data.partial_body
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_17is_partial_body(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_17is_partial_body[] = " return True if a chunk of body have been parsed ";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_17is_partial_body(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_partial_body");

  /* "lib/src/parser.pyx":201
 *     def is_partial_body(self):
 *         """ return True if a chunk of body have been parsed """
 *         return self._data.partial_body             # <<<<<<<<<<<<<<
 * 
 *     def is_message_begin(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__partial_body); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.is_partial_body");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":203
 *         return self._data.partial_body
 * 
 *     def is_message_begin(self):             # <<<<<<<<<<<<<<
 *         """ return True if the parsing start """
 *         return self._data.message_begin
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_18is_message_begin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_18is_message_begin[] = " return True if the parsing start ";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_18is_message_begin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_message_begin");

  /* "lib/src/parser.pyx":205
 *     def is_message_begin(self):
 *         """ return True if the parsing start """
 *         return self._data.message_begin             # <<<<<<<<<<<<<<
 * 
 *     def is_message_complete(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__message_begin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.is_message_begin");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":207
 *         return self._data.message_begin
 * 
 *     def is_message_complete(self):             # <<<<<<<<<<<<<<
 *         """ return True if the parsing is done (we get EOF) """
 *         return self._data.message_complete
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_19is_message_complete(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_19is_message_complete[] = " return True if the parsing is done (we get EOF) ";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_19is_message_complete(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_message_complete");

  /* "lib/src/parser.pyx":209
 *     def is_message_complete(self):
 *         """ return True if the parsing is done (we get EOF) """
 *         return self._data.message_complete             # <<<<<<<<<<<<<<
 * 
 *     def is_chunked(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__message_complete); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.is_message_complete");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "lib/src/parser.pyx":211
 *         return self._data.message_complete
 * 
 *     def is_chunked(self):             # <<<<<<<<<<<<<<
 *         """ return True if Transfer-Encoding header value is chunked"""
 *         te = self._data.headers.get('transfer-encoding', '').lower()
 */

static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_20is_chunked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_20is_chunked[] = " return True if Transfer-Encoding header value is chunked";
static PyObject *__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_20is_chunked(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_v_te;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("is_chunked");
  __pyx_v_te = Py_None; __Pyx_INCREF(Py_None);

  /* "lib/src/parser.pyx":213
 *     def is_chunked(self):
 *         """ return True if Transfer-Encoding header value is chunked"""
 *         te = self._data.headers.get('transfer-encoding', '').lower()             # <<<<<<<<<<<<<<
 *         return te == 'chunked'
 */
  __pyx_t_1 = PyObject_GetAttr(((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)__pyx_v_self)->_data, __pyx_n_s__headers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__get); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__lower); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __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 = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_te);
  __pyx_v_te = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "lib/src/parser.pyx":214
 *         """ return True if Transfer-Encoding header value is chunked"""
 *         te = self._data.headers.get('transfer-encoding', '').lower()
 *         return te == 'chunked'             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_te, ((PyObject *)__pyx_n_s__chunked), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pulsar.lib._pulsar.HttpParser.is_chunked");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_te);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "http.pxd":6
 * 
 * 
 * cdef inline bytes_to_str(b):             # <<<<<<<<<<<<<<
 *     try:
 *         return str(b, 'latin1')
 */

static CYTHON_INLINE PyObject *__pyx_f_4http_bytes_to_str(PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("bytes_to_str");

  /* "http.pxd":7
 * 
 * cdef inline bytes_to_str(b):
 *     try:             # <<<<<<<<<<<<<<
 *         return str(b, 'latin1')
 *     except TypeError:
 */
  {
    PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb;
    __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb);
    __Pyx_XGOTREF(__pyx_save_exc_type);
    __Pyx_XGOTREF(__pyx_save_exc_value);
    __Pyx_XGOTREF(__pyx_save_exc_tb);
    /*try:*/ {

      /* "http.pxd":8
 * cdef inline bytes_to_str(b):
 *     try:
 *         return str(b, 'latin1')             # <<<<<<<<<<<<<<
 *     except TypeError:
 *         return b
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_INCREF(__pyx_v_b);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_b);
      __Pyx_GIVEREF(__pyx_v_b);
      __Pyx_INCREF(((PyObject *)__pyx_n_s__latin1));
      PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__latin1));
      __Pyx_GIVEREF(((PyObject *)__pyx_n_s__latin1));
      __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L7_try_return;
    }
    __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0;
    __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0;
    __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0;
    goto __pyx_L10_try_end;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    goto __pyx_L0;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "http.pxd":9
 *     try:
 *         return str(b, 'latin1')
 *     except TypeError:             # <<<<<<<<<<<<<<
 *         return b
 * 
 */
    __pyx_t_3 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
    if (__pyx_t_3) {
      __Pyx_AddTraceback("http.bytes_to_str");
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_4);

      /* "http.pxd":10
 *         return str(b, 'latin1')
 *     except TypeError:
 *         return b             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_b);
      __pyx_r = __pyx_v_b;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L6_except_return;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    goto __pyx_L0;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_save_exc_type);
    __Pyx_XGIVEREF(__pyx_save_exc_value);
    __Pyx_XGIVEREF(__pyx_save_exc_tb);
    __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb);
    __pyx_L10_try_end:;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("http.bytes_to_str");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "http.pxd":66
 * 
 * 
 * cdef inline int on_url_cb(http_parser *parser, char *at,             # <<<<<<<<<<<<<<
 *                           size_t length):
 *     res = <object>parser.data
 */

static CYTHON_INLINE int __pyx_f_4http_on_url_cb(struct http_parser *__pyx_v_parser, char *__pyx_v_at, size_t __pyx_v_length) {
  PyObject *__pyx_v_res;
  PyObject *__pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("on_url_cb");
  __pyx_v_res = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);

  /* "http.pxd":68
 * cdef inline int on_url_cb(http_parser *parser, char *at,
 *                           size_t length):
 *     res = <object>parser.data             # <<<<<<<<<<<<<<
 *     value = bytes_to_str(PyBytes_FromStringAndSize(at, length))
 *     res.url = value
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_parser->data));
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = ((PyObject *)__pyx_v_parser->data);

  /* "http.pxd":69
 *                           size_t length):
 *     res = <object>parser.data
 *     value = bytes_to_str(PyBytes_FromStringAndSize(at, length))             # <<<<<<<<<<<<<<
 *     res.url = value
 *     res.environ['RAW_URI'] = value
 */
  __pyx_t_1 = ((PyObject *)PyBytes_FromStringAndSize(__pyx_v_at, __pyx_v_length)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_4http_bytes_to_str(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_value);
  __pyx_v_value = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "http.pxd":70
 *     res = <object>parser.data
 *     value = bytes_to_str(PyBytes_FromStringAndSize(at, length))
 *     res.url = value             # <<<<<<<<<<<<<<
 *     res.environ['RAW_URI'] = value
 *     return 0
 */
  if (PyObject_SetAttr(__pyx_v_res, __pyx_n_s__url, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "http.pxd":71
 *     value = bytes_to_str(PyBytes_FromStringAndSize(at, length))
 *     res.url = value
 *     res.environ['RAW_URI'] = value             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s__environ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyObject_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__RAW_URI), __pyx_v_value) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "http.pxd":72
 *     res.url = value
 *     res.environ['RAW_URI'] = value
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("http.on_url_cb");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_res);
  __Pyx_DECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "http.pxd":75
 * 
 * 
 * cdef inline int on_header_field_cb(http_parser *parser, char *at,             # <<<<<<<<<<<<<<
 *         size_t length):
 *     header_field = PyBytes_FromStringAndSize(at, length)
 */

static CYTHON_INLINE int __pyx_f_4http_on_header_field_cb(struct http_parser *__pyx_v_parser, char *__pyx_v_at, size_t __pyx_v_length) {
  PyObject *__pyx_v_header_field;
  PyObject *__pyx_v_res;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("on_header_field_cb");
  __pyx_v_header_field = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  __pyx_v_res = Py_None; __Pyx_INCREF(Py_None);

  /* "http.pxd":77
 * cdef inline int on_header_field_cb(http_parser *parser, char *at,
 *         size_t length):
 *     header_field = PyBytes_FromStringAndSize(at, length)             # <<<<<<<<<<<<<<
 *     res = <object>parser.data
 * 
 */
  __pyx_t_1 = ((PyObject *)PyBytes_FromStringAndSize(__pyx_v_at, __pyx_v_length)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_v_header_field));
  __pyx_v_header_field = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "http.pxd":78
 *         size_t length):
 *     header_field = PyBytes_FromStringAndSize(at, length)
 *     res = <object>parser.data             # <<<<<<<<<<<<<<
 * 
 *     if res._last_was_value:
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_parser->data));
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = ((PyObject *)__pyx_v_parser->data);

  /* "http.pxd":80
 *     res = <object>parser.data
 * 
 *     if res._last_was_value:             # <<<<<<<<<<<<<<
 *         res._last_field = ""
 *     res._last_field += bytes_to_str(header_field)
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s___last_was_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "http.pxd":81
 * 
 *     if res._last_was_value:
 *         res._last_field = ""             # <<<<<<<<<<<<<<
 *     res._last_field += bytes_to_str(header_field)
 *     res._last_was_value = False
 */
    if (PyObject_SetAttr(__pyx_v_res, __pyx_n_s___last_field, ((PyObject *)__pyx_kp_s_2)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "http.pxd":82
 *     if res._last_was_value:
 *         res._last_field = ""
 *     res._last_field += bytes_to_str(header_field)             # <<<<<<<<<<<<<<
 *     res._last_was_value = False
 *     return 0
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s___last_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_f_4http_bytes_to_str(((PyObject *)__pyx_v_header_field)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyObject_SetAttr(__pyx_v_res, __pyx_n_s___last_field, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "http.pxd":83
 *         res._last_field = ""
 *     res._last_field += bytes_to_str(header_field)
 *     res._last_was_value = False             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetAttr(__pyx_v_res, __pyx_n_s___last_was_value, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "http.pxd":84
 *     res._last_field += bytes_to_str(header_field)
 *     res._last_was_value = False
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("http.on_header_field_cb");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_header_field);
  __Pyx_DECREF(__pyx_v_res);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "http.pxd":87
 * 
 * 
 * cdef inline int on_header_value_cb(http_parser *parser, char *at,             # <<<<<<<<<<<<<<
 *                                    size_t length):
 *     res = <object>parser.data
 */

static CYTHON_INLINE int __pyx_f_4http_on_header_value_cb(struct http_parser *__pyx_v_parser, char *__pyx_v_at, size_t __pyx_v_length) {
  PyObject *__pyx_v_res;
  PyObject *__pyx_v_header_value;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("on_header_value_cb");
  __pyx_v_res = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_header_value = Py_None; __Pyx_INCREF(Py_None);

  /* "http.pxd":89
 * cdef inline int on_header_value_cb(http_parser *parser, char *at,
 *                                    size_t length):
 *     res = <object>parser.data             # <<<<<<<<<<<<<<
 *     header_value = bytes_to_str(PyBytes_FromStringAndSize(at, length))
 *     res.headers[res._last_field] = header_value
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_parser->data));
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = ((PyObject *)__pyx_v_parser->data);

  /* "http.pxd":90
 *                                    size_t length):
 *     res = <object>parser.data
 *     header_value = bytes_to_str(PyBytes_FromStringAndSize(at, length))             # <<<<<<<<<<<<<<
 *     res.headers[res._last_field] = header_value
 *     res._last_was_value = True
 */
  __pyx_t_1 = ((PyObject *)PyBytes_FromStringAndSize(__pyx_v_at, __pyx_v_length)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_f_4http_bytes_to_str(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_header_value);
  __pyx_v_header_value = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "http.pxd":91
 *     res = <object>parser.data
 *     header_value = bytes_to_str(PyBytes_FromStringAndSize(at, length))
 *     res.headers[res._last_field] = header_value             # <<<<<<<<<<<<<<
 *     res._last_was_value = True
 *     return 0
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s__headers); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s___last_field); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_2, __pyx_t_1, __pyx_v_header_value) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "http.pxd":92
 *     header_value = bytes_to_str(PyBytes_FromStringAndSize(at, length))
 *     res.headers[res._last_field] = header_value
 *     res._last_was_value = True             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_res, __pyx_n_s___last_was_value, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "http.pxd":93
 *     res.headers[res._last_field] = header_value
 *     res._last_was_value = True
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("http.on_header_value_cb");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_res);
  __Pyx_DECREF(__pyx_v_header_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "http.pxd":96
 * 
 * 
 * cdef inline int on_headers_complete_cb(http_parser *parser):             # <<<<<<<<<<<<<<
 *     res = <object>parser.data
 *     res.headers_complete = True
 */

static CYTHON_INLINE int __pyx_f_4http_on_headers_complete_cb(struct http_parser *__pyx_v_parser) {
  PyObject *__pyx_v_res;
  PyObject *__pyx_v_encoding;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("on_headers_complete_cb");
  __pyx_v_res = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_encoding = Py_None; __Pyx_INCREF(Py_None);

  /* "http.pxd":97
 * 
 * cdef inline int on_headers_complete_cb(http_parser *parser):
 *     res = <object>parser.data             # <<<<<<<<<<<<<<
 *     res.headers_complete = True
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_parser->data));
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = ((PyObject *)__pyx_v_parser->data);

  /* "http.pxd":98
 * cdef inline int on_headers_complete_cb(http_parser *parser):
 *     res = <object>parser.data
 *     res.headers_complete = True             # <<<<<<<<<<<<<<
 * 
 *     if res.decompress:
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_res, __pyx_n_s__headers_complete, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "http.pxd":100
 *     res.headers_complete = True
 * 
 *     if res.decompress:             # <<<<<<<<<<<<<<
 *         encoding = res.headers.get('content-encoding')
 *         if encoding == 'gzip':
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s__decompress); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "http.pxd":101
 * 
 *     if res.decompress:
 *         encoding = res.headers.get('content-encoding')             # <<<<<<<<<<<<<<
 *         if encoding == 'gzip':
 *             res.decompressobj = zlib.decompressobj(16+zlib.MAX_WBITS)
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s__headers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__get); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_encoding);
    __pyx_v_encoding = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "http.pxd":102
 *     if res.decompress:
 *         encoding = res.headers.get('content-encoding')
 *         if encoding == 'gzip':             # <<<<<<<<<<<<<<
 *             res.decompressobj = zlib.decompressobj(16+zlib.MAX_WBITS)
 *             del res.headers['content-encoding']
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_encoding, ((PyObject *)__pyx_n_s__gzip), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "http.pxd":103
 *         encoding = res.headers.get('content-encoding')
 *         if encoding == 'gzip':
 *             res.decompressobj = zlib.decompressobj(16+zlib.MAX_WBITS)             # <<<<<<<<<<<<<<
 *             del res.headers['content-encoding']
 *         elif encoding == 'deflate':
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__zlib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__decompressobj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__zlib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__MAX_WBITS); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_int_16, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      if (PyObject_SetAttr(__pyx_v_res, __pyx_n_s__decompressobj, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "http.pxd":104
 *         if encoding == 'gzip':
 *             res.decompressobj = zlib.decompressobj(16+zlib.MAX_WBITS)
 *             del res.headers['content-encoding']             # <<<<<<<<<<<<<<
 *         elif encoding == 'deflate':
 *             res.decompressobj = zlib.decompressobj()
 */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s__headers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyObject_DelItem(__pyx_t_1, ((PyObject *)__pyx_kp_s_6)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L4;
    }

    /* "http.pxd":105
 *             res.decompressobj = zlib.decompressobj(16+zlib.MAX_WBITS)
 *             del res.headers['content-encoding']
 *         elif encoding == 'deflate':             # <<<<<<<<<<<<<<
 *             res.decompressobj = zlib.decompressobj()
 *             del res.headers['content-encoding']
 */
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_encoding, ((PyObject *)__pyx_n_s__deflate), Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_2) {

      /* "http.pxd":106
 *             del res.headers['content-encoding']
 *         elif encoding == 'deflate':
 *             res.decompressobj = zlib.decompressobj()             # <<<<<<<<<<<<<<
 *             del res.headers['content-encoding']
 *         else:
 */
      __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__zlib); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__decompressobj); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (PyObject_SetAttr(__pyx_v_res, __pyx_n_s__decompressobj, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "http.pxd":107
 *         elif encoding == 'deflate':
 *             res.decompressobj = zlib.decompressobj()
 *             del res.headers['content-encoding']             # <<<<<<<<<<<<<<
 *         else:
 *             res.decompress = False
 */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s__headers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyObject_DelItem(__pyx_t_1, ((PyObject *)__pyx_kp_s_6)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "http.pxd":109
 *             del res.headers['content-encoding']
 *         else:
 *             res.decompress = False             # <<<<<<<<<<<<<<
 * 
 *     return 0
 */
      __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      if (PyObject_SetAttr(__pyx_v_res, __pyx_n_s__decompress, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "http.pxd":111
 *             res.decompress = False
 * 
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("http.on_headers_complete_cb");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_res);
  __Pyx_DECREF(__pyx_v_encoding);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "http.pxd":114
 * 
 * 
 * cdef inline int on_message_begin_cb(http_parser *parser):             # <<<<<<<<<<<<<<
 *     res = <object>parser.data
 *     res.message_begin = True
 */

static CYTHON_INLINE int __pyx_f_4http_on_message_begin_cb(struct http_parser *__pyx_v_parser) {
  PyObject *__pyx_v_res;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_message_begin_cb");
  __pyx_v_res = Py_None; __Pyx_INCREF(Py_None);

  /* "http.pxd":115
 * 
 * cdef inline int on_message_begin_cb(http_parser *parser):
 *     res = <object>parser.data             # <<<<<<<<<<<<<<
 *     res.message_begin = True
 *     return 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_parser->data));
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = ((PyObject *)__pyx_v_parser->data);

  /* "http.pxd":116
 * cdef inline int on_message_begin_cb(http_parser *parser):
 *     res = <object>parser.data
 *     res.message_begin = True             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_res, __pyx_n_s__message_begin, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "http.pxd":117
 *     res = <object>parser.data
 *     res.message_begin = True
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("http.on_message_begin_cb");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_res);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "http.pxd":120
 * 
 * 
 * cdef inline int on_body_cb(http_parser *parser, char *at,             # <<<<<<<<<<<<<<
 *         size_t length):
 *     res = <object>parser.data
 */

static CYTHON_INLINE int __pyx_f_4http_on_body_cb(struct http_parser *__pyx_v_parser, char *__pyx_v_at, size_t __pyx_v_length) {
  PyObject *__pyx_v_res;
  PyObject *__pyx_v_value;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("on_body_cb");
  __pyx_v_res = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);

  /* "http.pxd":122
 * cdef inline int on_body_cb(http_parser *parser, char *at,
 *         size_t length):
 *     res = <object>parser.data             # <<<<<<<<<<<<<<
 *     value = PyBytes_FromStringAndSize(at, length)
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_parser->data));
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = ((PyObject *)__pyx_v_parser->data);

  /* "http.pxd":123
 *         size_t length):
 *     res = <object>parser.data
 *     value = PyBytes_FromStringAndSize(at, length)             # <<<<<<<<<<<<<<
 * 
 *     res.partial_body = True
 */
  __pyx_t_1 = ((PyObject *)PyBytes_FromStringAndSize(__pyx_v_at, __pyx_v_length)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_value);
  __pyx_v_value = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "http.pxd":125
 *     value = PyBytes_FromStringAndSize(at, length)
 * 
 *     res.partial_body = True             # <<<<<<<<<<<<<<
 * 
 *     # decompress the value if needed
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_res, __pyx_n_s__partial_body, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "http.pxd":128
 * 
 *     # decompress the value if needed
 *     if res.decompress:             # <<<<<<<<<<<<<<
 *         value = res.decompressobj.decompress(value)
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s__decompress); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "http.pxd":129
 *     # decompress the value if needed
 *     if res.decompress:
 *         value = res.decompressobj.decompress(value)             # <<<<<<<<<<<<<<
 * 
 *     res.body.append(value)
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s__decompressobj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__decompress); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "http.pxd":131
 *         value = res.decompressobj.decompress(value)
 * 
 *     res.body.append(value)             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_res, __pyx_n_s__body); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "http.pxd":132
 * 
 *     res.body.append(value)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("http.on_body_cb");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_res);
  __Pyx_DECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "http.pxd":135
 * 
 * 
 * cdef inline int on_message_complete_cb(http_parser *parser):             # <<<<<<<<<<<<<<
 *     res = <object>parser.data
 *     res.message_complete = True
 */

static CYTHON_INLINE int __pyx_f_4http_on_message_complete_cb(struct http_parser *__pyx_v_parser) {
  PyObject *__pyx_v_res;
  int __pyx_r;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_message_complete_cb");
  __pyx_v_res = Py_None; __Pyx_INCREF(Py_None);

  /* "http.pxd":136
 * 
 * cdef inline int on_message_complete_cb(http_parser *parser):
 *     res = <object>parser.data             # <<<<<<<<<<<<<<
 *     res.message_complete = True
 *     return 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_parser->data));
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = ((PyObject *)__pyx_v_parser->data);

  /* "http.pxd":137
 * cdef inline int on_message_complete_cb(http_parser *parser):
 *     res = <object>parser.data
 *     res.message_complete = True             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_v_res, __pyx_n_s__message_complete, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "http.pxd":138
 *     res = <object>parser.data
 *     res.message_complete = True
 *     return 0             # <<<<<<<<<<<<<<
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("http.on_message_complete_cb");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_res);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_6pulsar_3lib_7_pulsar_HttpParser(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)o);
  p->_data = Py_None; Py_INCREF(Py_None);
  p->_path = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_query_string = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_fragment = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_parsed_url = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pulsar_3lib_7_pulsar_HttpParser(PyObject *o) {
  struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *p = (struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)o;
  Py_XDECREF(p->_data);
  Py_XDECREF(((PyObject *)p->_path));
  Py_XDECREF(((PyObject *)p->_query_string));
  Py_XDECREF(((PyObject *)p->_fragment));
  Py_XDECREF(p->_parsed_url);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pulsar_3lib_7_pulsar_HttpParser(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *p = (struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)o;
  if (p->_data) {
    e = (*v)(p->_data, a); if (e) return e;
  }
  if (p->_path) {
    e = (*v)(p->_path, a); if (e) return e;
  }
  if (p->_query_string) {
    e = (*v)(p->_query_string, a); if (e) return e;
  }
  if (p->_fragment) {
    e = (*v)(p->_fragment, a); if (e) return e;
  }
  if (p->_parsed_url) {
    e = (*v)(p->_parsed_url, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pulsar_3lib_7_pulsar_HttpParser(PyObject *o) {
  struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *p = (struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->_data);
  p->_data = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_path);
  p->_path = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_query_string);
  p->_query_string = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_fragment);
  p->_fragment = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_parsed_url);
  p->_parsed_url = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_6pulsar_3lib_7_pulsar_HttpParser[] = {
  {__Pyx_NAMESTR("execute"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_1execute, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_1execute)},
  {__Pyx_NAMESTR("get_version"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_2get_version, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_2get_version)},
  {__Pyx_NAMESTR("get_method"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_3get_method, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_3get_method)},
  {__Pyx_NAMESTR("get_status_code"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_4get_status_code, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_4get_status_code)},
  {__Pyx_NAMESTR("get_url"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_5get_url, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_5get_url)},
  {__Pyx_NAMESTR("maybe_parse_url"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_6maybe_parse_url, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_path"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_7get_path, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_7get_path)},
  {__Pyx_NAMESTR("get_query_string"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_8get_query_string, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_8get_query_string)},
  {__Pyx_NAMESTR("get_fragment"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_9get_fragment, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_9get_fragment)},
  {__Pyx_NAMESTR("get_headers"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_10get_headers, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_10get_headers)},
  {__Pyx_NAMESTR("get_protocol"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_11get_protocol, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_body"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_12get_body, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("recv_body"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_13recv_body, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_13recv_body)},
  {__Pyx_NAMESTR("recv_body_into"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_14recv_body_into, METH_O, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_14recv_body_into)},
  {__Pyx_NAMESTR("is_upgrade"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_15is_upgrade, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_15is_upgrade)},
  {__Pyx_NAMESTR("is_headers_complete"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_16is_headers_complete, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_16is_headers_complete)},
  {__Pyx_NAMESTR("is_partial_body"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_17is_partial_body, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_17is_partial_body)},
  {__Pyx_NAMESTR("is_message_begin"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_18is_message_begin, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_18is_message_begin)},
  {__Pyx_NAMESTR("is_message_complete"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_19is_message_complete, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_19is_message_complete)},
  {__Pyx_NAMESTR("is_chunked"), (PyCFunction)__pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser_20is_chunked, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser_20is_chunked)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_HttpParser = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_HttpParser = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_HttpParser = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_HttpParser = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6pulsar_3lib_7_pulsar_HttpParser = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pulsar.lib._pulsar.HttpParser"), /*tp_name*/
  sizeof(struct __pyx_obj_6pulsar_3lib_7_pulsar_HttpParser), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pulsar_3lib_7_pulsar_HttpParser, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_HttpParser, /*tp_as_number*/
  &__pyx_tp_as_sequence_HttpParser, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_HttpParser, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_HttpParser, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Cython HTTP parser wrapping http_parser."), /*tp_doc*/
  __pyx_tp_traverse_6pulsar_3lib_7_pulsar_HttpParser, /*tp_traverse*/
  __pyx_tp_clear_6pulsar_3lib_7_pulsar_HttpParser, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pulsar_3lib_7_pulsar_HttpParser, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pulsar_3lib_7_pulsar_10HttpParser___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pulsar_3lib_7_pulsar_HttpParser, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("_pulsar"),
    __Pyx_DOCSTR(__pyx_k_8), /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 1},
  {&__pyx_kp_b_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 0, 0},
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
  {&__pyx_n_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 1},
  {&__pyx_n_s__MAX_WBITS, __pyx_k__MAX_WBITS, sizeof(__pyx_k__MAX_WBITS), 0, 0, 1, 1},
  {&__pyx_n_s__RAW_URI, __pyx_k__RAW_URI, sizeof(__pyx_k__RAW_URI), 0, 0, 1, 1},
  {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
  {&__pyx_n_s___ParserData, __pyx_k___ParserData, sizeof(__pyx_k___ParserData), 0, 0, 1, 1},
  {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s___data, __pyx_k___data, sizeof(__pyx_k___data), 0, 0, 1, 1},
  {&__pyx_n_s___fragment, __pyx_k___fragment, sizeof(__pyx_k___fragment), 0, 0, 1, 1},
  {&__pyx_n_s___last_field, __pyx_k___last_field, sizeof(__pyx_k___last_field), 0, 0, 1, 1},
  {&__pyx_n_s___last_was_value, __pyx_k___last_was_value, sizeof(__pyx_k___last_was_value), 0, 0, 1, 1},
  {&__pyx_n_s___parsed_url, __pyx_k___parsed_url, sizeof(__pyx_k___parsed_url), 0, 0, 1, 1},
  {&__pyx_n_s___parser, __pyx_k___parser, sizeof(__pyx_k___parser), 0, 0, 1, 1},
  {&__pyx_n_s___parser_upgrade, __pyx_k___parser_upgrade, sizeof(__pyx_k___parser_upgrade), 0, 0, 1, 1},
  {&__pyx_n_s___path, __pyx_k___path, sizeof(__pyx_k___path), 0, 0, 1, 1},
  {&__pyx_n_s___query_string, __pyx_k___query_string, sizeof(__pyx_k___query_string), 0, 0, 1, 1},
  {&__pyx_n_s___settings, __pyx_k___settings, sizeof(__pyx_k___settings), 0, 0, 1, 1},
  {&__pyx_n_s__body, __pyx_k__body, sizeof(__pyx_k__body), 0, 0, 1, 1},
  {&__pyx_n_s__chunked, __pyx_k__chunked, sizeof(__pyx_k__chunked), 0, 0, 1, 1},
  {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
  {&__pyx_n_s__decompress, __pyx_k__decompress, sizeof(__pyx_k__decompress), 0, 0, 1, 1},
  {&__pyx_n_s__decompressobj, __pyx_k__decompressobj, sizeof(__pyx_k__decompressobj), 0, 0, 1, 1},
  {&__pyx_n_s__deflate, __pyx_k__deflate, sizeof(__pyx_k__deflate), 0, 0, 1, 1},
  {&__pyx_n_s__environ, __pyx_k__environ, sizeof(__pyx_k__environ), 0, 0, 1, 1},
  {&__pyx_n_s__fragment, __pyx_k__fragment, sizeof(__pyx_k__fragment), 0, 0, 1, 1},
  {&__pyx_n_s__get, __pyx_k__get, sizeof(__pyx_k__get), 0, 0, 1, 1},
  {&__pyx_n_s__get_url, __pyx_k__get_url, sizeof(__pyx_k__get_url), 0, 0, 1, 1},
  {&__pyx_n_s__gzip, __pyx_k__gzip, sizeof(__pyx_k__gzip), 0, 0, 1, 1},
  {&__pyx_n_s__headers, __pyx_k__headers, sizeof(__pyx_k__headers), 0, 0, 1, 1},
  {&__pyx_n_s__headers_complete, __pyx_k__headers_complete, sizeof(__pyx_k__headers_complete), 0, 0, 1, 1},
  {&__pyx_n_s__http_major, __pyx_k__http_major, sizeof(__pyx_k__http_major), 0, 0, 1, 1},
  {&__pyx_n_s__http_minor, __pyx_k__http_minor, sizeof(__pyx_k__http_minor), 0, 0, 1, 1},
  {&__pyx_n_s__ispy3k, __pyx_k__ispy3k, sizeof(__pyx_k__ispy3k), 0, 0, 1, 1},
  {&__pyx_n_s__items, __pyx_k__items, sizeof(__pyx_k__items), 0, 0, 1, 1},
  {&__pyx_n_s__join, __pyx_k__join, sizeof(__pyx_k__join), 0, 0, 1, 1},
  {&__pyx_n_s__kind, __pyx_k__kind, sizeof(__pyx_k__kind), 0, 0, 1, 1},
  {&__pyx_n_s__latin1, __pyx_k__latin1, sizeof(__pyx_k__latin1), 0, 0, 1, 1},
  {&__pyx_n_s__length, __pyx_k__length, sizeof(__pyx_k__length), 0, 0, 1, 1},
  {&__pyx_n_s__lower, __pyx_k__lower, sizeof(__pyx_k__lower), 0, 0, 1, 1},
  {&__pyx_n_s__maybe_parse_url, __pyx_k__maybe_parse_url, sizeof(__pyx_k__maybe_parse_url), 0, 0, 1, 1},
  {&__pyx_n_s__message_begin, __pyx_k__message_begin, sizeof(__pyx_k__message_begin), 0, 0, 1, 1},
  {&__pyx_n_s__message_complete, __pyx_k__message_complete, sizeof(__pyx_k__message_complete), 0, 0, 1, 1},
  {&__pyx_n_s__method, __pyx_k__method, sizeof(__pyx_k__method), 0, 0, 1, 1},
  {&__pyx_n_s__on_body, __pyx_k__on_body, sizeof(__pyx_k__on_body), 0, 0, 1, 1},
  {&__pyx_n_s__on_header_field, __pyx_k__on_header_field, sizeof(__pyx_k__on_header_field), 0, 0, 1, 1},
  {&__pyx_n_s__on_header_value, __pyx_k__on_header_value, sizeof(__pyx_k__on_header_value), 0, 0, 1, 1},
  {&__pyx_n_s__on_headers_complete, __pyx_k__on_headers_complete, sizeof(__pyx_k__on_headers_complete), 0, 0, 1, 1},
  {&__pyx_n_s__on_message_begin, __pyx_k__on_message_begin, sizeof(__pyx_k__on_message_begin), 0, 0, 1, 1},
  {&__pyx_n_s__on_message_complete, __pyx_k__on_message_complete, sizeof(__pyx_k__on_message_complete), 0, 0, 1, 1},
  {&__pyx_n_s__on_url, __pyx_k__on_url, sizeof(__pyx_k__on_url), 0, 0, 1, 1},
  {&__pyx_n_s__os, __pyx_k__os, sizeof(__pyx_k__os), 0, 0, 1, 1},
  {&__pyx_n_s__partial_body, __pyx_k__partial_body, sizeof(__pyx_k__partial_body), 0, 0, 1, 1},
  {&__pyx_n_s__path, __pyx_k__path, sizeof(__pyx_k__path), 0, 0, 1, 1},
  {&__pyx_n_s__query, __pyx_k__query, sizeof(__pyx_k__query), 0, 0, 1, 1},
  {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1},
  {&__pyx_n_s__status_code, __pyx_k__status_code, sizeof(__pyx_k__status_code), 0, 0, 1, 1},
  {&__pyx_n_s__sys, __pyx_k__sys, sizeof(__pyx_k__sys), 0, 0, 1, 1},
  {&__pyx_n_s__url, __pyx_k__url, sizeof(__pyx_k__url), 0, 0, 1, 1},
  {&__pyx_n_s__urlparse, __pyx_k__urlparse, sizeof(__pyx_k__urlparse), 0, 0, 1, 1},
  {&__pyx_n_s__urlsplit, __pyx_k__urlsplit, sizeof(__pyx_k__urlsplit), 0, 0, 1, 1},
  {&__pyx_n_s__version_info, __pyx_k__version_info, sizeof(__pyx_k__version_info), 0, 0, 1, 1},
  {&__pyx_n_s__zlib, __pyx_k__zlib, sizeof(__pyx_k__zlib), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants");

  /* "lib/src/parser.pyx":213
 *     def is_chunked(self):
 *         """ return True if Transfer-Encoding header value is chunked"""
 *         te = self._data.headers.get('transfer-encoding', '').lower()             # <<<<<<<<<<<<<<
 *         return te == 'chunked'
 */
  __pyx_k_tuple_5 = PyTuple_New(2); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_5));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_4));
  PyTuple_SET_ITEM(__pyx_k_tuple_5, 0, ((PyObject *)__pyx_kp_s_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
  PyTuple_SET_ITEM(__pyx_k_tuple_5, 1, ((PyObject *)__pyx_kp_s_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5));

  /* "http.pxd":101
 * 
 *     if res.decompress:
 *         encoding = res.headers.get('content-encoding')             # <<<<<<<<<<<<<<
 *         if encoding == 'gzip':
 *             res.decompressobj = zlib.decompressobj(16+zlib.MAX_WBITS)
 */
  __pyx_k_tuple_7 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_7));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
  PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, ((PyObject *)__pyx_kp_s_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __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;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC init_pulsar(void); /*proto*/
PyMODINIT_FUNC init_pulsar(void)
#else
PyMODINIT_FUNC PyInit__pulsar(void); /*proto*/
PyMODINIT_FUNC PyInit__pulsar(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  #if CYTHON_REFNANNY
  void* __pyx_refnanny = NULL;
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__pulsar(void)", __LINE__, __FILE__);
  #endif
  __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;}
  __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;}
  #ifdef __pyx_binding_PyCFunctionType_USED
  if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_pulsar"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_8), 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_pulsar__lib___pulsar) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_6pulsar_3lib_7_pulsar_HttpParser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  {
    PyObject *wrapper = __Pyx_GetAttrString((PyObject *)&__pyx_type_6pulsar_3lib_7_pulsar_HttpParser, "__init__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_6pulsar_3lib_7_pulsar_10HttpParser___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_6pulsar_3lib_7_pulsar_10HttpParser___init__.doc = __pyx_doc_6pulsar_3lib_7_pulsar_10HttpParser___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_6pulsar_3lib_7_pulsar_10HttpParser___init__;
    }
  }
  if (__Pyx_SetAttrString(__pyx_m, "HttpParser", (PyObject *)&__pyx_type_6pulsar_3lib_7_pulsar_HttpParser) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pulsar_3lib_7_pulsar_HttpParser = &__pyx_type_6pulsar_3lib_7_pulsar_HttpParser;
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "lib/src/parser.pyx":28
 * Modified and adapted for pulsar.
 * '''
 * import os             # <<<<<<<<<<<<<<
 * import sys
 * from http cimport *
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__os), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "lib/src/parser.pyx":29
 * '''
 * import os
 * import sys             # <<<<<<<<<<<<<<
 * from http cimport *
 * 
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "lib/src/parser.pyx":32
 * from http cimport *
 * 
 * ispy3k = sys.version_info[0] == 3             # <<<<<<<<<<<<<<
 * 
 * if ispy3k:
 */
  __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__version_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ispy3k, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "lib/src/parser.pyx":34
 * ispy3k = sys.version_info[0] == 3
 * 
 * if ispy3k:             # <<<<<<<<<<<<<<
 *     from urllib.parse import urlsplit
 * else:
 */
  __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__ispy3k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "lib/src/parser.pyx":35
 * 
 * if ispy3k:
 *     from urllib.parse import urlsplit             # <<<<<<<<<<<<<<
 * else:
 *     from urlparse import urlsplit
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(((PyObject *)__pyx_n_s__urlsplit));
    PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__urlsplit));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__urlsplit));
    __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s_9), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__urlsplit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__urlsplit, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L2;
  }
  /*else*/ {

    /* "lib/src/parser.pyx":37
 *     from urllib.parse import urlsplit
 * else:
 *     from urlparse import urlsplit             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(((PyObject *)__pyx_n_s__urlsplit));
    PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_n_s__urlsplit));
    __Pyx_GIVEREF(((PyObject *)__pyx_n_s__urlsplit));
    __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__urlparse), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__urlsplit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s__urlsplit, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L2:;

  /* "lib/src/parser.pyx":40
 * 
 * 
 * class _ParserData:             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, decompress=False):
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));

  /* "lib/src/parser.pyx":42
 * class _ParserData:
 * 
 *     def __init__(self, decompress=False):             # <<<<<<<<<<<<<<
 *         self.url = ""
 *         self.body = []
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k_1 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_6pulsar_3lib_7_pulsar_11_ParserData___init__, NULL, __pyx_n_s_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s____init__, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "lib/src/parser.pyx":40
 * 
 * 
 * class _ParserData:             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, decompress=False):
 */
  __pyx_t_1 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2), __pyx_n_s___ParserData, __pyx_n_s_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s___ParserData, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "lib/src/parser.pyx":74
 *     cdef object _parsed_url
 * 
 *     def __init__(self, kind=2, decompress=False):             # <<<<<<<<<<<<<<
 *         """ constructor of HttpParser object.
 * :attr kind: Int,  could be 0 to parseonly requests,
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_3 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "lib/src/parser.pyx":1
 * '''Original code from https://github.com/benoitc/http-parser             # <<<<<<<<<<<<<<
 * 
 * 2011 (c) Benot Chesneau <benoitc@e-engura.org>
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "cpython/type.pxd":2
 * 
 * cdef extern from "Python.h":             # <<<<<<<<<<<<<<
 *     # The C structure of the objects used to describe built-in types.
 * 
 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  if (__pyx_m) {
    __Pyx_AddTraceback("init pulsar.lib._pulsar");
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pulsar.lib._pulsar");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AS_STRING(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;

    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
        } else {
            #if PY_MAJOR_VERSION < 3
            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
            #else
            if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
            #endif
                goto invalid_keyword_type;
            } else {
                for (name = first_kw_arg; *name; name++) {
                    #if PY_MAJOR_VERSION >= 3
                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                        PyUnicode_Compare(**name, key) == 0) break;
                    #else
                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                        _PyString_Eq(**name, key)) break;
                    #endif
                }
                if (*name) {
                    values[name-argnames] = value;
                } else {
                    /* unexpected keyword found */
                    for (name=argnames; name != first_kw_arg; name++) {
                        if (**name == key) goto arg_passed_twice;
                        #if PY_MAJOR_VERSION >= 3
                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
                        #else
                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                            _PyString_Eq(**name, key)) goto arg_passed_twice;
                        #endif
                    }
                    if (kwds2) {
                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                    } else {
                        goto invalid_keyword;
                    }
                }
            }
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *number, *more_or_less;

    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    number = (num_expected == 1) ? "" : "s";
    PyErr_Format(PyExc_TypeError,
        #if PY_VERSION_HEX < 0x02050000
            "%s() takes %s %d positional argument%s (%d given)",
        #else
            "%s() takes %s %zd positional argument%s (%zd given)",
        #endif
        func_name, more_or_less, num_expected, number, num_found);
}

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result)
        PyErr_SetObject(PyExc_NameError, name);
    return result;
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
    if (unlikely(tstate->curexc_type))
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
        goto bad;
    #endif
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
    Py_INCREF(local_type);
    Py_INCREF(local_value);
    Py_INCREF(local_tb);
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    /* Make sure tstate is in a consistent state when we XDECREF
       these objects (XDECREF may run arbitrary code). */
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}



static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
    PyObject *py_import = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!py_import)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(py_import);
    Py_XDECREF(empty_dict);
    return module;
}

static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
    PyObject *metaclass;
    /* Default metaclass */
#if PY_MAJOR_VERSION < 3
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = PyObject_GetAttrString(base, "__class__");
        if (!metaclass) {
            PyErr_Clear();
            metaclass = (PyObject*) Py_TYPE(base);
        }
    } else {
        metaclass = (PyObject *) &PyClass_Type;
    }
#else
    if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
        PyObject *base = PyTuple_GET_ITEM(bases, 0);
        metaclass = (PyObject*) Py_TYPE(base);
    } else {
        metaclass = (PyObject *) &PyType_Type;
    }
#endif
    Py_INCREF(metaclass);
    return metaclass;
}

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
                                   PyObject *modname) {
    PyObject *result;
    PyObject *metaclass;

    if (PyDict_SetItemString(dict, "__module__", modname) < 0)
        return NULL;

    /* Python2 __metaclass__ */
    metaclass = PyDict_GetItemString(dict, "__metaclass__");
    if (metaclass) {
        Py_INCREF(metaclass);
    } else {
        metaclass = __Pyx_FindPy2Metaclass(bases);
    }
    result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL);
    Py_DECREF(metaclass);
    return result;
}


static PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module) {
	__pyx_binding_PyCFunctionType_object *op = PyObject_GC_New(__pyx_binding_PyCFunctionType_object, __pyx_binding_PyCFunctionType);
    if (op == NULL)
        return NULL;
	op->func.m_ml = ml;
	Py_XINCREF(self);
	op->func.m_self = self;
	Py_XINCREF(module);
	op->func.m_module = module;
	PyObject_GC_Track(op);
	return (PyObject *)op;
}

static void __pyx_binding_PyCFunctionType_dealloc(__pyx_binding_PyCFunctionType_object *m) {
	PyObject_GC_UnTrack(m);
	Py_XDECREF(m->func.m_self);
	Py_XDECREF(m->func.m_module);
    PyObject_GC_Del(m);
}

static PyObject *__pyx_binding_PyCFunctionType_descr_get(PyObject *func, PyObject *obj, PyObject *type) {
	if (obj == Py_None)
		obj = NULL;
	return PyMethod_New(func, obj, type);
}

static int __pyx_binding_PyCFunctionType_init(void) {
    __pyx_binding_PyCFunctionType_type = PyCFunction_Type;
    __pyx_binding_PyCFunctionType_type.tp_name = __Pyx_NAMESTR("cython_binding_builtin_function_or_method");
    __pyx_binding_PyCFunctionType_type.tp_dealloc = (destructor)__pyx_binding_PyCFunctionType_dealloc;
    __pyx_binding_PyCFunctionType_type.tp_descr_get = __pyx_binding_PyCFunctionType_descr_get;
    if (PyType_Ready(&__pyx_binding_PyCFunctionType_type) < 0) {
        return -1;
    }
    __pyx_binding_PyCFunctionType = &__pyx_binding_PyCFunctionType_type;
    return 0;

}

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}

static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return PyLong_AsUnsignedLong(x);
        } else {
            return PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return PyLong_AsUnsignedLongLong(x);
        } else {
            return PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();

    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}

static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;

    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}


static void __Pyx_WriteUnraisable(const char *name) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    long size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];

    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    #if PY_MAJOR_VERSION < 3
    py_name = PyString_FromString(class_name);
    #else
    py_name = PyUnicode_FromString(class_name);
    #endif
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
    if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        #if PY_VERSION_HEX < 0x02050000
        PyErr_Warn(NULL, warning);
        #else
        PyErr_WarnEx(NULL, warning, 0);
        #endif
    }
    else if (((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;

    #if PY_MAJOR_VERSION < 3
    py_name = PyString_FromString(name);
    #else
    py_name = PyUnicode_FromString(name);
    #endif
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(const char *funcname) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyObject *py_globals = 0;
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;

    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(__pyx_filename);
    #else
    py_srcfile = PyUnicode_FromString(__pyx_filename);
    #endif
    if (!py_srcfile) goto bad;
    if (__pyx_clineno) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_code = PyCode_New(
        0,            /*int argcount,*/
        #if PY_MAJOR_VERSION >= 3
        0,            /*int kwonlyargcount,*/
        #endif
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple,  /*PyObject *consts,*/
        __pyx_empty_tuple,  /*PyObject *names,*/
        __pyx_empty_tuple,  /*PyObject *varnames,*/
        __pyx_empty_tuple,  /*PyObject *freevars,*/
        __pyx_empty_tuple,  /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        __pyx_lineno,   /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = __pyx_lineno;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else  /* Python 3+ has unicode identifiers */
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

/* Type Conversion Functions */

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}

static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}

static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
