Fixed NullPointerException during HTTP/1.1 -> HTTP/2 upgrades.
The upgrade could happen in the context of a HttpParser.parseNext() call, which eventually upgrades the EndPoint, passing what remains in the NetworkBuffer to the new Connection and releasing the NetworkBuffer. The messageComplete() parser callback was still returning false even if the response was 101, causing the HTTP/1.1 parser to continue, but now the NetworkBuffer was null, producing the NullPointerException. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
ce4bb35e97
commit
963ea59e75
|
@ -371,7 +371,10 @@ public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.Res
|
|||
complete = true;
|
||||
}
|
||||
|
||||
return !responseSuccess(exchange);
|
||||
boolean stopParsing = !responseSuccess(exchange);
|
||||
if (status == HttpStatus.SWITCHING_PROTOCOLS_101)
|
||||
stopParsing = true;
|
||||
return stopParsing;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue