@@ -177,7 +177,7 @@ public int execute(ParserSettings settings, ByteBuffer data) {
177177 settings .call_on_error (this , "possible buffer overflow" , data , p_err );
178178 }
179179 }
180- p (state + ":" + ch +":" +p );
180+ // p(state + ":" + ch +":"+p);
181181 switch (state ) {
182182 /*
183183 * this state is used after a 'Connection: close' message
@@ -547,8 +547,6 @@ public int execute(ParserSettings settings, ByteBuffer data) {
547547 break ;
548548
549549 case req_path :
550- p (chi );
551- p (normal_url_char [chi ]);
552550 if (normal_url_char [chi ]) break ;
553551 switch (ch ) {
554552 case SPACE :
@@ -902,6 +900,9 @@ public int execute(ParserSettings settings, ByteBuffer data) {
902900 if (!headers_almost_done (ch , settings )) {
903901 settings .call_on_error (this , "header not properly completed" , data , p_err );
904902 }
903+ if (upgrade ) {
904+ return data .position () - start_position ;
905+ }
905906 break ;
906907 }
907908
@@ -1243,6 +1244,9 @@ public int execute(ParserSettings settings, ByteBuffer data) {
12431244 if (!headers_almost_done (ch , settings )) {
12441245 settings .call_on_error (this , "header not properly completed" , data , p_err );
12451246 }
1247+ if (upgrade ) {
1248+ return data .position ()-start_position ;
1249+ }
12461250 break ;
12471251
12481252 /******************* Header *******************/
0 commit comments