Skip to content

Commit c37aaaa

Browse files
author
Sergey Pariev
committed
fixing error in test_unit checks
1 parent a6f5355 commit c37aaaa

1 file changed

Lines changed: 9 additions & 14 deletions

File tree

src/impl/http_parser/lolevel/HTTPParser.java

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ public int execute(ParserSettings settings, ByteBuffer data) {
12691269
// Exit, the rest of the connect is in a different protocol.
12701270
if (upgrade) {
12711271
settings.call_on_message_complete(this);
1272-
state = State.body_identity_eof;
1272+
state = new_message();
12731273
return data.position()-this.p_start;
12741274
}
12751275

@@ -1307,24 +1307,19 @@ public int execute(ParserSettings settings, ByteBuffer data) {
13071307

13081308
/******************* Body *******************/
13091309
case body_identity:
1310-
//TODO apply changes from C version for s_body_identity
13111310
to_read = min(pe - p, content_length); //TODO change to use buffer?
13121311
body_mark = p;
13131312

1314-
// if (to_read > 0) {
1315-
settings.call_on_body(this, data, p, to_read);
1316-
data.position(p+to_read);
1317-
content_length -= to_read;
1313+
if (to_read > 0) {
1314+
settings.call_on_body(this, data, p, to_read);
1315+
data.position(p+to_read);
1316+
content_length -= to_read;
13181317

1319-
if (content_length == 0) {
1320-
state = message_done;
1321-
settings.call_on_message_complete(this);
1322-
// state = new_message();
1323-
reexecute = true;
1318+
if (content_length == 0) {
1319+
state = message_done;
1320+
reexecute = true;
1321+
}
13241322
}
1325-
// }
1326-
1327-
13281323
break;
13291324

13301325

0 commit comments

Comments
 (0)