From c04896c9cb0d80705f143fb4d2e963ea123cd611 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Thu, 30 Apr 2015 09:33:10 +0200 Subject: [PATCH] 465857 - Support HTTP/2 clear-text server-side upgrade. Added earlier check about the connection being upgraded to avoid doing more work in the now obsolete connection. --- .../main/java/org/eclipse/jetty/server/HttpConnection.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java index 83d4d0b3757..661f7d65446 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java @@ -224,6 +224,10 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http // Parse the request buffer boolean handle = parseRequestBuffer(); + // If there was a connection upgrade, the other + // connection took over, nothing more to do here. + if (getEndPoint().getConnection()!=this) + break; // Handle close parser if (_parser.isClose()) @@ -245,8 +249,7 @@ public class HttpConnection extends AbstractConnection implements Runnable, Http // Continue or break? else if (filled<=0) { - // Be fill interested only if there was no connection upgrade. - if (filled==0 && getEndPoint().getConnection()==this) + if (filled==0) fillInterested(); break; }