File tree Expand file tree Collapse file tree
src/impl/http_parser/lolevel Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments