Permalink
Browse files

Fix for bug introduced in when PART_DATA processing was extracted to …

…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.
  • Loading branch information...
1 parent 19484b8 commit 374f11ef444a7ab7dcc80b1d8a27a8b286e803bd @johnyanarella johnyanarella committed May 12, 2011
Showing with 3 additions and 4 deletions.
  1. +3 −4 MultipartParser.h
View
@@ -122,12 +122,12 @@ class MultipartParser {
}
void processPartData(size_t &prevIndex, size_t &index, const char *buffer,
- size_t len, size_t boundaryEnd, size_t &i, char c, int &flags)
+ size_t len, size_t boundaryEnd, size_t &i, char c, State &state, int &flags)
{
prevIndex = index;
if (index == 0) {
- // boyer-moore derrived algorithm to safely skip non-boundary data
+ // boyer-moore derived algorithm to safely skip non-boundary data
while (i + boundarySize <= len) {
if (isBoundaryChar(buffer[i + boundaryEnd])) {
break;
@@ -389,8 +389,7 @@ class MultipartParser {
state = PART_DATA;
partDataMark = i;
case PART_DATA:
- processPartData(prevIndex, index, buffer, len, boundaryEnd,
- i, c, flags);
+ processPartData(prevIndex, index, buffer, len, boundaryEnd, i, c, state, flags);
break;
default:
return i;

0 comments on commit 374f11e

Please sign in to comment.