When the last boundary was encountered, the onPartEnd and onEnd callbacks were not being called, nor was the parser state set to END. Modified last boundary handling logic to call these callbacks and set the parser state. Mirrors a matching fix in formidable.js.
MultipartReader always passes an uninitialized pointer as the userData argument for all callbacks, and a MultipartReader instance's userData cannot be set externally. Modified MultipartReader to initialize and expose the userData property as in MultipartParser.
…a separate function in commit 6c2014a. The feed state is also now passed by reference to processPartData, so that the feed state is correctly updated. Fixed minor typo inherited from original formidable.js source code.
…anning through it.
…ntation. This makes it significantly faster.
…s up as a seperate entry in the profiler.
… write a lot of redundant state-keeping situps.
When we discard a started boundary at the end of a part's data block, we need to re-consider the current character as it could be the beginning of a new boundary sequence itself.