Browse files

fix typo & bump

  • Loading branch information...
1 parent 0f0203b commit c33ed34d294c98fda7b4f200a1d0f61212218a28 @benoitc committed Sep 29, 2011
Showing with 100 additions and 94 deletions.
  1. +1 −1 http_parser/__init__.py
  2. +98 −92 http_parser/parser.c
  3. +1 −1 http_parser/parser.pyx
View
2 http_parser/__init__.py
@@ -3,5 +3,5 @@
# This file is part of http_parser released under the MIT license.
# See the NOTICE for more information.
-version_info = (0, 7, 0)
+version_info = (0, 7, 1)
__version__ = ".".join(map(str, version_info))
View
190 http_parser/parser.c
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.15 on Mon Sep 19 14:09:40 2011 */
+/* Generated by Cython 0.15.1 on Thu Sep 29 14:40:59 2011 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -722,11 +722,11 @@ static char __pyx_k__unquote[] = "unquote";
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__PATH_INFO[] = "PATH_INFO";
-static char __pyx_k__fragments[] = "fragments";
static char __pyx_k__decompress[] = "decompress";
static char __pyx_k__get_method[] = "get_method";
static char __pyx_k__SCRIPT_NAME[] = "SCRIPT_NAME";
@@ -790,7 +790,7 @@ 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__fragments;
+static PyObject *__pyx_n_s__fragment;
static PyObject *__pyx_n_s__get;
static PyObject *__pyx_n_s__get_method;
static PyObject *__pyx_n_s__get_url;
@@ -1781,40 +1781,42 @@ static PyObject *__pyx_pf_11http_parser_6parser_11_ParserData___init__(PyObject
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_8;
- 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(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ 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;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ 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 = 146; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ 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);
+ break;
+ default: goto __pyx_L5_argtuple_error;
}
- }
- 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 = 146; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
__pyx_v_self = values[0];
__pyx_v_decompress = values[1];
- } else {
- __pyx_v_decompress = __pyx_k_8;
- 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:;
@@ -2012,43 +2014,44 @@ static int __pyx_pf_11http_parser_6parser_10HttpParser___init__(PyObject *__pyx_
int __pyx_clineno = 0;
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_9;
- 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--; }
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ 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;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ 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--; }
+ }
}
- 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 = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else {
+ 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;
}
- }
- 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 = 177; __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_9;
- 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:;
@@ -2332,37 +2335,40 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_1execute(PyObject *
int __pyx_clineno = 0;
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 = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ 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;
}
- }
- 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 = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ kw_args = PyDict_Size(__pyx_kwds);
+ 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 = 212; __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 = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
__pyx_v_data = PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_data) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __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 = 212; __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 = 212; __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 = 212; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
@@ -2689,7 +2695,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_6maybe_parse_url(Py
* self._parsed_url = urlparse.urlsplit(raw_url)
* self._path = self._parsed_url.path or "" # <<<<<<<<<<<<<<
* self._query_string = self._parsed_url.query or ""
- * self._fragment = self._parsed_url.fragments or ""
+ * self._fragment = self._parsed_url.fragment or ""
*/
__pyx_t_6 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_parsed_url, __pyx_n_s__path); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
@@ -2713,7 +2719,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_6maybe_parse_url(Py
* self._parsed_url = urlparse.urlsplit(raw_url)
* self._path = self._parsed_url.path or ""
* self._query_string = self._parsed_url.query or "" # <<<<<<<<<<<<<<
- * self._fragment = self._parsed_url.fragments or ""
+ * self._fragment = self._parsed_url.fragment or ""
*
*/
__pyx_t_2 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_parsed_url, __pyx_n_s__query); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
@@ -2737,11 +2743,11 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_6maybe_parse_url(Py
/* "http_parser/parser.pyx":247
* self._path = self._parsed_url.path or ""
* self._query_string = self._parsed_url.query or ""
- * self._fragment = self._parsed_url.fragments or "" # <<<<<<<<<<<<<<
+ * self._fragment = self._parsed_url.fragment or "" # <<<<<<<<<<<<<<
*
* def get_path(self):
*/
- __pyx_t_6 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_parsed_url, __pyx_n_s__fragments); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_GetAttr(((struct __pyx_obj_11http_parser_6parser_HttpParser *)__pyx_v_self)->_parsed_url, __pyx_n_s__fragment); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __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 = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
if (!__pyx_t_5) {
@@ -2778,7 +2784,7 @@ static PyObject *__pyx_pf_11http_parser_6parser_10HttpParser_6maybe_parse_url(Py
}
/* "http_parser/parser.pyx":249
- * self._fragment = self._parsed_url.fragments or ""
+ * self._fragment = self._parsed_url.fragment or ""
*
* def get_path(self): # <<<<<<<<<<<<<<
* """ get path of the request (url without query string and
@@ -4421,7 +4427,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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__fragments, __pyx_k__fragments, sizeof(__pyx_k__fragments), 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_method, __pyx_k__get_method, sizeof(__pyx_k__get_method), 0, 0, 1, 1},
{&__pyx_n_s__get_url, __pyx_k__get_url, sizeof(__pyx_k__get_url), 0, 0, 1, 1},
View
2 http_parser/parser.pyx
@@ -244,7 +244,7 @@ cdef class HttpParser:
self._parsed_url = urlparse.urlsplit(raw_url)
self._path = self._parsed_url.path or ""
self._query_string = self._parsed_url.query or ""
- self._fragment = self._parsed_url.fragments or ""
+ self._fragment = self._parsed_url.fragment or ""
def get_path(self):
""" get path of the request (url without query string and

0 comments on commit c33ed34

Please sign in to comment.