Skip to content

Commit

Permalink
Reverted 82a0052.
Browse files Browse the repository at this point in the history
The connection upgrade check is necessary both after the parsing and
after the handling. After the parsing covers HTTP/2 prior knowledge
"PRI * HTTP/2" case; after the handling covers the WebSocket case.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
  • Loading branch information
sbordet committed Oct 2, 2019
1 parent bb939f6 commit 7810f2d
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,19 @@ else if (filled == -1 && getEndPoint().isOutputShutdown())
// Parse the request buffer.
boolean handle = parseRequestBuffer();

// There could be a connection upgrade before handling
// the HTTP/1.1 request, for example PRI * HTTP/2.
// If there was a connection upgrade, the other
// connection took over, nothing more to do here.
if (getEndPoint().getConnection() != this)
break;

// Handle channel event
if (handle)
{
boolean suspended = !_channel.handle();

// We should break iteration if we have suspended or changed connection or this is not the handling thread.
// We should break iteration if we have suspended or upgraded the connection.
if (suspended || getEndPoint().getConnection() != this)
break;
}
Expand Down

0 comments on commit 7810f2d

Please sign in to comment.