From 0eb9df1eb7264aaa4b6ae086cd393ba44b4b790a Mon Sep 17 00:00:00 2001 From: Siddhant Goel Date: Sun, 21 Apr 2024 16:48:27 +0200 Subject: [PATCH] chore: extract leftover buffer parsing into function --- streaming_form_data/_parser.c | 1341 +++++++++++++++++-------------- streaming_form_data/_parser.pyx | 18 +- 2 files changed, 760 insertions(+), 599 deletions(-) diff --git a/streaming_form_data/_parser.c b/streaming_form_data/_parser.c index 4460b8e5..e4fb288b 100644 --- a/streaming_form_data/_parser.c +++ b/streaming_form_data/_parser.c @@ -1683,7 +1683,7 @@ struct __pyx_obj_19streaming_form_data_7_parser___pyx_scope_struct_5_async_on_bo }; -/* "streaming_form_data/_parser.pyx":274 +/* "streaming_form_data/_parser.pyx":268 * return self._parse(chunk, index) * * async def async_data_received(self, bytes data): # <<<<<<<<<<<<<< @@ -1741,6 +1741,7 @@ static struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *__pyx_vtab struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser { PyObject *(*_part_for)(struct __pyx_obj_19streaming_form_data_7_parser__Parser *, PyObject *); + PyObject *(*include_leftover_buffer)(struct __pyx_obj_19streaming_form_data_7_parser__Parser *, PyObject *); size_t (*rewind_fast_forward)(struct __pyx_obj_19streaming_form_data_7_parser__Parser *, __pyx_t_19streaming_form_data_7_parser_Byte const *, size_t, size_t); PyObject *(*mark_error)(struct __pyx_obj_19streaming_form_data_7_parser__Parser *); }; @@ -2334,6 +2335,18 @@ static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); +/* RaiseTooManyValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); + +/* RaiseNeedMoreValuesToUnpack.proto */ +static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); + +/* IterFinish.proto */ +static CYTHON_INLINE int __Pyx_IterFinish(void); + +/* UnpackItemEndCheck.proto */ +static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); + /* ReturnWithStopIteration.proto */ #define __Pyx_ReturnWithStopIteration(value)\ if (value == Py_None) PyErr_SetNone(PyExc_StopIteration); else __Pyx__ReturnWithStopIteration(value) @@ -2738,6 +2751,7 @@ static int __pyx_f_19streaming_form_data_7_parser_6Finder_active(struct __pyx_ob static int __pyx_f_19streaming_form_data_7_parser_6Finder_found(struct __pyx_obj_19streaming_form_data_7_parser_Finder *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/ static size_t __pyx_f_19streaming_form_data_7_parser_6Finder_matched_length(struct __pyx_obj_19streaming_form_data_7_parser_Finder *__pyx_v_self); /* proto*/ static PyObject *__pyx_f_19streaming_form_data_7_parser_7_Parser__part_for(struct __pyx_obj_19streaming_form_data_7_parser__Parser *__pyx_v_self, PyObject *__pyx_v_name); /* proto*/ +static PyObject *__pyx_f_19streaming_form_data_7_parser_7_Parser_include_leftover_buffer(struct __pyx_obj_19streaming_form_data_7_parser__Parser *__pyx_v_self, PyObject *__pyx_v_data); /* proto*/ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forward(struct __pyx_obj_19streaming_form_data_7_parser__Parser *__pyx_v_self, __pyx_t_19streaming_form_data_7_parser_Byte const *__pyx_v_chunk_ptr, size_t __pyx_v_pos_first, size_t __pyx_v_pos_last); /* proto*/ static PyObject *__pyx_f_19streaming_form_data_7_parser_7_Parser_mark_error(struct __pyx_obj_19streaming_form_data_7_parser__Parser *__pyx_v_self); /* proto*/ @@ -15080,11 +15094,12 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_19data_receive int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; + PyObject *(*__pyx_t_7)(PyObject *); + size_t __pyx_t_8; + int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -15125,119 +15140,97 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_19data_receive /* "streaming_form_data/_parser.pyx":264 * cdef size_t index * - * if self._leftover_buffer: # <<<<<<<<<<<<<< - * chunk = self._leftover_buffer + data - * index = len(self._leftover_buffer) - */ - __pyx_t_2 = (__pyx_v_self->_leftover_buffer != Py_None)&&(PyBytes_GET_SIZE(__pyx_v_self->_leftover_buffer) != 0); - if (__pyx_t_2) { - - /* "streaming_form_data/_parser.pyx":265 + * chunk, index = self.include_leftover_buffer(data) # <<<<<<<<<<<<<< * - * if self._leftover_buffer: - * chunk = self._leftover_buffer + data # <<<<<<<<<<<<<< - * index = len(self._leftover_buffer) - * self._leftover_buffer = None - */ - __pyx_t_3 = PyNumber_Add(__pyx_v_self->_leftover_buffer, __pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_chunk = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - - /* "streaming_form_data/_parser.pyx":266 - * if self._leftover_buffer: - * chunk = self._leftover_buffer + data - * index = len(self._leftover_buffer) # <<<<<<<<<<<<<< - * self._leftover_buffer = None - * else: + * return self._parse(chunk, index) */ - __pyx_t_3 = __pyx_v_self->_leftover_buffer; - __Pyx_INCREF(__pyx_t_3); - if (unlikely(__pyx_t_3 == Py_None)) { - PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->include_leftover_buffer(__pyx_v_self, __pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 264, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 266, __pyx_L1_error) + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_index = __pyx_t_4; - - /* "streaming_form_data/_parser.pyx":267 - * chunk = self._leftover_buffer + data - * index = len(self._leftover_buffer) - * self._leftover_buffer = None # <<<<<<<<<<<<<< - * else: - * chunk = data - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_self->_leftover_buffer); - __Pyx_DECREF(__pyx_v_self->_leftover_buffer); - __pyx_v_self->_leftover_buffer = ((PyObject*)Py_None); - - /* "streaming_form_data/_parser.pyx":264 - * cdef size_t index - * - * if self._leftover_buffer: # <<<<<<<<<<<<<< - * chunk = self._leftover_buffer + data - * index = len(self._leftover_buffer) - */ - goto __pyx_L4; - } - - /* "streaming_form_data/_parser.pyx":269 - * self._leftover_buffer = None - * else: - * chunk = data # <<<<<<<<<<<<<< - * index = 0 - * - */ - /*else*/ { - __Pyx_INCREF(__pyx_v_data); - __pyx_v_chunk = __pyx_v_data; - - /* "streaming_form_data/_parser.pyx":270 - * else: - * chunk = data - * index = 0 # <<<<<<<<<<<<<< - * - * return self._parse(chunk, index) - */ - __pyx_v_index = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_L5_unpacking_done:; } - __pyx_L4:; + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_v_chunk = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + __pyx_v_index = __pyx_t_8; - /* "streaming_form_data/_parser.pyx":272 - * index = 0 + /* "streaming_form_data/_parser.pyx":266 + * chunk, index = self.include_leftover_buffer(data) * * return self._parse(chunk, index) # <<<<<<<<<<<<<< * * async def async_data_received(self, bytes data): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parse); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_parse); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; + __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + __pyx_t_9 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_7)) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_8 = 1; + __pyx_t_9 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_chunk, __pyx_t_6}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_chunk, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -15256,9 +15249,9 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_19data_receive /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("streaming_form_data._parser._Parser.data_received", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; @@ -15269,7 +15262,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_19data_receive } static PyObject *__pyx_gb_19streaming_form_data_7_parser_7_Parser_23generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "streaming_form_data/_parser.pyx":274 +/* "streaming_form_data/_parser.pyx":268 * return self._parse(chunk, index) * * async def async_data_received(self, bytes data): # <<<<<<<<<<<<<< @@ -15330,12 +15323,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 274, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "async_data_received") < 0)) __PYX_ERR(0, 274, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "async_data_received") < 0)) __PYX_ERR(0, 268, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -15346,7 +15339,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("async_data_received", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 274, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("async_data_received", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 268, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15360,7 +15353,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyBytes_Type), 1, "data", 1))) __PYX_ERR(0, 274, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), (&PyBytes_Type), 1, "data", 1))) __PYX_ERR(0, 268, __pyx_L1_error) __pyx_r = __pyx_pf_19streaming_form_data_7_parser_7_Parser_21async_data_received(((struct __pyx_obj_19streaming_form_data_7_parser__Parser *)__pyx_v_self), __pyx_v_data); /* function exit code */ @@ -15390,7 +15383,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_21async_data_r if (unlikely(!__pyx_cur_scope)) { __pyx_cur_scope = ((struct __pyx_obj_19streaming_form_data_7_parser___pyx_scope_struct_6_async_data_received *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 274, __pyx_L1_error) + __PYX_ERR(0, 268, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -15401,7 +15394,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_21async_data_r __Pyx_INCREF(__pyx_cur_scope->__pyx_v_data); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_data); { - __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_19streaming_form_data_7_parser_7_Parser_23generator6, __pyx_codeobj__11, (PyObject *) __pyx_cur_scope, __pyx_n_s_async_data_received, __pyx_n_s_Parser_async_data_received, __pyx_n_s_streaming_form_data__parser); if (unlikely(!gen)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_19streaming_form_data_7_parser_7_Parser_23generator6, __pyx_codeobj__11, (PyObject *) __pyx_cur_scope, __pyx_n_s_async_data_received, __pyx_n_s_Parser_async_data_received, __pyx_n_s_streaming_form_data__parser); if (unlikely(!gen)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -15424,11 +15417,12 @@ static PyObject *__pyx_gb_19streaming_form_data_7_parser_7_Parser_23generator6(_ int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; - Py_ssize_t __pyx_t_4; + PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; + PyObject *(*__pyx_t_7)(PyObject *); + size_t __pyx_t_8; + int __pyx_t_9; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -15436,15 +15430,15 @@ static PyObject *__pyx_gb_19streaming_form_data_7_parser_7_Parser_23generator6(_ __Pyx_RefNannySetupContext("async_data_received", 0); switch (__pyx_generator->resume_label) { case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L6_resume_from_await; + case 1: goto __pyx_L7_resume_from_await; default: /* CPython raises the right error here */ __Pyx_RefNannyFinishContext(); return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 274, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 268, __pyx_L1_error) - /* "streaming_form_data/_parser.pyx":275 + /* "streaming_form_data/_parser.pyx":269 * * async def async_data_received(self, bytes data): * if not data: # <<<<<<<<<<<<<< @@ -15455,7 +15449,7 @@ static PyObject *__pyx_gb_19streaming_form_data_7_parser_7_Parser_23generator6(_ __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { - /* "streaming_form_data/_parser.pyx":276 + /* "streaming_form_data/_parser.pyx":270 * async def async_data_received(self, bytes data): * if not data: * return 0 # <<<<<<<<<<<<<< @@ -15466,7 +15460,7 @@ static PyObject *__pyx_gb_19streaming_form_data_7_parser_7_Parser_23generator6(_ __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_int_0); goto __pyx_L0; - /* "streaming_form_data/_parser.pyx":275 + /* "streaming_form_data/_parser.pyx":269 * * async def async_data_received(self, bytes data): * if not data: # <<<<<<<<<<<<<< @@ -15475,47 +15469,216 @@ static PyObject *__pyx_gb_19streaming_form_data_7_parser_7_Parser_23generator6(_ */ } - /* "streaming_form_data/_parser.pyx":281 + /* "streaming_form_data/_parser.pyx":275 + * cdef size_t index + * + * chunk, index = self.include_leftover_buffer(data) # <<<<<<<<<<<<<< + * + * return await self._parse(chunk, index) + */ + __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->include_leftover_buffer(__pyx_cur_scope->__pyx_v_self, __pyx_cur_scope->__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { + PyObject* sequence = __pyx_t_3; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 275, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_4 = PyList_GET_ITEM(sequence, 0); + __pyx_t_5 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + #else + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + #endif + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_4); + index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed; + __Pyx_GOTREF(__pyx_t_5); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L6_unpacking_done; + __pyx_L5_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_7 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_L6_unpacking_done:; + } + if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_4))) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_As_size_t(__pyx_t_5); if (unlikely((__pyx_t_8 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_4); + __pyx_cur_scope->__pyx_v_chunk = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; + __pyx_cur_scope->__pyx_v_index = __pyx_t_8; + + /* "streaming_form_data/_parser.pyx":277 + * chunk, index = self.include_leftover_buffer(data) + * + * return await self._parse(chunk, index) # <<<<<<<<<<<<<< + * + * cdef include_leftover_buffer(self, bytes data): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_parse); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = NULL; + __pyx_t_9 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_9 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_cur_scope->__pyx_v_chunk, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XGOTREF(__pyx_r); + if (likely(__pyx_r)) { + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + /* return from generator, awaiting value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L7_resume_from_await:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); + } else { + __pyx_t_3 = NULL; + if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_3) < 0) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + } + __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_3); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + + /* "streaming_form_data/_parser.pyx":268 + * return self._parse(chunk, index) + * + * async def async_data_received(self, bytes data): # <<<<<<<<<<<<<< + * if not data: + * return 0 + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("async_data_received", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "streaming_form_data/_parser.pyx":279 + * return await self._parse(chunk, index) + * + * cdef include_leftover_buffer(self, bytes data): # <<<<<<<<<<<<<< + * cdef bytes chunk + * cdef size_t index + */ + +static PyObject *__pyx_f_19streaming_form_data_7_parser_7_Parser_include_leftover_buffer(struct __pyx_obj_19streaming_form_data_7_parser__Parser *__pyx_v_self, PyObject *__pyx_v_data) { + PyObject *__pyx_v_chunk = 0; + size_t __pyx_v_index; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("include_leftover_buffer", 1); + + /* "streaming_form_data/_parser.pyx":283 * cdef size_t index * * if self._leftover_buffer: # <<<<<<<<<<<<<< * chunk = self._leftover_buffer + data * index = len(self._leftover_buffer) */ - __pyx_t_2 = (__pyx_cur_scope->__pyx_v_self->_leftover_buffer != Py_None)&&(PyBytes_GET_SIZE(__pyx_cur_scope->__pyx_v_self->_leftover_buffer) != 0); - if (__pyx_t_2) { + __pyx_t_1 = (__pyx_v_self->_leftover_buffer != Py_None)&&(PyBytes_GET_SIZE(__pyx_v_self->_leftover_buffer) != 0); + if (__pyx_t_1) { - /* "streaming_form_data/_parser.pyx":282 + /* "streaming_form_data/_parser.pyx":284 * * if self._leftover_buffer: * chunk = self._leftover_buffer + data # <<<<<<<<<<<<<< * index = len(self._leftover_buffer) * self._leftover_buffer = None */ - __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_self->_leftover_buffer, __pyx_cur_scope->__pyx_v_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_cur_scope->__pyx_v_chunk = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_v_self->_leftover_buffer, __pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_chunk = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "streaming_form_data/_parser.pyx":283 + /* "streaming_form_data/_parser.pyx":285 * if self._leftover_buffer: * chunk = self._leftover_buffer + data * index = len(self._leftover_buffer) # <<<<<<<<<<<<<< * self._leftover_buffer = None * else: */ - __pyx_t_3 = __pyx_cur_scope->__pyx_v_self->_leftover_buffer; - __Pyx_INCREF(__pyx_t_3); - if (unlikely(__pyx_t_3 == Py_None)) { + __pyx_t_2 = __pyx_v_self->_leftover_buffer; + __Pyx_INCREF(__pyx_t_2); + if (unlikely(__pyx_t_2 == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 283, __pyx_L1_error) + __PYX_ERR(0, 285, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyBytes_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 283, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_cur_scope->__pyx_v_index = __pyx_t_4; + __pyx_t_3 = __Pyx_PyBytes_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 285, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_index = __pyx_t_3; - /* "streaming_form_data/_parser.pyx":284 + /* "streaming_form_data/_parser.pyx":286 * chunk = self._leftover_buffer + data * index = len(self._leftover_buffer) * self._leftover_buffer = None # <<<<<<<<<<<<<< @@ -15524,21 +15687,21 @@ static PyObject *__pyx_gb_19streaming_form_data_7_parser_7_Parser_23generator6(_ */ __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->_leftover_buffer); - __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->_leftover_buffer); - __pyx_cur_scope->__pyx_v_self->_leftover_buffer = ((PyObject*)Py_None); + __Pyx_GOTREF(__pyx_v_self->_leftover_buffer); + __Pyx_DECREF(__pyx_v_self->_leftover_buffer); + __pyx_v_self->_leftover_buffer = ((PyObject*)Py_None); - /* "streaming_form_data/_parser.pyx":281 + /* "streaming_form_data/_parser.pyx":283 * cdef size_t index * * if self._leftover_buffer: # <<<<<<<<<<<<<< * chunk = self._leftover_buffer + data * index = len(self._leftover_buffer) */ - goto __pyx_L5; + goto __pyx_L3; } - /* "streaming_form_data/_parser.pyx":286 + /* "streaming_form_data/_parser.pyx":288 * self._leftover_buffer = None * else: * chunk = data # <<<<<<<<<<<<<< @@ -15546,108 +15709,65 @@ static PyObject *__pyx_gb_19streaming_form_data_7_parser_7_Parser_23generator6(_ * */ /*else*/ { - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_data); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_data); - __pyx_cur_scope->__pyx_v_chunk = __pyx_cur_scope->__pyx_v_data; + __Pyx_INCREF(__pyx_v_data); + __pyx_v_chunk = __pyx_v_data; - /* "streaming_form_data/_parser.pyx":287 + /* "streaming_form_data/_parser.pyx":289 * else: * chunk = data * index = 0 # <<<<<<<<<<<<<< * - * return await self._parse(chunk, index) + * return (chunk, index) */ - __pyx_cur_scope->__pyx_v_index = 0; + __pyx_v_index = 0; } - __pyx_L5:; + __pyx_L3:; - /* "streaming_form_data/_parser.pyx":289 + /* "streaming_form_data/_parser.pyx":291 * index = 0 * - * return await self._parse(chunk, index) # <<<<<<<<<<<<<< + * return (chunk, index) # <<<<<<<<<<<<<< * * def _parse(self, bytes chunk, size_t index): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_parse); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_cur_scope->__pyx_v_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_chunk, __pyx_t_6}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XGOTREF(__pyx_r); - if (likely(__pyx_r)) { - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - /* return from generator, awaiting value */ - __pyx_generator->resume_label = 1; - return __pyx_r; - __pyx_L6_resume_from_await:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 289, __pyx_L1_error) - __pyx_t_3 = __pyx_sent_value; __Pyx_INCREF(__pyx_t_3); - } else { - __pyx_t_3 = NULL; - if (__Pyx_PyGen_FetchStopIterationValue(&__pyx_t_3) < 0) __PYX_ERR(0, 289, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - } - __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_3); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_chunk); + __Pyx_GIVEREF(__pyx_v_chunk); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_chunk)) __PYX_ERR(0, 291, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "streaming_form_data/_parser.pyx":274 - * return self._parse(chunk, index) + /* "streaming_form_data/_parser.pyx":279 + * return await self._parse(chunk, index) * - * async def async_data_received(self, bytes data): # <<<<<<<<<<<<<< - * if not data: - * return 0 + * cdef include_leftover_buffer(self, bytes data): # <<<<<<<<<<<<<< + * cdef bytes chunk + * cdef size_t index */ /* function exit code */ __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("async_data_received", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("streaming_form_data._parser._Parser.include_leftover_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = 0; __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; - #if !CYTHON_USE_EXC_INFO_STACK - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - #endif - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + __Pyx_XDECREF(__pyx_v_chunk); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "streaming_form_data/_parser.pyx":291 - * return await self._parse(chunk, index) +/* "streaming_form_data/_parser.pyx":293 + * return (chunk, index) * * def _parse(self, bytes chunk, size_t index): # <<<<<<<<<<<<<< * cdef size_t idx, buffer_start, chunk_len @@ -15710,7 +15830,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 291, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 293, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -15718,14 +15838,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 291, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 293, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_parse", 1, 2, 2, 1); __PYX_ERR(0, 291, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse", 1, 2, 2, 1); __PYX_ERR(0, 293, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse") < 0)) __PYX_ERR(0, 291, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_parse") < 0)) __PYX_ERR(0, 293, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -15734,11 +15854,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_chunk = ((PyObject*)values[0]); - __pyx_v_index = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_index == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 291, __pyx_L3_error) + __pyx_v_index = __Pyx_PyInt_As_size_t(values[1]); if (unlikely((__pyx_v_index == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 293, __pyx_L3_error) } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_parse", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 291, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_parse", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 293, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15752,7 +15872,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chunk), (&PyBytes_Type), 1, "chunk", 1))) __PYX_ERR(0, 291, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_chunk), (&PyBytes_Type), 1, "chunk", 1))) __PYX_ERR(0, 293, __pyx_L1_error) __pyx_r = __pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(((struct __pyx_obj_19streaming_form_data_7_parser__Parser *)__pyx_v_self), __pyx_v_chunk, __pyx_v_index); /* function exit code */ @@ -15806,7 +15926,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_parse", 1); - /* "streaming_form_data/_parser.pyx":297 + /* "streaming_form_data/_parser.pyx":299 * cdef const Byte *chunk_ptr * * chunk_ptr = chunk # <<<<<<<<<<<<<< @@ -15815,12 +15935,12 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ if (unlikely(__pyx_v_chunk == Py_None)) { PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found"); - __PYX_ERR(0, 297, __pyx_L1_error) + __PYX_ERR(0, 299, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyBytes_AsUString(__pyx_v_chunk); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBytes_AsUString(__pyx_v_chunk); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L1_error) __pyx_v_chunk_ptr = __pyx_t_1; - /* "streaming_form_data/_parser.pyx":298 + /* "streaming_form_data/_parser.pyx":300 * * chunk_ptr = chunk * chunk_len = len(chunk) # <<<<<<<<<<<<<< @@ -15829,12 +15949,12 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ if (unlikely(__pyx_v_chunk == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); - __PYX_ERR(0, 298, __pyx_L1_error) + __PYX_ERR(0, 300, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyBytes_GET_SIZE(__pyx_v_chunk); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 298, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBytes_GET_SIZE(__pyx_v_chunk); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 300, __pyx_L1_error) __pyx_v_chunk_len = __pyx_t_2; - /* "streaming_form_data/_parser.pyx":299 + /* "streaming_form_data/_parser.pyx":301 * chunk_ptr = chunk * chunk_len = len(chunk) * buffer_start = 0 # <<<<<<<<<<<<<< @@ -15843,7 +15963,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_buffer_start = 0; - /* "streaming_form_data/_parser.pyx":301 + /* "streaming_form_data/_parser.pyx":303 * buffer_start = 0 * * idx = index # <<<<<<<<<<<<<< @@ -15852,7 +15972,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_idx = __pyx_v_index; - /* "streaming_form_data/_parser.pyx":302 + /* "streaming_form_data/_parser.pyx":304 * * idx = index * while idx < chunk_len: # <<<<<<<<<<<<<< @@ -15863,7 +15983,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_3 = (__pyx_v_idx < __pyx_v_chunk_len); if (!__pyx_t_3) break; - /* "streaming_form_data/_parser.pyx":303 + /* "streaming_form_data/_parser.pyx":305 * idx = index * while idx < chunk_len: * byte = chunk_ptr[idx] # <<<<<<<<<<<<<< @@ -15872,7 +15992,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_byte = (__pyx_v_chunk_ptr[__pyx_v_idx]); - /* "streaming_form_data/_parser.pyx":305 + /* "streaming_form_data/_parser.pyx":307 * byte = chunk_ptr[idx] * * if self.state == ParserState.PS_START: # <<<<<<<<<<<<<< @@ -15882,7 +16002,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc switch (__pyx_v_self->state) { case __pyx_e_19streaming_form_data_7_parser_PS_START: - /* "streaming_form_data/_parser.pyx":306 + /* "streaming_form_data/_parser.pyx":308 * * if self.state == ParserState.PS_START: * if byte == c_hyphen: # <<<<<<<<<<<<<< @@ -15892,7 +16012,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_3 = (__pyx_v_byte == __pyx_v_19streaming_form_data_7_parser_c_hyphen); if (__pyx_t_3) { - /* "streaming_form_data/_parser.pyx":307 + /* "streaming_form_data/_parser.pyx":309 * if self.state == ParserState.PS_START: * if byte == c_hyphen: * buffer_start = idx # <<<<<<<<<<<<<< @@ -15901,7 +16021,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_buffer_start = __pyx_v_idx; - /* "streaming_form_data/_parser.pyx":308 + /* "streaming_form_data/_parser.pyx":310 * if byte == c_hyphen: * buffer_start = idx * self.state = ParserState.PS_STARTING_BOUNDARY # <<<<<<<<<<<<<< @@ -15910,7 +16030,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_self->state = __pyx_e_19streaming_form_data_7_parser_PS_STARTING_BOUNDARY; - /* "streaming_form_data/_parser.pyx":306 + /* "streaming_form_data/_parser.pyx":308 * * if self.state == ParserState.PS_START: * if byte == c_hyphen: # <<<<<<<<<<<<<< @@ -15920,7 +16040,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc goto __pyx_L5; } - /* "streaming_form_data/_parser.pyx":309 + /* "streaming_form_data/_parser.pyx":311 * buffer_start = idx * self.state = ParserState.PS_STARTING_BOUNDARY * elif byte == c_cr: # <<<<<<<<<<<<<< @@ -15930,7 +16050,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_3 = (__pyx_v_byte == __pyx_v_19streaming_form_data_7_parser_c_cr); if (__pyx_t_3) { - /* "streaming_form_data/_parser.pyx":310 + /* "streaming_form_data/_parser.pyx":312 * self.state = ParserState.PS_STARTING_BOUNDARY * elif byte == c_cr: * self.state = ParserState.PS_START_CR # <<<<<<<<<<<<<< @@ -15939,7 +16059,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_self->state = __pyx_e_19streaming_form_data_7_parser_PS_START_CR; - /* "streaming_form_data/_parser.pyx":309 + /* "streaming_form_data/_parser.pyx":311 * buffer_start = idx * self.state = ParserState.PS_STARTING_BOUNDARY * elif byte == c_cr: # <<<<<<<<<<<<<< @@ -15949,7 +16069,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc goto __pyx_L5; } - /* "streaming_form_data/_parser.pyx":312 + /* "streaming_form_data/_parser.pyx":314 * self.state = ParserState.PS_START_CR * else: * self.mark_error() # <<<<<<<<<<<<<< @@ -15957,11 +16077,11 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * */ /*else*/ { - __pyx_t_4 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_4 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "streaming_form_data/_parser.pyx":313 + /* "streaming_form_data/_parser.pyx":315 * else: * self.mark_error() * return ErrorGroup.Delimiting + 1 # <<<<<<<<<<<<<< @@ -15969,7 +16089,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * elif self.state == ParserState.PS_START_CR: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Delimiting + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Delimiting + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; @@ -15977,7 +16097,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc } __pyx_L5:; - /* "streaming_form_data/_parser.pyx":305 + /* "streaming_form_data/_parser.pyx":307 * byte = chunk_ptr[idx] * * if self.state == ParserState.PS_START: # <<<<<<<<<<<<<< @@ -15987,7 +16107,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc break; case __pyx_e_19streaming_form_data_7_parser_PS_START_CR: - /* "streaming_form_data/_parser.pyx":316 + /* "streaming_form_data/_parser.pyx":318 * * elif self.state == ParserState.PS_START_CR: * if byte == c_lf: # <<<<<<<<<<<<<< @@ -15997,7 +16117,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_3 = (__pyx_v_byte == __pyx_v_19streaming_form_data_7_parser_c_lf); if (__pyx_t_3) { - /* "streaming_form_data/_parser.pyx":317 + /* "streaming_form_data/_parser.pyx":319 * elif self.state == ParserState.PS_START_CR: * if byte == c_lf: * self.state = ParserState.PS_START # <<<<<<<<<<<<<< @@ -16006,7 +16126,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_self->state = __pyx_e_19streaming_form_data_7_parser_PS_START; - /* "streaming_form_data/_parser.pyx":316 + /* "streaming_form_data/_parser.pyx":318 * * elif self.state == ParserState.PS_START_CR: * if byte == c_lf: # <<<<<<<<<<<<<< @@ -16016,7 +16136,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc goto __pyx_L6; } - /* "streaming_form_data/_parser.pyx":319 + /* "streaming_form_data/_parser.pyx":321 * self.state = ParserState.PS_START * else: * self.mark_error() # <<<<<<<<<<<<<< @@ -16024,11 +16144,11 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * */ /*else*/ { - __pyx_t_4 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_4 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "streaming_form_data/_parser.pyx":320 + /* "streaming_form_data/_parser.pyx":322 * else: * self.mark_error() * return ErrorGroup.Delimiting + 4 # <<<<<<<<<<<<<< @@ -16036,7 +16156,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * elif self.state == ParserState.PS_STARTING_BOUNDARY: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Delimiting + 4)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Delimiting + 4)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; @@ -16044,7 +16164,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc } __pyx_L6:; - /* "streaming_form_data/_parser.pyx":315 + /* "streaming_form_data/_parser.pyx":317 * return ErrorGroup.Delimiting + 1 * * elif self.state == ParserState.PS_START_CR: # <<<<<<<<<<<<<< @@ -16054,7 +16174,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc break; case __pyx_e_19streaming_form_data_7_parser_PS_STARTING_BOUNDARY: - /* "streaming_form_data/_parser.pyx":323 + /* "streaming_form_data/_parser.pyx":325 * * elif self.state == ParserState.PS_STARTING_BOUNDARY: * if byte != c_hyphen: # <<<<<<<<<<<<<< @@ -16064,18 +16184,18 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_3 = (__pyx_v_byte != __pyx_v_19streaming_form_data_7_parser_c_hyphen); if (__pyx_t_3) { - /* "streaming_form_data/_parser.pyx":324 + /* "streaming_form_data/_parser.pyx":326 * elif self.state == ParserState.PS_STARTING_BOUNDARY: * if byte != c_hyphen: * self.mark_error() # <<<<<<<<<<<<<< * return ErrorGroup.Delimiting + 2 * */ - __pyx_t_4 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_4 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "streaming_form_data/_parser.pyx":325 + /* "streaming_form_data/_parser.pyx":327 * if byte != c_hyphen: * self.mark_error() * return ErrorGroup.Delimiting + 2 # <<<<<<<<<<<<<< @@ -16083,13 +16203,13 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * self.state = ParserState.PS_READING_BOUNDARY */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Delimiting + 2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Delimiting + 2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "streaming_form_data/_parser.pyx":323 + /* "streaming_form_data/_parser.pyx":325 * * elif self.state == ParserState.PS_STARTING_BOUNDARY: * if byte != c_hyphen: # <<<<<<<<<<<<<< @@ -16098,7 +16218,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":327 + /* "streaming_form_data/_parser.pyx":329 * return ErrorGroup.Delimiting + 2 * * self.state = ParserState.PS_READING_BOUNDARY # <<<<<<<<<<<<<< @@ -16107,7 +16227,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_self->state = __pyx_e_19streaming_form_data_7_parser_PS_READING_BOUNDARY; - /* "streaming_form_data/_parser.pyx":322 + /* "streaming_form_data/_parser.pyx":324 * return ErrorGroup.Delimiting + 4 * * elif self.state == ParserState.PS_STARTING_BOUNDARY: # <<<<<<<<<<<<<< @@ -16117,7 +16237,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc break; case __pyx_e_19streaming_form_data_7_parser_PS_READING_BOUNDARY: - /* "streaming_form_data/_parser.pyx":329 + /* "streaming_form_data/_parser.pyx":331 * self.state = ParserState.PS_READING_BOUNDARY * elif self.state == ParserState.PS_READING_BOUNDARY: * if byte == c_cr: # <<<<<<<<<<<<<< @@ -16127,7 +16247,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_3 = (__pyx_v_byte == __pyx_v_19streaming_form_data_7_parser_c_cr); if (__pyx_t_3) { - /* "streaming_form_data/_parser.pyx":330 + /* "streaming_form_data/_parser.pyx":332 * elif self.state == ParserState.PS_READING_BOUNDARY: * if byte == c_cr: * self.state = ParserState.PS_ENDING_BOUNDARY # <<<<<<<<<<<<<< @@ -16136,7 +16256,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_self->state = __pyx_e_19streaming_form_data_7_parser_PS_ENDING_BOUNDARY; - /* "streaming_form_data/_parser.pyx":329 + /* "streaming_form_data/_parser.pyx":331 * self.state = ParserState.PS_READING_BOUNDARY * elif self.state == ParserState.PS_READING_BOUNDARY: * if byte == c_cr: # <<<<<<<<<<<<<< @@ -16145,7 +16265,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":328 + /* "streaming_form_data/_parser.pyx":330 * * self.state = ParserState.PS_READING_BOUNDARY * elif self.state == ParserState.PS_READING_BOUNDARY: # <<<<<<<<<<<<<< @@ -16155,7 +16275,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc break; case __pyx_e_19streaming_form_data_7_parser_PS_ENDING_BOUNDARY: - /* "streaming_form_data/_parser.pyx":333 + /* "streaming_form_data/_parser.pyx":335 * * elif self.state == ParserState.PS_ENDING_BOUNDARY: * if byte != c_lf: # <<<<<<<<<<<<<< @@ -16165,18 +16285,18 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_3 = (__pyx_v_byte != __pyx_v_19streaming_form_data_7_parser_c_lf); if (__pyx_t_3) { - /* "streaming_form_data/_parser.pyx":334 + /* "streaming_form_data/_parser.pyx":336 * elif self.state == ParserState.PS_ENDING_BOUNDARY: * if byte != c_lf: * self.mark_error() # <<<<<<<<<<<<<< * return ErrorGroup.Delimiting + 3 * */ - __pyx_t_4 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_4 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "streaming_form_data/_parser.pyx":335 + /* "streaming_form_data/_parser.pyx":337 * if byte != c_lf: * self.mark_error() * return ErrorGroup.Delimiting + 3 # <<<<<<<<<<<<<< @@ -16184,13 +16304,13 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * # ensure we have read correct starting delimiter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Delimiting + 3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Delimiting + 3)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "streaming_form_data/_parser.pyx":333 + /* "streaming_form_data/_parser.pyx":335 * * elif self.state == ParserState.PS_ENDING_BOUNDARY: * if byte != c_lf: # <<<<<<<<<<<<<< @@ -16199,7 +16319,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":338 + /* "streaming_form_data/_parser.pyx":340 * * # ensure we have read correct starting delimiter * if b'\r\n' + chunk[buffer_start: idx + 1] != \ # <<<<<<<<<<<<<< @@ -16208,25 +16328,25 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ if (unlikely(__pyx_v_chunk == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 338, __pyx_L1_error) + __PYX_ERR(0, 340, __pyx_L1_error) } - __pyx_t_4 = PySequence_GetSlice(__pyx_v_chunk, __pyx_v_buffer_start, (__pyx_v_idx + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error) + __pyx_t_4 = PySequence_GetSlice(__pyx_v_chunk, __pyx_v_buffer_start, (__pyx_v_idx + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Add(__pyx_kp_b__12, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_kp_b__12, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "streaming_form_data/_parser.pyx":339 + /* "streaming_form_data/_parser.pyx":341 * # ensure we have read correct starting delimiter * if b'\r\n' + chunk[buffer_start: idx + 1] != \ * self.delimiter_finder.target: # <<<<<<<<<<<<<< * self.mark_error() * return ErrorGroup.Delimiting + 5 */ - __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_5, __pyx_v_self->delimiter_finder->target, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 338, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyBytes_Equals(__pyx_t_5, __pyx_v_self->delimiter_finder->target, Py_NE)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "streaming_form_data/_parser.pyx":338 + /* "streaming_form_data/_parser.pyx":340 * * # ensure we have read correct starting delimiter * if b'\r\n' + chunk[buffer_start: idx + 1] != \ # <<<<<<<<<<<<<< @@ -16235,18 +16355,18 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ if (__pyx_t_3) { - /* "streaming_form_data/_parser.pyx":340 + /* "streaming_form_data/_parser.pyx":342 * if b'\r\n' + chunk[buffer_start: idx + 1] != \ * self.delimiter_finder.target: * self.mark_error() # <<<<<<<<<<<<<< * return ErrorGroup.Delimiting + 5 * */ - __pyx_t_5 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error) + __pyx_t_5 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "streaming_form_data/_parser.pyx":341 + /* "streaming_form_data/_parser.pyx":343 * self.delimiter_finder.target: * self.mark_error() * return ErrorGroup.Delimiting + 5 # <<<<<<<<<<<<<< @@ -16254,13 +16374,13 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * buffer_start = idx + 1 */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Delimiting + 5)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Delimiting + 5)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "streaming_form_data/_parser.pyx":338 + /* "streaming_form_data/_parser.pyx":340 * * # ensure we have read correct starting delimiter * if b'\r\n' + chunk[buffer_start: idx + 1] != \ # <<<<<<<<<<<<<< @@ -16269,7 +16389,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":343 + /* "streaming_form_data/_parser.pyx":345 * return ErrorGroup.Delimiting + 5 * * buffer_start = idx + 1 # <<<<<<<<<<<<<< @@ -16278,7 +16398,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_buffer_start = (__pyx_v_idx + 1); - /* "streaming_form_data/_parser.pyx":345 + /* "streaming_form_data/_parser.pyx":347 * buffer_start = idx + 1 * * self.state = ParserState.PS_READING_HEADER # <<<<<<<<<<<<<< @@ -16287,7 +16407,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_self->state = __pyx_e_19streaming_form_data_7_parser_PS_READING_HEADER; - /* "streaming_form_data/_parser.pyx":332 + /* "streaming_form_data/_parser.pyx":334 * self.state = ParserState.PS_ENDING_BOUNDARY * * elif self.state == ParserState.PS_ENDING_BOUNDARY: # <<<<<<<<<<<<<< @@ -16297,7 +16417,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc break; case __pyx_e_19streaming_form_data_7_parser_PS_READING_HEADER: - /* "streaming_form_data/_parser.pyx":347 + /* "streaming_form_data/_parser.pyx":349 * self.state = ParserState.PS_READING_HEADER * elif self.state == ParserState.PS_READING_HEADER: * if byte == c_cr: # <<<<<<<<<<<<<< @@ -16307,7 +16427,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_3 = (__pyx_v_byte == __pyx_v_19streaming_form_data_7_parser_c_cr); if (__pyx_t_3) { - /* "streaming_form_data/_parser.pyx":348 + /* "streaming_form_data/_parser.pyx":350 * elif self.state == ParserState.PS_READING_HEADER: * if byte == c_cr: * self.state = ParserState.PS_ENDING_HEADER # <<<<<<<<<<<<<< @@ -16316,7 +16436,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_self->state = __pyx_e_19streaming_form_data_7_parser_PS_ENDING_HEADER; - /* "streaming_form_data/_parser.pyx":347 + /* "streaming_form_data/_parser.pyx":349 * self.state = ParserState.PS_READING_HEADER * elif self.state == ParserState.PS_READING_HEADER: * if byte == c_cr: # <<<<<<<<<<<<<< @@ -16325,7 +16445,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":346 + /* "streaming_form_data/_parser.pyx":348 * * self.state = ParserState.PS_READING_HEADER * elif self.state == ParserState.PS_READING_HEADER: # <<<<<<<<<<<<<< @@ -16335,7 +16455,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc break; case __pyx_e_19streaming_form_data_7_parser_PS_ENDING_HEADER: - /* "streaming_form_data/_parser.pyx":351 + /* "streaming_form_data/_parser.pyx":353 * * elif self.state == ParserState.PS_ENDING_HEADER: * if byte != c_lf: # <<<<<<<<<<<<<< @@ -16345,18 +16465,18 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_3 = (__pyx_v_byte != __pyx_v_19streaming_form_data_7_parser_c_lf); if (__pyx_t_3) { - /* "streaming_form_data/_parser.pyx":352 + /* "streaming_form_data/_parser.pyx":354 * elif self.state == ParserState.PS_ENDING_HEADER: * if byte != c_lf: * self.mark_error() # <<<<<<<<<<<<<< * return ErrorGroup.PartHeaders + 1 * */ - __pyx_t_5 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_5 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "streaming_form_data/_parser.pyx":353 + /* "streaming_form_data/_parser.pyx":355 * if byte != c_lf: * self.mark_error() * return ErrorGroup.PartHeaders + 1 # <<<<<<<<<<<<<< @@ -16364,13 +16484,13 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * message = Parser(policy=HTTP).parsestr(chunk[buffer_start: idx + 1].decode('utf-8')) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_PartHeaders + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_PartHeaders + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "streaming_form_data/_parser.pyx":351 + /* "streaming_form_data/_parser.pyx":353 * * elif self.state == ParserState.PS_ENDING_HEADER: * if byte != c_lf: # <<<<<<<<<<<<<< @@ -16379,33 +16499,33 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":355 + /* "streaming_form_data/_parser.pyx":357 * return ErrorGroup.PartHeaders + 1 * * message = Parser(policy=HTTP).parsestr(chunk[buffer_start: idx + 1].decode('utf-8')) # <<<<<<<<<<<<<< * * if 'content-disposition' in message: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Parser); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 355, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Parser); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_HTTP); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_HTTP); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_policy, __pyx_t_7) < 0) __PYX_ERR(0, 355, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_policy, __pyx_t_7) < 0) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_parsestr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_parsestr); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (unlikely(__pyx_v_chunk == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 355, __pyx_L1_error) + __PYX_ERR(0, 357, __pyx_L1_error) } - __pyx_t_7 = __Pyx_decode_bytes(__pyx_v_chunk, __pyx_v_buffer_start, (__pyx_v_idx + 1), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_7 = __Pyx_decode_bytes(__pyx_v_chunk, __pyx_v_buffer_start, (__pyx_v_idx + 1), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = NULL; __pyx_t_8 = 0; @@ -16426,31 +16546,31 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 355, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_XDECREF_SET(__pyx_v_message, __pyx_t_5); __pyx_t_5 = 0; - /* "streaming_form_data/_parser.pyx":357 + /* "streaming_form_data/_parser.pyx":359 * message = Parser(policy=HTTP).parsestr(chunk[buffer_start: idx + 1].decode('utf-8')) * * if 'content-disposition' in message: # <<<<<<<<<<<<<< * if not message.get_content_disposition() == 'form-data': * self.mark_error() */ - __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u_content_disposition, __pyx_v_message, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 357, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u_content_disposition, __pyx_v_message, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 359, __pyx_L1_error) if (__pyx_t_3) { - /* "streaming_form_data/_parser.pyx":358 + /* "streaming_form_data/_parser.pyx":360 * * if 'content-disposition' in message: * if not message.get_content_disposition() == 'form-data': # <<<<<<<<<<<<<< * self.mark_error() * return ErrorGroup.PartHeaders + 1 */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_get_content_disposition); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_get_content_disposition); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -16470,27 +16590,27 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 358, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_kp_u_form_data, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_5, __pyx_kp_u_form_data, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_9 = (!__pyx_t_3); if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":359 + /* "streaming_form_data/_parser.pyx":361 * if 'content-disposition' in message: * if not message.get_content_disposition() == 'form-data': * self.mark_error() # <<<<<<<<<<<<<< * return ErrorGroup.PartHeaders + 1 * */ - __pyx_t_5 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_5 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "streaming_form_data/_parser.pyx":360 + /* "streaming_form_data/_parser.pyx":362 * if not message.get_content_disposition() == 'form-data': * self.mark_error() * return ErrorGroup.PartHeaders + 1 # <<<<<<<<<<<<<< @@ -16498,13 +16618,13 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * params = message['content-disposition'].params */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_PartHeaders + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_PartHeaders + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "streaming_form_data/_parser.pyx":358 + /* "streaming_form_data/_parser.pyx":360 * * if 'content-disposition' in message: * if not message.get_content_disposition() == 'form-data': # <<<<<<<<<<<<<< @@ -16513,29 +16633,29 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":362 + /* "streaming_form_data/_parser.pyx":364 * return ErrorGroup.PartHeaders + 1 * * params = message['content-disposition'].params # <<<<<<<<<<<<<< * name = params.get('name') * */ - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_message, __pyx_kp_u_content_disposition); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_message, __pyx_kp_u_content_disposition); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_params); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_params); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_XDECREF_SET(__pyx_v_params, __pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":363 + /* "streaming_form_data/_parser.pyx":365 * * params = message['content-disposition'].params * name = params.get('name') # <<<<<<<<<<<<<< * * if name: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_params, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_params, __pyx_n_s_get); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -16555,37 +16675,37 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_n_u_name}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 363, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":365 + /* "streaming_form_data/_parser.pyx":367 * name = params.get('name') * * if name: # <<<<<<<<<<<<<< * part = self._part_for(name) * if part is None: */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 367, __pyx_L1_error) if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":366 + /* "streaming_form_data/_parser.pyx":368 * * if name: * part = self._part_for(name) # <<<<<<<<<<<<<< * if part is None: * part = self.default_part */ - if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_name))) __PYX_ERR(0, 366, __pyx_L1_error) - __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->_part_for(__pyx_v_self, ((PyObject*)__pyx_v_name)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 366, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_name))) __PYX_ERR(0, 368, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->_part_for(__pyx_v_self, ((PyObject*)__pyx_v_name)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_XDECREF_SET(__pyx_v_part, __pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":367 + /* "streaming_form_data/_parser.pyx":369 * if name: * part = self._part_for(name) * if part is None: # <<<<<<<<<<<<<< @@ -16595,7 +16715,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_9 = (__pyx_v_part == Py_None); if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":368 + /* "streaming_form_data/_parser.pyx":370 * part = self._part_for(name) * if part is None: * part = self.default_part # <<<<<<<<<<<<<< @@ -16607,7 +16727,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __Pyx_DECREF_SET(__pyx_v_part, __pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":369 + /* "streaming_form_data/_parser.pyx":371 * if part is None: * part = self.default_part * if self.strict: # <<<<<<<<<<<<<< @@ -16616,14 +16736,14 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ if (__pyx_v_self->strict) { - /* "streaming_form_data/_parser.pyx":370 + /* "streaming_form_data/_parser.pyx":372 * part = self.default_part * if self.strict: * self.unexpected_part_name = name # <<<<<<<<<<<<<< * self.mark_error() * return ErrorGroup.UnexpectedPart */ - if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_name))) __PYX_ERR(0, 370, __pyx_L1_error) + if (!(likely(PyUnicode_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_name))) __PYX_ERR(0, 372, __pyx_L1_error) __pyx_t_6 = __pyx_v_name; __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); @@ -16632,18 +16752,18 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_v_self->unexpected_part_name = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":371 + /* "streaming_form_data/_parser.pyx":373 * if self.strict: * self.unexpected_part_name = name * self.mark_error() # <<<<<<<<<<<<<< * return ErrorGroup.UnexpectedPart * */ - __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 371, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 373, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":372 + /* "streaming_form_data/_parser.pyx":374 * self.unexpected_part_name = name * self.mark_error() * return ErrorGroup.UnexpectedPart # <<<<<<<<<<<<<< @@ -16651,13 +16771,13 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * self.set_active_part(part, params.get('filename')) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_Enum_54f4e2__19streaming_form_data_7_parser_enum__dunderpyx_t_19streaming_form_data_7_parser_ErrorGroup__etc_to_py(__pyx_e_19streaming_form_data_7_parser_UnexpectedPart); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_6 = __Pyx_Enum_54f4e2__19streaming_form_data_7_parser_enum__dunderpyx_t_19streaming_form_data_7_parser_ErrorGroup__etc_to_py(__pyx_e_19streaming_form_data_7_parser_UnexpectedPart); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "streaming_form_data/_parser.pyx":369 + /* "streaming_form_data/_parser.pyx":371 * if part is None: * part = self.default_part * if self.strict: # <<<<<<<<<<<<<< @@ -16666,7 +16786,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":367 + /* "streaming_form_data/_parser.pyx":369 * if name: * part = self._part_for(name) * if part is None: # <<<<<<<<<<<<<< @@ -16675,16 +16795,16 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":374 + /* "streaming_form_data/_parser.pyx":376 * return ErrorGroup.UnexpectedPart * * self.set_active_part(part, params.get('filename')) # <<<<<<<<<<<<<< * elif 'content-type' in message: * if self.active_part: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_active_part); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_active_part); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_params, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_params, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = NULL; __pyx_t_8 = 0; @@ -16704,7 +16824,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_n_u_filename}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 374, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -16727,13 +16847,13 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 374, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":365 + /* "streaming_form_data/_parser.pyx":367 * name = params.get('name') * * if name: # <<<<<<<<<<<<<< @@ -16742,7 +16862,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":357 + /* "streaming_form_data/_parser.pyx":359 * message = Parser(policy=HTTP).parsestr(chunk[buffer_start: idx + 1].decode('utf-8')) * * if 'content-disposition' in message: # <<<<<<<<<<<<<< @@ -16752,44 +16872,44 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc goto __pyx_L13; } - /* "streaming_form_data/_parser.pyx":375 + /* "streaming_form_data/_parser.pyx":377 * * self.set_active_part(part, params.get('filename')) * elif 'content-type' in message: # <<<<<<<<<<<<<< * if self.active_part: * self.active_part.set_multipart_content_type( */ - __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u_content_type, __pyx_v_message, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 375, __pyx_L1_error) + __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u_content_type, __pyx_v_message, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 377, __pyx_L1_error) if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":376 + /* "streaming_form_data/_parser.pyx":378 * self.set_active_part(part, params.get('filename')) * elif 'content-type' in message: * if self.active_part: # <<<<<<<<<<<<<< * self.active_part.set_multipart_content_type( * message.get_content_type() */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_self->active_part); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_self->active_part); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 378, __pyx_L1_error) if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":377 + /* "streaming_form_data/_parser.pyx":379 * elif 'content-type' in message: * if self.active_part: * self.active_part.set_multipart_content_type( # <<<<<<<<<<<<<< * message.get_content_type() * ) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->active_part, __pyx_n_s_set_multipart_content_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->active_part, __pyx_n_s_set_multipart_content_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "streaming_form_data/_parser.pyx":378 + /* "streaming_form_data/_parser.pyx":380 * if self.active_part: * self.active_part.set_multipart_content_type( * message.get_content_type() # <<<<<<<<<<<<<< * ) * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_get_content_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_get_content_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = NULL; __pyx_t_8 = 0; @@ -16809,7 +16929,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 378, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -16832,13 +16952,13 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 377, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":376 + /* "streaming_form_data/_parser.pyx":378 * self.set_active_part(part, params.get('filename')) * elif 'content-type' in message: * if self.active_part: # <<<<<<<<<<<<<< @@ -16847,7 +16967,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":375 + /* "streaming_form_data/_parser.pyx":377 * * self.set_active_part(part, params.get('filename')) * elif 'content-type' in message: # <<<<<<<<<<<<<< @@ -16857,7 +16977,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc } __pyx_L13:; - /* "streaming_form_data/_parser.pyx":381 + /* "streaming_form_data/_parser.pyx":383 * ) * * buffer_start = idx + 1 # <<<<<<<<<<<<<< @@ -16866,7 +16986,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_buffer_start = (__pyx_v_idx + 1); - /* "streaming_form_data/_parser.pyx":383 + /* "streaming_form_data/_parser.pyx":385 * buffer_start = idx + 1 * * self.state = ParserState.PS_ENDED_HEADER # <<<<<<<<<<<<<< @@ -16875,7 +16995,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_self->state = __pyx_e_19streaming_form_data_7_parser_PS_ENDED_HEADER; - /* "streaming_form_data/_parser.pyx":350 + /* "streaming_form_data/_parser.pyx":352 * self.state = ParserState.PS_ENDING_HEADER * * elif self.state == ParserState.PS_ENDING_HEADER: # <<<<<<<<<<<<<< @@ -16885,7 +17005,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc break; case __pyx_e_19streaming_form_data_7_parser_PS_ENDED_HEADER: - /* "streaming_form_data/_parser.pyx":385 + /* "streaming_form_data/_parser.pyx":387 * self.state = ParserState.PS_ENDED_HEADER * elif self.state == ParserState.PS_ENDED_HEADER: * if byte == c_cr: # <<<<<<<<<<<<<< @@ -16895,7 +17015,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_9 = (__pyx_v_byte == __pyx_v_19streaming_form_data_7_parser_c_cr); if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":386 + /* "streaming_form_data/_parser.pyx":388 * elif self.state == ParserState.PS_ENDED_HEADER: * if byte == c_cr: * self.state = ParserState.PS_ENDING_ALL_HEADERS # <<<<<<<<<<<<<< @@ -16904,7 +17024,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_self->state = __pyx_e_19streaming_form_data_7_parser_PS_ENDING_ALL_HEADERS; - /* "streaming_form_data/_parser.pyx":385 + /* "streaming_form_data/_parser.pyx":387 * self.state = ParserState.PS_ENDED_HEADER * elif self.state == ParserState.PS_ENDED_HEADER: * if byte == c_cr: # <<<<<<<<<<<<<< @@ -16914,7 +17034,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc goto __pyx_L19; } - /* "streaming_form_data/_parser.pyx":388 + /* "streaming_form_data/_parser.pyx":390 * self.state = ParserState.PS_ENDING_ALL_HEADERS * else: * self.state = ParserState.PS_READING_HEADER # <<<<<<<<<<<<<< @@ -16926,7 +17046,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc } __pyx_L19:; - /* "streaming_form_data/_parser.pyx":384 + /* "streaming_form_data/_parser.pyx":386 * * self.state = ParserState.PS_ENDED_HEADER * elif self.state == ParserState.PS_ENDED_HEADER: # <<<<<<<<<<<<<< @@ -16936,7 +17056,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc break; case __pyx_e_19streaming_form_data_7_parser_PS_ENDING_ALL_HEADERS: - /* "streaming_form_data/_parser.pyx":391 + /* "streaming_form_data/_parser.pyx":393 * * elif self.state == ParserState.PS_ENDING_ALL_HEADERS: * if byte != c_lf: # <<<<<<<<<<<<<< @@ -16946,18 +17066,18 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_9 = (__pyx_v_byte != __pyx_v_19streaming_form_data_7_parser_c_lf); if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":392 + /* "streaming_form_data/_parser.pyx":394 * elif self.state == ParserState.PS_ENDING_ALL_HEADERS: * if byte != c_lf: * self.mark_error() # <<<<<<<<<<<<<< * return ErrorGroup.PartHeaders + 2 * */ - __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":393 + /* "streaming_form_data/_parser.pyx":395 * if byte != c_lf: * self.mark_error() * return ErrorGroup.PartHeaders + 2 # <<<<<<<<<<<<<< @@ -16965,13 +17085,13 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * buffer_start = idx + 1 */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_PartHeaders + 2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_PartHeaders + 2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "streaming_form_data/_parser.pyx":391 + /* "streaming_form_data/_parser.pyx":393 * * elif self.state == ParserState.PS_ENDING_ALL_HEADERS: * if byte != c_lf: # <<<<<<<<<<<<<< @@ -16980,7 +17100,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":395 + /* "streaming_form_data/_parser.pyx":397 * return ErrorGroup.PartHeaders + 2 * * buffer_start = idx + 1 # <<<<<<<<<<<<<< @@ -16989,7 +17109,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_buffer_start = (__pyx_v_idx + 1); - /* "streaming_form_data/_parser.pyx":397 + /* "streaming_form_data/_parser.pyx":399 * buffer_start = idx + 1 * * self.state = ParserState.PS_READING_BODY # <<<<<<<<<<<<<< @@ -16998,7 +17118,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_self->state = __pyx_e_19streaming_form_data_7_parser_PS_READING_BODY; - /* "streaming_form_data/_parser.pyx":390 + /* "streaming_form_data/_parser.pyx":392 * self.state = ParserState.PS_READING_HEADER * * elif self.state == ParserState.PS_ENDING_ALL_HEADERS: # <<<<<<<<<<<<<< @@ -17008,39 +17128,39 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc break; case __pyx_e_19streaming_form_data_7_parser_PS_READING_BODY: - /* "streaming_form_data/_parser.pyx":399 + /* "streaming_form_data/_parser.pyx":401 * self.state = ParserState.PS_READING_BODY * elif self.state == ParserState.PS_READING_BODY: * self.delimiter_finder.feed(byte) # <<<<<<<<<<<<<< * self.ender_finder.feed(byte) * */ - __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->feed(__pyx_v_self->delimiter_finder, __pyx_v_byte, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->feed(__pyx_v_self->delimiter_finder, __pyx_v_byte, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":400 + /* "streaming_form_data/_parser.pyx":402 * elif self.state == ParserState.PS_READING_BODY: * self.delimiter_finder.feed(byte) * self.ender_finder.feed(byte) # <<<<<<<<<<<<<< * * if self.delimiter_finder.found(): */ - __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->feed(__pyx_v_self->ender_finder, __pyx_v_byte, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->feed(__pyx_v_self->ender_finder, __pyx_v_byte, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":402 + /* "streaming_form_data/_parser.pyx":404 * self.ender_finder.feed(byte) * * if self.delimiter_finder.found(): # <<<<<<<<<<<<<< * self.state = ParserState.PS_READING_HEADER * */ - __pyx_t_9 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->found(__pyx_v_self->delimiter_finder, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_9 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->found(__pyx_v_self->delimiter_finder, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 404, __pyx_L1_error) if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":403 + /* "streaming_form_data/_parser.pyx":405 * * if self.delimiter_finder.found(): * self.state = ParserState.PS_READING_HEADER # <<<<<<<<<<<<<< @@ -17049,7 +17169,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_self->state = __pyx_e_19streaming_form_data_7_parser_PS_READING_HEADER; - /* "streaming_form_data/_parser.pyx":405 + /* "streaming_form_data/_parser.pyx":407 * self.state = ParserState.PS_READING_HEADER * * if idx + 1 < self.delimiter_length: # <<<<<<<<<<<<<< @@ -17059,18 +17179,18 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_9 = ((__pyx_v_idx + 1) < __pyx_v_self->delimiter_length); if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":406 + /* "streaming_form_data/_parser.pyx":408 * * if idx + 1 < self.delimiter_length: * self.mark_error() # <<<<<<<<<<<<<< * return ErrorGroup.Internal + 1 * */ - __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":407 + /* "streaming_form_data/_parser.pyx":409 * if idx + 1 < self.delimiter_length: * self.mark_error() * return ErrorGroup.Internal + 1 # <<<<<<<<<<<<<< @@ -17078,13 +17198,13 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * match_start = idx + 1 - self.delimiter_length */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Internal + 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Internal + 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "streaming_form_data/_parser.pyx":405 + /* "streaming_form_data/_parser.pyx":407 * self.state = ParserState.PS_READING_HEADER * * if idx + 1 < self.delimiter_length: # <<<<<<<<<<<<<< @@ -17093,7 +17213,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":409 + /* "streaming_form_data/_parser.pyx":411 * return ErrorGroup.Internal + 1 * * match_start = idx + 1 - self.delimiter_length # <<<<<<<<<<<<<< @@ -17102,7 +17222,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_match_start = ((__pyx_v_idx + 1) - __pyx_v_self->delimiter_length); - /* "streaming_form_data/_parser.pyx":411 + /* "streaming_form_data/_parser.pyx":413 * match_start = idx + 1 - self.delimiter_length * * if match_start >= buffer_start: # <<<<<<<<<<<<<< @@ -17112,7 +17232,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_9 = (__pyx_v_match_start >= __pyx_v_buffer_start); if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":412 + /* "streaming_form_data/_parser.pyx":414 * * if match_start >= buffer_start: * try: # <<<<<<<<<<<<<< @@ -17128,20 +17248,20 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { - /* "streaming_form_data/_parser.pyx":413 + /* "streaming_form_data/_parser.pyx":415 * if match_start >= buffer_start: * try: * self.on_body(chunk[buffer_start: match_start]) # <<<<<<<<<<<<<< * except Exception: * self.mark_error() */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_body); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 413, __pyx_L24_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_body); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 415, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_chunk == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 413, __pyx_L24_error) + __PYX_ERR(0, 415, __pyx_L24_error) } - __pyx_t_7 = PySequence_GetSlice(__pyx_v_chunk, __pyx_v_buffer_start, __pyx_v_match_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L24_error) + __pyx_t_7 = PySequence_GetSlice(__pyx_v_chunk, __pyx_v_buffer_start, __pyx_v_match_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 415, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = NULL; __pyx_t_8 = 0; @@ -17162,13 +17282,13 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 413, __pyx_L24_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L24_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":412 + /* "streaming_form_data/_parser.pyx":414 * * if match_start >= buffer_start: * try: # <<<<<<<<<<<<<< @@ -17187,7 +17307,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "streaming_form_data/_parser.pyx":414 + /* "streaming_form_data/_parser.pyx":416 * try: * self.on_body(chunk[buffer_start: match_start]) * except Exception: # <<<<<<<<<<<<<< @@ -17197,23 +17317,23 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_8) { __Pyx_AddTraceback("streaming_form_data._parser._Parser._parse", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 414, __pyx_L26_except_error) + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 416, __pyx_L26_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_7); - /* "streaming_form_data/_parser.pyx":415 + /* "streaming_form_data/_parser.pyx":417 * self.on_body(chunk[buffer_start: match_start]) * except Exception: * self.mark_error() # <<<<<<<<<<<<<< * raise * */ - __pyx_t_4 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L26_except_error) + __pyx_t_4 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L26_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "streaming_form_data/_parser.pyx":416 + /* "streaming_form_data/_parser.pyx":418 * except Exception: * self.mark_error() * raise # <<<<<<<<<<<<<< @@ -17225,11 +17345,11 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_5, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_7 = 0; - __PYX_ERR(0, 416, __pyx_L26_except_error) + __PYX_ERR(0, 418, __pyx_L26_except_error) } goto __pyx_L26_except_error; - /* "streaming_form_data/_parser.pyx":412 + /* "streaming_form_data/_parser.pyx":414 * * if match_start >= buffer_start: * try: # <<<<<<<<<<<<<< @@ -17245,7 +17365,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_L31_try_end:; } - /* "streaming_form_data/_parser.pyx":418 + /* "streaming_form_data/_parser.pyx":420 * raise * * buffer_start = idx + 1 # <<<<<<<<<<<<<< @@ -17254,7 +17374,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_buffer_start = (__pyx_v_idx + 1); - /* "streaming_form_data/_parser.pyx":411 + /* "streaming_form_data/_parser.pyx":413 * match_start = idx + 1 - self.delimiter_length * * if match_start >= buffer_start: # <<<<<<<<<<<<<< @@ -17264,7 +17384,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc goto __pyx_L23; } - /* "streaming_form_data/_parser.pyx":420 + /* "streaming_form_data/_parser.pyx":422 * buffer_start = idx + 1 * else: * self.mark_error() # <<<<<<<<<<<<<< @@ -17272,11 +17392,11 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * */ /*else*/ { - __pyx_t_7 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error) + __pyx_t_7 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "streaming_form_data/_parser.pyx":421 + /* "streaming_form_data/_parser.pyx":423 * else: * self.mark_error() * return ErrorGroup.Internal + 2 # <<<<<<<<<<<<<< @@ -17284,7 +17404,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * self.unset_active_part() */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Internal + 2)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Internal + 2)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_r = __pyx_t_7; __pyx_t_7 = 0; @@ -17292,14 +17412,14 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc } __pyx_L23:; - /* "streaming_form_data/_parser.pyx":423 + /* "streaming_form_data/_parser.pyx":425 * return ErrorGroup.Internal + 2 * * self.unset_active_part() # <<<<<<<<<<<<<< * self.delimiter_finder.reset() * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unset_active_part); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unset_active_part); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_8 = 0; @@ -17319,24 +17439,24 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "streaming_form_data/_parser.pyx":424 + /* "streaming_form_data/_parser.pyx":426 * * self.unset_active_part() * self.delimiter_finder.reset() # <<<<<<<<<<<<<< * * elif self.ender_finder.found(): */ - __pyx_t_7 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->reset(__pyx_v_self->delimiter_finder); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_7 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->reset(__pyx_v_self->delimiter_finder); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "streaming_form_data/_parser.pyx":402 + /* "streaming_form_data/_parser.pyx":404 * self.ender_finder.feed(byte) * * if self.delimiter_finder.found(): # <<<<<<<<<<<<<< @@ -17346,17 +17466,17 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc goto __pyx_L21; } - /* "streaming_form_data/_parser.pyx":426 + /* "streaming_form_data/_parser.pyx":428 * self.delimiter_finder.reset() * * elif self.ender_finder.found(): # <<<<<<<<<<<<<< * self.state = ParserState.PS_END * */ - __pyx_t_9 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->found(__pyx_v_self->ender_finder, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_9 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->found(__pyx_v_self->ender_finder, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error) if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":427 + /* "streaming_form_data/_parser.pyx":429 * * elif self.ender_finder.found(): * self.state = ParserState.PS_END # <<<<<<<<<<<<<< @@ -17365,7 +17485,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_self->state = __pyx_e_19streaming_form_data_7_parser_PS_END; - /* "streaming_form_data/_parser.pyx":429 + /* "streaming_form_data/_parser.pyx":431 * self.state = ParserState.PS_END * * if idx + 1 < self.ender_length: # <<<<<<<<<<<<<< @@ -17375,18 +17495,18 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_9 = ((__pyx_v_idx + 1) < __pyx_v_self->ender_length); if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":430 + /* "streaming_form_data/_parser.pyx":432 * * if idx + 1 < self.ender_length: * self.mark_error() # <<<<<<<<<<<<<< * return ErrorGroup.Internal + 3 * match_start = idx + 1 - self.ender_length */ - __pyx_t_7 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_7 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "streaming_form_data/_parser.pyx":431 + /* "streaming_form_data/_parser.pyx":433 * if idx + 1 < self.ender_length: * self.mark_error() * return ErrorGroup.Internal + 3 # <<<<<<<<<<<<<< @@ -17394,13 +17514,13 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Internal + 3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Internal + 3)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "streaming_form_data/_parser.pyx":429 + /* "streaming_form_data/_parser.pyx":431 * self.state = ParserState.PS_END * * if idx + 1 < self.ender_length: # <<<<<<<<<<<<<< @@ -17409,7 +17529,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":432 + /* "streaming_form_data/_parser.pyx":434 * self.mark_error() * return ErrorGroup.Internal + 3 * match_start = idx + 1 - self.ender_length # <<<<<<<<<<<<<< @@ -17418,7 +17538,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_match_start = ((__pyx_v_idx + 1) - __pyx_v_self->ender_length); - /* "streaming_form_data/_parser.pyx":434 + /* "streaming_form_data/_parser.pyx":436 * match_start = idx + 1 - self.ender_length * * if match_start >= buffer_start: # <<<<<<<<<<<<<< @@ -17428,7 +17548,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_9 = (__pyx_v_match_start >= __pyx_v_buffer_start); if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":435 + /* "streaming_form_data/_parser.pyx":437 * * if match_start >= buffer_start: * try: # <<<<<<<<<<<<<< @@ -17444,20 +17564,20 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __Pyx_XGOTREF(__pyx_t_11); /*try:*/ { - /* "streaming_form_data/_parser.pyx":436 + /* "streaming_form_data/_parser.pyx":438 * if match_start >= buffer_start: * try: * self.on_body(chunk[buffer_start: match_start]) # <<<<<<<<<<<<<< * except Exception: * self.mark_error() */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_body); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 436, __pyx_L36_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_body); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 438, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_chunk == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 436, __pyx_L36_error) + __PYX_ERR(0, 438, __pyx_L36_error) } - __pyx_t_6 = PySequence_GetSlice(__pyx_v_chunk, __pyx_v_buffer_start, __pyx_v_match_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 436, __pyx_L36_error) + __pyx_t_6 = PySequence_GetSlice(__pyx_v_chunk, __pyx_v_buffer_start, __pyx_v_match_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 438, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = NULL; __pyx_t_8 = 0; @@ -17478,13 +17598,13 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 436, __pyx_L36_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 438, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "streaming_form_data/_parser.pyx":435 + /* "streaming_form_data/_parser.pyx":437 * * if match_start >= buffer_start: * try: # <<<<<<<<<<<<<< @@ -17503,7 +17623,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "streaming_form_data/_parser.pyx":437 + /* "streaming_form_data/_parser.pyx":439 * try: * self.on_body(chunk[buffer_start: match_start]) * except Exception: # <<<<<<<<<<<<<< @@ -17513,23 +17633,23 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_8) { __Pyx_AddTraceback("streaming_form_data._parser._Parser._parse", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 437, __pyx_L38_except_error) + if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 439, __pyx_L38_except_error) __Pyx_XGOTREF(__pyx_t_7); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_6); - /* "streaming_form_data/_parser.pyx":438 + /* "streaming_form_data/_parser.pyx":440 * self.on_body(chunk[buffer_start: match_start]) * except Exception: * self.mark_error() # <<<<<<<<<<<<<< * raise * else: */ - __pyx_t_4 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L38_except_error) + __pyx_t_4 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L38_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "streaming_form_data/_parser.pyx":439 + /* "streaming_form_data/_parser.pyx":441 * except Exception: * self.mark_error() * raise # <<<<<<<<<<<<<< @@ -17541,11 +17661,11 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __Pyx_XGIVEREF(__pyx_t_6); __Pyx_ErrRestoreWithState(__pyx_t_7, __pyx_t_5, __pyx_t_6); __pyx_t_7 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0; - __PYX_ERR(0, 439, __pyx_L38_except_error) + __PYX_ERR(0, 441, __pyx_L38_except_error) } goto __pyx_L38_except_error; - /* "streaming_form_data/_parser.pyx":435 + /* "streaming_form_data/_parser.pyx":437 * * if match_start >= buffer_start: * try: # <<<<<<<<<<<<<< @@ -17561,7 +17681,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_L43_try_end:; } - /* "streaming_form_data/_parser.pyx":434 + /* "streaming_form_data/_parser.pyx":436 * match_start = idx + 1 - self.ender_length * * if match_start >= buffer_start: # <<<<<<<<<<<<<< @@ -17571,7 +17691,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc goto __pyx_L35; } - /* "streaming_form_data/_parser.pyx":441 + /* "streaming_form_data/_parser.pyx":443 * raise * else: * self.mark_error() # <<<<<<<<<<<<<< @@ -17579,11 +17699,11 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * */ /*else*/ { - __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":442 + /* "streaming_form_data/_parser.pyx":444 * else: * self.mark_error() * return ErrorGroup.Internal + 4 # <<<<<<<<<<<<<< @@ -17591,7 +17711,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * buffer_start = idx + 1 */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Internal + 4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Internal + 4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; @@ -17599,7 +17719,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc } __pyx_L35:; - /* "streaming_form_data/_parser.pyx":444 + /* "streaming_form_data/_parser.pyx":446 * return ErrorGroup.Internal + 4 * * buffer_start = idx + 1 # <<<<<<<<<<<<<< @@ -17608,14 +17728,14 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_buffer_start = (__pyx_v_idx + 1); - /* "streaming_form_data/_parser.pyx":446 + /* "streaming_form_data/_parser.pyx":448 * buffer_start = idx + 1 * * self.unset_active_part() # <<<<<<<<<<<<<< * self.ender_finder.reset() * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unset_active_part); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 446, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unset_active_part); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -17635,24 +17755,24 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 446, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":447 + /* "streaming_form_data/_parser.pyx":449 * * self.unset_active_part() * self.ender_finder.reset() # <<<<<<<<<<<<<< * * else: */ - __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->reset(__pyx_v_self->ender_finder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->reset(__pyx_v_self->ender_finder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":426 + /* "streaming_form_data/_parser.pyx":428 * self.delimiter_finder.reset() * * elif self.ender_finder.found(): # <<<<<<<<<<<<<< @@ -17662,7 +17782,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc goto __pyx_L21; } - /* "streaming_form_data/_parser.pyx":455 + /* "streaming_form_data/_parser.pyx":457 * # middle of a potential delimiter. * * if self.delimiter_finder.inactive(): # <<<<<<<<<<<<<< @@ -17670,20 +17790,20 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * chunk_ptr, idx + 1, chunk_len - 1 */ /*else*/ { - __pyx_t_9 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->inactive(__pyx_v_self->delimiter_finder, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_9 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->inactive(__pyx_v_self->delimiter_finder, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L1_error) if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":456 + /* "streaming_form_data/_parser.pyx":458 * * if self.delimiter_finder.inactive(): * skip_count = self.rewind_fast_forward( # <<<<<<<<<<<<<< * chunk_ptr, idx + 1, chunk_len - 1 * ) */ - __pyx_t_14 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->rewind_fast_forward(__pyx_v_self, __pyx_v_chunk_ptr, (__pyx_v_idx + 1), (__pyx_v_chunk_len - 1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_14 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->rewind_fast_forward(__pyx_v_self, __pyx_v_chunk_ptr, (__pyx_v_idx + 1), (__pyx_v_chunk_len - 1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error) __pyx_v_skip_count = __pyx_t_14; - /* "streaming_form_data/_parser.pyx":459 + /* "streaming_form_data/_parser.pyx":461 * chunk_ptr, idx + 1, chunk_len - 1 * ) * idx += skip_count # <<<<<<<<<<<<<< @@ -17692,7 +17812,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_idx = (__pyx_v_idx + __pyx_v_skip_count); - /* "streaming_form_data/_parser.pyx":455 + /* "streaming_form_data/_parser.pyx":457 * # middle of a potential delimiter. * * if self.delimiter_finder.inactive(): # <<<<<<<<<<<<<< @@ -17703,7 +17823,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc } __pyx_L21:; - /* "streaming_form_data/_parser.pyx":398 + /* "streaming_form_data/_parser.pyx":400 * * self.state = ParserState.PS_READING_BODY * elif self.state == ParserState.PS_READING_BODY: # <<<<<<<<<<<<<< @@ -17713,7 +17833,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc break; case __pyx_e_19streaming_form_data_7_parser_PS_END: - /* "streaming_form_data/_parser.pyx":462 + /* "streaming_form_data/_parser.pyx":464 * * elif self.state == ParserState.PS_END: * return 0 # <<<<<<<<<<<<<< @@ -17725,7 +17845,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_r = __pyx_int_0; goto __pyx_L0; - /* "streaming_form_data/_parser.pyx":461 + /* "streaming_form_data/_parser.pyx":463 * idx += skip_count * * elif self.state == ParserState.PS_END: # <<<<<<<<<<<<<< @@ -17735,18 +17855,18 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc break; default: - /* "streaming_form_data/_parser.pyx":464 + /* "streaming_form_data/_parser.pyx":466 * return 0 * else: * self.mark_error() # <<<<<<<<<<<<<< * return ErrorGroup.Internal + 5 * */ - __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":465 + /* "streaming_form_data/_parser.pyx":467 * else: * self.mark_error() * return ErrorGroup.Internal + 5 # <<<<<<<<<<<<<< @@ -17754,7 +17874,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * idx += 1 */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Internal + 5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Internal + 5)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; @@ -17762,7 +17882,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc break; } - /* "streaming_form_data/_parser.pyx":467 + /* "streaming_form_data/_parser.pyx":469 * return ErrorGroup.Internal + 5 * * idx += 1 # <<<<<<<<<<<<<< @@ -17772,7 +17892,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_v_idx = (__pyx_v_idx + 1); } - /* "streaming_form_data/_parser.pyx":469 + /* "streaming_form_data/_parser.pyx":471 * idx += 1 * * if idx != chunk_len: # <<<<<<<<<<<<<< @@ -17782,18 +17902,18 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_9 = (__pyx_v_idx != __pyx_v_chunk_len); if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":470 + /* "streaming_form_data/_parser.pyx":472 * * if idx != chunk_len: * self.mark_error() # <<<<<<<<<<<<<< * return ErrorGroup.Internal + 6 * */ - __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":471 + /* "streaming_form_data/_parser.pyx":473 * if idx != chunk_len: * self.mark_error() * return ErrorGroup.Internal + 6 # <<<<<<<<<<<<<< @@ -17801,13 +17921,13 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * if buffer_start > chunk_len: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Internal + 6)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Internal + 6)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "streaming_form_data/_parser.pyx":469 + /* "streaming_form_data/_parser.pyx":471 * idx += 1 * * if idx != chunk_len: # <<<<<<<<<<<<<< @@ -17816,7 +17936,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":473 + /* "streaming_form_data/_parser.pyx":475 * return ErrorGroup.Internal + 6 * * if buffer_start > chunk_len: # <<<<<<<<<<<<<< @@ -17826,18 +17946,18 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_9 = (__pyx_v_buffer_start > __pyx_v_chunk_len); if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":474 + /* "streaming_form_data/_parser.pyx":476 * * if buffer_start > chunk_len: * self.mark_error() # <<<<<<<<<<<<<< * return ErrorGroup.Internal + 7 * */ - __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":475 + /* "streaming_form_data/_parser.pyx":477 * if buffer_start > chunk_len: * self.mark_error() * return ErrorGroup.Internal + 7 # <<<<<<<<<<<<<< @@ -17845,13 +17965,13 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc * if self.state == ParserState.PS_READING_BODY: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Internal + 7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 475, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_e_19streaming_form_data_7_parser_Internal + 7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_r = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L0; - /* "streaming_form_data/_parser.pyx":473 + /* "streaming_form_data/_parser.pyx":475 * return ErrorGroup.Internal + 6 * * if buffer_start > chunk_len: # <<<<<<<<<<<<<< @@ -17860,7 +17980,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":477 + /* "streaming_form_data/_parser.pyx":479 * return ErrorGroup.Internal + 7 * * if self.state == ParserState.PS_READING_BODY: # <<<<<<<<<<<<<< @@ -17870,25 +17990,25 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_9 = (__pyx_v_self->state == __pyx_e_19streaming_form_data_7_parser_PS_READING_BODY); if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":480 + /* "streaming_form_data/_parser.pyx":482 * matched_length = max( * self.delimiter_finder.matched_length(), * self.ender_finder.matched_length() # <<<<<<<<<<<<<< * ) * match_start = idx - matched_length */ - __pyx_t_14 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->matched_length(__pyx_v_self->ender_finder); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_14 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->matched_length(__pyx_v_self->ender_finder); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 482, __pyx_L1_error) - /* "streaming_form_data/_parser.pyx":479 + /* "streaming_form_data/_parser.pyx":481 * if self.state == ParserState.PS_READING_BODY: * matched_length = max( * self.delimiter_finder.matched_length(), # <<<<<<<<<<<<<< * self.ender_finder.matched_length() * ) */ - __pyx_t_15 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->matched_length(__pyx_v_self->delimiter_finder); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_t_15 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->matched_length(__pyx_v_self->delimiter_finder); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L1_error) - /* "streaming_form_data/_parser.pyx":480 + /* "streaming_form_data/_parser.pyx":482 * matched_length = max( * self.delimiter_finder.matched_length(), * self.ender_finder.matched_length() # <<<<<<<<<<<<<< @@ -17903,7 +18023,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc } __pyx_v_matched_length = __pyx_t_16; - /* "streaming_form_data/_parser.pyx":482 + /* "streaming_form_data/_parser.pyx":484 * self.ender_finder.matched_length() * ) * match_start = idx - matched_length # <<<<<<<<<<<<<< @@ -17912,7 +18032,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_match_start = (__pyx_v_idx - __pyx_v_matched_length); - /* "streaming_form_data/_parser.pyx":484 + /* "streaming_form_data/_parser.pyx":486 * match_start = idx - matched_length * * if match_start >= buffer_start + c_min_file_body_chunk_size: # <<<<<<<<<<<<<< @@ -17922,7 +18042,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_9 = (__pyx_v_match_start >= (__pyx_v_buffer_start + __pyx_v_19streaming_form_data_7_parser_c_min_file_body_chunk_size)); if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":485 + /* "streaming_form_data/_parser.pyx":487 * * if match_start >= buffer_start + c_min_file_body_chunk_size: * try: # <<<<<<<<<<<<<< @@ -17938,20 +18058,20 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __Pyx_XGOTREF(__pyx_t_13); /*try:*/ { - /* "streaming_form_data/_parser.pyx":486 + /* "streaming_form_data/_parser.pyx":488 * if match_start >= buffer_start + c_min_file_body_chunk_size: * try: * self.on_body(chunk[buffer_start: match_start]) # <<<<<<<<<<<<<< * except Exception: * self.mark_error() */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_body); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __pyx_L51_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_body); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 488, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_5); if (unlikely(__pyx_v_chunk == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 486, __pyx_L51_error) + __PYX_ERR(0, 488, __pyx_L51_error) } - __pyx_t_7 = PySequence_GetSlice(__pyx_v_chunk, __pyx_v_buffer_start, __pyx_v_match_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 486, __pyx_L51_error) + __pyx_t_7 = PySequence_GetSlice(__pyx_v_chunk, __pyx_v_buffer_start, __pyx_v_match_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 488, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = NULL; __pyx_t_8 = 0; @@ -17972,13 +18092,13 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 486, __pyx_L51_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 488, __pyx_L51_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "streaming_form_data/_parser.pyx":485 + /* "streaming_form_data/_parser.pyx":487 * * if match_start >= buffer_start + c_min_file_body_chunk_size: * try: # <<<<<<<<<<<<<< @@ -17997,7 +18117,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "streaming_form_data/_parser.pyx":487 + /* "streaming_form_data/_parser.pyx":489 * try: * self.on_body(chunk[buffer_start: match_start]) * except Exception: # <<<<<<<<<<<<<< @@ -18007,23 +18127,23 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0]))); if (__pyx_t_8) { __Pyx_AddTraceback("streaming_form_data._parser._Parser._parse", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 487, __pyx_L53_except_error) + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 489, __pyx_L53_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_5); __Pyx_XGOTREF(__pyx_t_7); - /* "streaming_form_data/_parser.pyx":488 + /* "streaming_form_data/_parser.pyx":490 * self.on_body(chunk[buffer_start: match_start]) * except Exception: * self.mark_error() # <<<<<<<<<<<<<< * raise * */ - __pyx_t_4 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L53_except_error) + __pyx_t_4 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser__Parser *)__pyx_v_self->__pyx_vtab)->mark_error(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 490, __pyx_L53_except_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "streaming_form_data/_parser.pyx":489 + /* "streaming_form_data/_parser.pyx":491 * except Exception: * self.mark_error() * raise # <<<<<<<<<<<<<< @@ -18035,11 +18155,11 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __Pyx_XGIVEREF(__pyx_t_7); __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_5, __pyx_t_7); __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_7 = 0; - __PYX_ERR(0, 489, __pyx_L53_except_error) + __PYX_ERR(0, 491, __pyx_L53_except_error) } goto __pyx_L53_except_error; - /* "streaming_form_data/_parser.pyx":485 + /* "streaming_form_data/_parser.pyx":487 * * if match_start >= buffer_start + c_min_file_body_chunk_size: * try: # <<<<<<<<<<<<<< @@ -18055,7 +18175,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_L56_try_end:; } - /* "streaming_form_data/_parser.pyx":491 + /* "streaming_form_data/_parser.pyx":493 * raise * * buffer_start = match_start # <<<<<<<<<<<<<< @@ -18064,7 +18184,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ __pyx_v_buffer_start = __pyx_v_match_start; - /* "streaming_form_data/_parser.pyx":484 + /* "streaming_form_data/_parser.pyx":486 * match_start = idx - matched_length * * if match_start >= buffer_start + c_min_file_body_chunk_size: # <<<<<<<<<<<<<< @@ -18073,7 +18193,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":477 + /* "streaming_form_data/_parser.pyx":479 * return ErrorGroup.Internal + 7 * * if self.state == ParserState.PS_READING_BODY: # <<<<<<<<<<<<<< @@ -18082,7 +18202,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":493 + /* "streaming_form_data/_parser.pyx":495 * buffer_start = match_start * * if idx - buffer_start > 0: # <<<<<<<<<<<<<< @@ -18092,7 +18212,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_t_9 = ((__pyx_v_idx - __pyx_v_buffer_start) > 0); if (__pyx_t_9) { - /* "streaming_form_data/_parser.pyx":494 + /* "streaming_form_data/_parser.pyx":496 * * if idx - buffer_start > 0: * self._leftover_buffer = chunk[buffer_start: idx] # <<<<<<<<<<<<<< @@ -18101,9 +18221,9 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ if (unlikely(__pyx_v_chunk == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 494, __pyx_L1_error) + __PYX_ERR(0, 496, __pyx_L1_error) } - __pyx_t_7 = PySequence_GetSlice(__pyx_v_chunk, __pyx_v_buffer_start, __pyx_v_idx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_7 = PySequence_GetSlice(__pyx_v_chunk, __pyx_v_buffer_start, __pyx_v_idx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __Pyx_GOTREF(__pyx_v_self->_leftover_buffer); @@ -18111,7 +18231,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_v_self->_leftover_buffer = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "streaming_form_data/_parser.pyx":493 + /* "streaming_form_data/_parser.pyx":495 * buffer_start = match_start * * if idx - buffer_start > 0: # <<<<<<<<<<<<<< @@ -18120,7 +18240,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc */ } - /* "streaming_form_data/_parser.pyx":496 + /* "streaming_form_data/_parser.pyx":498 * self._leftover_buffer = chunk[buffer_start: idx] * * return 0 # <<<<<<<<<<<<<< @@ -18132,8 +18252,8 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc __pyx_r = __pyx_int_0; goto __pyx_L0; - /* "streaming_form_data/_parser.pyx":291 - * return await self._parse(chunk, index) + /* "streaming_form_data/_parser.pyx":293 + * return (chunk, index) * * def _parse(self, bytes chunk, size_t index): # <<<<<<<<<<<<<< * cdef size_t idx, buffer_start, chunk_len @@ -18159,7 +18279,7 @@ static PyObject *__pyx_pf_19streaming_form_data_7_parser_7_Parser_24_parse(struc return __pyx_r; } -/* "streaming_form_data/_parser.pyx":503 +/* "streaming_form_data/_parser.pyx":505 * # update Finder object states. * * cdef size_t rewind_fast_forward( # <<<<<<<<<<<<<< @@ -18181,7 +18301,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rewind_fast_forward", 1); - /* "streaming_form_data/_parser.pyx":511 + /* "streaming_form_data/_parser.pyx":513 * * # we need at least 4 characters in buffer * if pos_first + 3 > pos_last: # <<<<<<<<<<<<<< @@ -18191,7 +18311,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar __pyx_t_1 = ((__pyx_v_pos_first + 3) > __pyx_v_pos_last); if (__pyx_t_1) { - /* "streaming_form_data/_parser.pyx":512 + /* "streaming_form_data/_parser.pyx":514 * # we need at least 4 characters in buffer * if pos_first + 3 > pos_last: * return 0 # <<<<<<<<<<<<<< @@ -18201,7 +18321,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar __pyx_r = 0; goto __pyx_L0; - /* "streaming_form_data/_parser.pyx":511 + /* "streaming_form_data/_parser.pyx":513 * * # we need at least 4 characters in buffer * if pos_first + 3 > pos_last: # <<<<<<<<<<<<<< @@ -18210,7 +18330,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ } - /* "streaming_form_data/_parser.pyx":516 + /* "streaming_form_data/_parser.pyx":518 * # calculate pointer to the first character of the buffer and the * # pointer to a character after the end of the buffer * ptr = chunk_ptr + pos_first + 3 # <<<<<<<<<<<<<< @@ -18219,7 +18339,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ __pyx_v_ptr = ((__pyx_v_chunk_ptr + __pyx_v_pos_first) + 3); - /* "streaming_form_data/_parser.pyx":517 + /* "streaming_form_data/_parser.pyx":519 * # pointer to a character after the end of the buffer * ptr = chunk_ptr + pos_first + 3 * ptr_end = chunk_ptr + pos_last + 1 # <<<<<<<<<<<<<< @@ -18228,7 +18348,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ __pyx_v_ptr_end = ((__pyx_v_chunk_ptr + __pyx_v_pos_last) + 1); - /* "streaming_form_data/_parser.pyx":518 + /* "streaming_form_data/_parser.pyx":520 * ptr = chunk_ptr + pos_first + 3 * ptr_end = chunk_ptr + pos_last + 1 * skipped = 0 # <<<<<<<<<<<<<< @@ -18237,7 +18357,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ __pyx_v_skipped = 0; - /* "streaming_form_data/_parser.pyx":525 + /* "streaming_form_data/_parser.pyx":527 * # is found. * * while True: # <<<<<<<<<<<<<< @@ -18246,7 +18366,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ while (1) { - /* "streaming_form_data/_parser.pyx":526 + /* "streaming_form_data/_parser.pyx":528 * * while True: * if ptr >= ptr_end: # <<<<<<<<<<<<<< @@ -18256,7 +18376,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar __pyx_t_1 = (__pyx_v_ptr >= __pyx_v_ptr_end); if (__pyx_t_1) { - /* "streaming_form_data/_parser.pyx":529 + /* "streaming_form_data/_parser.pyx":531 * # normalize pointer value because we could jump few characters * # past the buffer end * ptr = ptr_end - 1 # <<<<<<<<<<<<<< @@ -18265,7 +18385,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ __pyx_v_ptr = (__pyx_v_ptr_end - 1); - /* "streaming_form_data/_parser.pyx":534 + /* "streaming_form_data/_parser.pyx":536 * # keep up to 3 characters in the buffer until next chunk * # guess we will skip all characters in the buffer * skipped = pos_last - pos_first + 1 # <<<<<<<<<<<<<< @@ -18274,7 +18394,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ __pyx_v_skipped = ((__pyx_v_pos_last - __pyx_v_pos_first) + 1); - /* "streaming_form_data/_parser.pyx":536 + /* "streaming_form_data/_parser.pyx":538 * skipped = pos_last - pos_first + 1 * * if ptr[0] == c_cr: # <<<<<<<<<<<<<< @@ -18284,7 +18404,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar __pyx_t_1 = ((__pyx_v_ptr[0]) == __pyx_v_19streaming_form_data_7_parser_c_cr); if (__pyx_t_1) { - /* "streaming_form_data/_parser.pyx":537 + /* "streaming_form_data/_parser.pyx":539 * * if ptr[0] == c_cr: * skipped = skipped - 1 # <<<<<<<<<<<<<< @@ -18293,7 +18413,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ __pyx_v_skipped = (__pyx_v_skipped - 1); - /* "streaming_form_data/_parser.pyx":536 + /* "streaming_form_data/_parser.pyx":538 * skipped = pos_last - pos_first + 1 * * if ptr[0] == c_cr: # <<<<<<<<<<<<<< @@ -18303,7 +18423,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar goto __pyx_L7; } - /* "streaming_form_data/_parser.pyx":538 + /* "streaming_form_data/_parser.pyx":540 * if ptr[0] == c_cr: * skipped = skipped - 1 * elif ptr[0] == c_lf and ptr[-1] == c_cr: # <<<<<<<<<<<<<< @@ -18321,7 +18441,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar __pyx_L8_bool_binop_done:; if (__pyx_t_1) { - /* "streaming_form_data/_parser.pyx":539 + /* "streaming_form_data/_parser.pyx":541 * skipped = skipped - 1 * elif ptr[0] == c_lf and ptr[-1] == c_cr: * skipped = skipped - 2 # <<<<<<<<<<<<<< @@ -18330,7 +18450,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ __pyx_v_skipped = (__pyx_v_skipped - 2); - /* "streaming_form_data/_parser.pyx":538 + /* "streaming_form_data/_parser.pyx":540 * if ptr[0] == c_cr: * skipped = skipped - 1 * elif ptr[0] == c_lf and ptr[-1] == c_cr: # <<<<<<<<<<<<<< @@ -18340,7 +18460,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar goto __pyx_L7; } - /* "streaming_form_data/_parser.pyx":541 + /* "streaming_form_data/_parser.pyx":543 * skipped = skipped - 2 * elif ( * ptr[0] == c_hyphen # <<<<<<<<<<<<<< @@ -18354,7 +18474,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar goto __pyx_L10_bool_binop_done; } - /* "streaming_form_data/_parser.pyx":542 + /* "streaming_form_data/_parser.pyx":544 * elif ( * ptr[0] == c_hyphen * and ptr[-1] == c_lf # <<<<<<<<<<<<<< @@ -18368,7 +18488,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar goto __pyx_L10_bool_binop_done; } - /* "streaming_form_data/_parser.pyx":543 + /* "streaming_form_data/_parser.pyx":545 * ptr[0] == c_hyphen * and ptr[-1] == c_lf * and ptr[-2] == c_cr # <<<<<<<<<<<<<< @@ -18379,7 +18499,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar __pyx_t_1 = __pyx_t_2; __pyx_L10_bool_binop_done:; - /* "streaming_form_data/_parser.pyx":540 + /* "streaming_form_data/_parser.pyx":542 * elif ptr[0] == c_lf and ptr[-1] == c_cr: * skipped = skipped - 2 * elif ( # <<<<<<<<<<<<<< @@ -18388,7 +18508,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ if (__pyx_t_1) { - /* "streaming_form_data/_parser.pyx":545 + /* "streaming_form_data/_parser.pyx":547 * and ptr[-2] == c_cr * ): * skipped = skipped - 3 # <<<<<<<<<<<<<< @@ -18397,7 +18517,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ __pyx_v_skipped = (__pyx_v_skipped - 3); - /* "streaming_form_data/_parser.pyx":540 + /* "streaming_form_data/_parser.pyx":542 * elif ptr[0] == c_lf and ptr[-1] == c_cr: * skipped = skipped - 2 * elif ( # <<<<<<<<<<<<<< @@ -18407,7 +18527,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar } __pyx_L7:; - /* "streaming_form_data/_parser.pyx":546 + /* "streaming_form_data/_parser.pyx":548 * ): * skipped = skipped - 3 * break # <<<<<<<<<<<<<< @@ -18416,7 +18536,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ goto __pyx_L5_break; - /* "streaming_form_data/_parser.pyx":526 + /* "streaming_form_data/_parser.pyx":528 * * while True: * if ptr >= ptr_end: # <<<<<<<<<<<<<< @@ -18425,7 +18545,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ } - /* "streaming_form_data/_parser.pyx":548 + /* "streaming_form_data/_parser.pyx":550 * break * * if ptr[0] != c_hyphen: # <<<<<<<<<<<<<< @@ -18435,7 +18555,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar __pyx_t_1 = ((__pyx_v_ptr[0]) != __pyx_v_19streaming_form_data_7_parser_c_hyphen); if (__pyx_t_1) { - /* "streaming_form_data/_parser.pyx":549 + /* "streaming_form_data/_parser.pyx":551 * * if ptr[0] != c_hyphen: * ptr += 2 # <<<<<<<<<<<<<< @@ -18444,7 +18564,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ __pyx_v_ptr = (__pyx_v_ptr + 2); - /* "streaming_form_data/_parser.pyx":548 + /* "streaming_form_data/_parser.pyx":550 * break * * if ptr[0] != c_hyphen: # <<<<<<<<<<<<<< @@ -18454,7 +18574,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar goto __pyx_L13; } - /* "streaming_form_data/_parser.pyx":551 + /* "streaming_form_data/_parser.pyx":553 * ptr += 2 * else: * if ptr[-1] != c_hyphen: # <<<<<<<<<<<<<< @@ -18465,7 +18585,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar __pyx_t_1 = ((__pyx_v_ptr[-1L]) != __pyx_v_19streaming_form_data_7_parser_c_hyphen); if (__pyx_t_1) { - /* "streaming_form_data/_parser.pyx":552 + /* "streaming_form_data/_parser.pyx":554 * else: * if ptr[-1] != c_hyphen: * ptr += 1 # <<<<<<<<<<<<<< @@ -18474,7 +18594,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ __pyx_v_ptr = (__pyx_v_ptr + 1); - /* "streaming_form_data/_parser.pyx":551 + /* "streaming_form_data/_parser.pyx":553 * ptr += 2 * else: * if ptr[-1] != c_hyphen: # <<<<<<<<<<<<<< @@ -18484,7 +18604,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar goto __pyx_L14; } - /* "streaming_form_data/_parser.pyx":554 + /* "streaming_form_data/_parser.pyx":556 * ptr += 1 * else: * if ptr[-2] == c_lf and ptr[-3] == c_cr: # <<<<<<<<<<<<<< @@ -18503,117 +18623,117 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar __pyx_L16_bool_binop_done:; if (__pyx_t_1) { - /* "streaming_form_data/_parser.pyx":555 + /* "streaming_form_data/_parser.pyx":557 * else: * if ptr[-2] == c_lf and ptr[-3] == c_cr: * self.delimiter_finder.reset() # <<<<<<<<<<<<<< * self.delimiter_finder.feed(c_cr) * self.delimiter_finder.feed(c_lf) */ - __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->reset(__pyx_v_self->delimiter_finder); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->reset(__pyx_v_self->delimiter_finder); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "streaming_form_data/_parser.pyx":556 + /* "streaming_form_data/_parser.pyx":558 * if ptr[-2] == c_lf and ptr[-3] == c_cr: * self.delimiter_finder.reset() * self.delimiter_finder.feed(c_cr) # <<<<<<<<<<<<<< * self.delimiter_finder.feed(c_lf) * self.delimiter_finder.feed(c_hyphen) */ - __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->feed(__pyx_v_self->delimiter_finder, __pyx_v_19streaming_form_data_7_parser_c_cr, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->feed(__pyx_v_self->delimiter_finder, __pyx_v_19streaming_form_data_7_parser_c_cr, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "streaming_form_data/_parser.pyx":557 + /* "streaming_form_data/_parser.pyx":559 * self.delimiter_finder.reset() * self.delimiter_finder.feed(c_cr) * self.delimiter_finder.feed(c_lf) # <<<<<<<<<<<<<< * self.delimiter_finder.feed(c_hyphen) * self.delimiter_finder.feed(c_hyphen) */ - __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->feed(__pyx_v_self->delimiter_finder, __pyx_v_19streaming_form_data_7_parser_c_lf, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->feed(__pyx_v_self->delimiter_finder, __pyx_v_19streaming_form_data_7_parser_c_lf, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "streaming_form_data/_parser.pyx":558 + /* "streaming_form_data/_parser.pyx":560 * self.delimiter_finder.feed(c_cr) * self.delimiter_finder.feed(c_lf) * self.delimiter_finder.feed(c_hyphen) # <<<<<<<<<<<<<< * self.delimiter_finder.feed(c_hyphen) * */ - __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->feed(__pyx_v_self->delimiter_finder, __pyx_v_19streaming_form_data_7_parser_c_hyphen, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->feed(__pyx_v_self->delimiter_finder, __pyx_v_19streaming_form_data_7_parser_c_hyphen, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "streaming_form_data/_parser.pyx":559 + /* "streaming_form_data/_parser.pyx":561 * self.delimiter_finder.feed(c_lf) * self.delimiter_finder.feed(c_hyphen) * self.delimiter_finder.feed(c_hyphen) # <<<<<<<<<<<<<< * * self.ender_finder.reset() */ - __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->feed(__pyx_v_self->delimiter_finder, __pyx_v_19streaming_form_data_7_parser_c_hyphen, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->delimiter_finder->__pyx_vtab)->feed(__pyx_v_self->delimiter_finder, __pyx_v_19streaming_form_data_7_parser_c_hyphen, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "streaming_form_data/_parser.pyx":561 + /* "streaming_form_data/_parser.pyx":563 * self.delimiter_finder.feed(c_hyphen) * * self.ender_finder.reset() # <<<<<<<<<<<<<< * self.ender_finder.feed(c_cr) * self.ender_finder.feed(c_lf) */ - __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->reset(__pyx_v_self->ender_finder); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->reset(__pyx_v_self->ender_finder); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "streaming_form_data/_parser.pyx":562 + /* "streaming_form_data/_parser.pyx":564 * * self.ender_finder.reset() * self.ender_finder.feed(c_cr) # <<<<<<<<<<<<<< * self.ender_finder.feed(c_lf) * self.ender_finder.feed(c_hyphen) */ - __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->feed(__pyx_v_self->ender_finder, __pyx_v_19streaming_form_data_7_parser_c_cr, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->feed(__pyx_v_self->ender_finder, __pyx_v_19streaming_form_data_7_parser_c_cr, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "streaming_form_data/_parser.pyx":563 + /* "streaming_form_data/_parser.pyx":565 * self.ender_finder.reset() * self.ender_finder.feed(c_cr) * self.ender_finder.feed(c_lf) # <<<<<<<<<<<<<< * self.ender_finder.feed(c_hyphen) * self.ender_finder.feed(c_hyphen) */ - __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->feed(__pyx_v_self->ender_finder, __pyx_v_19streaming_form_data_7_parser_c_lf, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->feed(__pyx_v_self->ender_finder, __pyx_v_19streaming_form_data_7_parser_c_lf, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "streaming_form_data/_parser.pyx":564 + /* "streaming_form_data/_parser.pyx":566 * self.ender_finder.feed(c_cr) * self.ender_finder.feed(c_lf) * self.ender_finder.feed(c_hyphen) # <<<<<<<<<<<<<< * self.ender_finder.feed(c_hyphen) * */ - __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->feed(__pyx_v_self->ender_finder, __pyx_v_19streaming_form_data_7_parser_c_hyphen, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->feed(__pyx_v_self->ender_finder, __pyx_v_19streaming_form_data_7_parser_c_hyphen, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "streaming_form_data/_parser.pyx":565 + /* "streaming_form_data/_parser.pyx":567 * self.ender_finder.feed(c_lf) * self.ender_finder.feed(c_hyphen) * self.ender_finder.feed(c_hyphen) # <<<<<<<<<<<<<< * * skipped = (ptr - chunk_ptr) - pos_first + 1 */ - __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->feed(__pyx_v_self->ender_finder, __pyx_v_19streaming_form_data_7_parser_c_hyphen, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_t_3 = ((struct __pyx_vtabstruct_19streaming_form_data_7_parser_Finder *)__pyx_v_self->ender_finder->__pyx_vtab)->feed(__pyx_v_self->ender_finder, __pyx_v_19streaming_form_data_7_parser_c_hyphen, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "streaming_form_data/_parser.pyx":567 + /* "streaming_form_data/_parser.pyx":569 * self.ender_finder.feed(c_hyphen) * * skipped = (ptr - chunk_ptr) - pos_first + 1 # <<<<<<<<<<<<<< @@ -18622,7 +18742,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ __pyx_v_skipped = (((__pyx_v_ptr - __pyx_v_chunk_ptr) - __pyx_v_pos_first) + 1); - /* "streaming_form_data/_parser.pyx":569 + /* "streaming_form_data/_parser.pyx":571 * skipped = (ptr - chunk_ptr) - pos_first + 1 * * break # <<<<<<<<<<<<<< @@ -18631,7 +18751,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ goto __pyx_L5_break; - /* "streaming_form_data/_parser.pyx":554 + /* "streaming_form_data/_parser.pyx":556 * ptr += 1 * else: * if ptr[-2] == c_lf and ptr[-3] == c_cr: # <<<<<<<<<<<<<< @@ -18640,7 +18760,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar */ } - /* "streaming_form_data/_parser.pyx":570 + /* "streaming_form_data/_parser.pyx":572 * * break * ptr += 4 # <<<<<<<<<<<<<< @@ -18655,7 +18775,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar } __pyx_L5_break:; - /* "streaming_form_data/_parser.pyx":572 + /* "streaming_form_data/_parser.pyx":574 * ptr += 4 * * return skipped # <<<<<<<<<<<<<< @@ -18665,7 +18785,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar __pyx_r = __pyx_v_skipped; goto __pyx_L0; - /* "streaming_form_data/_parser.pyx":503 + /* "streaming_form_data/_parser.pyx":505 * # update Finder object states. * * cdef size_t rewind_fast_forward( # <<<<<<<<<<<<<< @@ -18683,7 +18803,7 @@ static size_t __pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forwar return __pyx_r; } -/* "streaming_form_data/_parser.pyx":574 +/* "streaming_form_data/_parser.pyx":576 * return skipped * * cdef mark_error(self): # <<<<<<<<<<<<<< @@ -18704,7 +18824,7 @@ static PyObject *__pyx_f_19streaming_form_data_7_parser_7_Parser_mark_error(stru int __pyx_clineno = 0; __Pyx_RefNannySetupContext("mark_error", 1); - /* "streaming_form_data/_parser.pyx":575 + /* "streaming_form_data/_parser.pyx":577 * * cdef mark_error(self): * self.state = ParserState.PS_ERROR # <<<<<<<<<<<<<< @@ -18713,21 +18833,21 @@ static PyObject *__pyx_f_19streaming_form_data_7_parser_7_Parser_mark_error(stru */ __pyx_v_self->state = __pyx_e_19streaming_form_data_7_parser_PS_ERROR; - /* "streaming_form_data/_parser.pyx":577 + /* "streaming_form_data/_parser.pyx":579 * self.state = ParserState.PS_ERROR * * if self.active_part: # <<<<<<<<<<<<<< * self.active_part.finish() */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->active_part); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 577, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->active_part); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 579, __pyx_L1_error) if (__pyx_t_1) { - /* "streaming_form_data/_parser.pyx":578 + /* "streaming_form_data/_parser.pyx":580 * * if self.active_part: * self.active_part.finish() # <<<<<<<<<<<<<< */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->active_part, __pyx_n_s_finish); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->active_part, __pyx_n_s_finish); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -18747,13 +18867,13 @@ static PyObject *__pyx_f_19streaming_form_data_7_parser_7_Parser_mark_error(stru PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "streaming_form_data/_parser.pyx":577 + /* "streaming_form_data/_parser.pyx":579 * self.state = ParserState.PS_ERROR * * if self.active_part: # <<<<<<<<<<<<<< @@ -18761,7 +18881,7 @@ static PyObject *__pyx_f_19streaming_form_data_7_parser_7_Parser_mark_error(stru */ } - /* "streaming_form_data/_parser.pyx":574 + /* "streaming_form_data/_parser.pyx":576 * return skipped * * cdef mark_error(self): # <<<<<<<<<<<<<< @@ -24041,26 +24161,26 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__61); __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_streaming_form_data__parser_pyx, __pyx_n_s_data_received, 257, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 257, __pyx_L1_error) - /* "streaming_form_data/_parser.pyx":274 + /* "streaming_form_data/_parser.pyx":268 * return self._parse(chunk, index) * * async def async_data_received(self, bytes data): # <<<<<<<<<<<<<< * if not data: * return 0 */ - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_streaming_form_data__parser_pyx, __pyx_n_s_async_data_received, 274, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_COROUTINE, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_streaming_form_data__parser_pyx, __pyx_n_s_async_data_received, 268, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 268, __pyx_L1_error) - /* "streaming_form_data/_parser.pyx":291 - * return await self._parse(chunk, index) + /* "streaming_form_data/_parser.pyx":293 + * return (chunk, index) * * def _parse(self, bytes chunk, size_t index): # <<<<<<<<<<<<<< * cdef size_t idx, buffer_start, chunk_len * cdef size_t match_start, skip_count, matched_length */ - __pyx_tuple__63 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_chunk, __pyx_n_s_index, __pyx_n_s_idx, __pyx_n_s_buffer_start, __pyx_n_s_chunk_len, __pyx_n_s_match_start, __pyx_n_s_skip_count, __pyx_n_s_matched_length, __pyx_n_s_byte, __pyx_n_s_chunk_ptr, __pyx_n_s_message, __pyx_n_s_params, __pyx_n_s_name, __pyx_n_s_part); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_tuple__63 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_chunk, __pyx_n_s_index, __pyx_n_s_idx, __pyx_n_s_buffer_start, __pyx_n_s_chunk_len, __pyx_n_s_match_start, __pyx_n_s_skip_count, __pyx_n_s_matched_length, __pyx_n_s_byte, __pyx_n_s_chunk_ptr, __pyx_n_s_message, __pyx_n_s_params, __pyx_n_s_name, __pyx_n_s_part); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__63); __Pyx_GIVEREF(__pyx_tuple__63); - __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_streaming_form_data__parser_pyx, __pyx_n_s_parse, 291, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_streaming_form_data__parser_pyx, __pyx_n_s_parse, 293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 293, __pyx_L1_error) /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< @@ -24248,6 +24368,7 @@ static int __Pyx_modinit_type_init_code(void) { #endif __pyx_vtabptr_19streaming_form_data_7_parser__Parser = &__pyx_vtable_19streaming_form_data_7_parser__Parser; __pyx_vtable_19streaming_form_data_7_parser__Parser._part_for = (PyObject *(*)(struct __pyx_obj_19streaming_form_data_7_parser__Parser *, PyObject *))__pyx_f_19streaming_form_data_7_parser_7_Parser__part_for; + __pyx_vtable_19streaming_form_data_7_parser__Parser.include_leftover_buffer = (PyObject *(*)(struct __pyx_obj_19streaming_form_data_7_parser__Parser *, PyObject *))__pyx_f_19streaming_form_data_7_parser_7_Parser_include_leftover_buffer; __pyx_vtable_19streaming_form_data_7_parser__Parser.rewind_fast_forward = (size_t (*)(struct __pyx_obj_19streaming_form_data_7_parser__Parser *, __pyx_t_19streaming_form_data_7_parser_Byte const *, size_t, size_t))__pyx_f_19streaming_form_data_7_parser_7_Parser_rewind_fast_forward; __pyx_vtable_19streaming_form_data_7_parser__Parser.mark_error = (PyObject *(*)(struct __pyx_obj_19streaming_form_data_7_parser__Parser *))__pyx_f_19streaming_form_data_7_parser_7_Parser_mark_error; #if CYTHON_USE_TYPE_SPECS @@ -24392,15 +24513,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_19streaming_form_data_7_parser___pyx_scope_struct_6_async_data_received = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_19streaming_form_data_7_parser___pyx_scope_struct_6_async_data_received_spec, NULL); if (unlikely(!__pyx_ptype_19streaming_form_data_7_parser___pyx_scope_struct_6_async_data_received)) __PYX_ERR(0, 274, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_19streaming_form_data_7_parser___pyx_scope_struct_6_async_data_received_spec, __pyx_ptype_19streaming_form_data_7_parser___pyx_scope_struct_6_async_data_received) < 0) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_ptype_19streaming_form_data_7_parser___pyx_scope_struct_6_async_data_received = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_19streaming_form_data_7_parser___pyx_scope_struct_6_async_data_received_spec, NULL); if (unlikely(!__pyx_ptype_19streaming_form_data_7_parser___pyx_scope_struct_6_async_data_received)) __PYX_ERR(0, 268, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_19streaming_form_data_7_parser___pyx_scope_struct_6_async_data_received_spec, __pyx_ptype_19streaming_form_data_7_parser___pyx_scope_struct_6_async_data_received) < 0) __PYX_ERR(0, 268, __pyx_L1_error) #else __pyx_ptype_19streaming_form_data_7_parser___pyx_scope_struct_6_async_data_received = &__pyx_type_19streaming_form_data_7_parser___pyx_scope_struct_6_async_data_received; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_19streaming_form_data_7_parser___pyx_scope_struct_6_async_data_received) < 0) __PYX_ERR(0, 274, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_19streaming_form_data_7_parser___pyx_scope_struct_6_async_data_received) < 0) __PYX_ERR(0, 268, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_19streaming_form_data_7_parser___pyx_scope_struct_6_async_data_received->tp_print = 0; @@ -26009,29 +26130,29 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_19streaming_form_data_7_parser__Parser); - /* "streaming_form_data/_parser.pyx":274 + /* "streaming_form_data/_parser.pyx":268 * return self._parse(chunk, index) * * async def async_data_received(self, bytes data): # <<<<<<<<<<<<<< * if not data: * return 0 */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_19streaming_form_data_7_parser_7_Parser_22async_data_received, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_Parser_async_data_received, NULL, __pyx_n_s_streaming_form_data__parser, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_19streaming_form_data_7_parser_7_Parser_22async_data_received, __Pyx_CYFUNCTION_CCLASS | __Pyx_CYFUNCTION_COROUTINE, __pyx_n_s_Parser_async_data_received, NULL, __pyx_n_s_streaming_form_data__parser, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_19streaming_form_data_7_parser__Parser, __pyx_n_s_async_data_received, __pyx_t_4) < 0) __PYX_ERR(0, 274, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_19streaming_form_data_7_parser__Parser, __pyx_n_s_async_data_received, __pyx_t_4) < 0) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_19streaming_form_data_7_parser__Parser); - /* "streaming_form_data/_parser.pyx":291 - * return await self._parse(chunk, index) + /* "streaming_form_data/_parser.pyx":293 + * return (chunk, index) * * def _parse(self, bytes chunk, size_t index): # <<<<<<<<<<<<<< * cdef size_t idx, buffer_start, chunk_len * cdef size_t match_start, skip_count, matched_length */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_19streaming_form_data_7_parser_7_Parser_25_parse, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser__parse, NULL, __pyx_n_s_streaming_form_data__parser, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_19streaming_form_data_7_parser_7_Parser_25_parse, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Parser__parse, NULL, __pyx_n_s_streaming_form_data__parser, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_19streaming_form_data_7_parser__Parser, __pyx_n_s_parse, __pyx_t_4) < 0) __PYX_ERR(0, 291, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_19streaming_form_data_7_parser__Parser, __pyx_n_s_parse, __pyx_t_4) < 0) __PYX_ERR(0, 293, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; PyType_Modified(__pyx_ptype_19streaming_form_data_7_parser__Parser); @@ -29772,6 +29893,44 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) return 0; } +/* RaiseTooManyValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { + PyErr_Format(PyExc_ValueError, + "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); +} + +/* RaiseNeedMoreValuesToUnpack */ + static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { + PyErr_Format(PyExc_ValueError, + "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", + index, (index == 1) ? "" : "s"); +} + +/* IterFinish */ + static CYTHON_INLINE int __Pyx_IterFinish(void) { + PyObject* exc_type; + __Pyx_PyThreadState_declare + __Pyx_PyThreadState_assign + exc_type = __Pyx_PyErr_CurrentExceptionType(); + if (unlikely(exc_type)) { + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) + return -1; + __Pyx_PyErr_Clear(); + return 0; + } + return 0; +} + +/* UnpackItemEndCheck */ + static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { + if (unlikely(retval)) { + Py_DECREF(retval); + __Pyx_RaiseTooManyValuesError(expected); + return -1; + } + return __Pyx_IterFinish(); +} + /* ReturnWithStopIteration */ static void __Pyx__ReturnWithStopIteration(PyObject* value) { PyObject *exc, *args; diff --git a/streaming_form_data/_parser.pyx b/streaming_form_data/_parser.pyx index e0953461..79ac1da2 100644 --- a/streaming_form_data/_parser.pyx +++ b/streaming_form_data/_parser.pyx @@ -261,13 +261,7 @@ cdef class _Parser: cdef bytes chunk cdef size_t index - if self._leftover_buffer: - chunk = self._leftover_buffer + data - index = len(self._leftover_buffer) - self._leftover_buffer = None - else: - chunk = data - index = 0 + chunk, index = self.include_leftover_buffer(data) return self._parse(chunk, index) @@ -278,6 +272,14 @@ cdef class _Parser: cdef bytes chunk cdef size_t index + chunk, index = self.include_leftover_buffer(data) + + return await self._parse(chunk, index) + + cdef include_leftover_buffer(self, bytes data): + cdef bytes chunk + cdef size_t index + if self._leftover_buffer: chunk = self._leftover_buffer + data index = len(self._leftover_buffer) @@ -286,7 +288,7 @@ cdef class _Parser: chunk = data index = 0 - return await self._parse(chunk, index) + return (chunk, index) def _parse(self, bytes chunk, size_t index): cdef size_t idx, buffer_start, chunk_len