Merge pull request #2552 from eclipse/jetty-9.4.x-2549-ConsumeAll

Issue #2549 ConsumeAll forced EOF or EarlyEOF
This commit is contained in:
Simone Bordet 2018-05-18 09:18:57 +02:00 committed by GitHub
commit 6b7f4c91db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View File

@ -102,8 +102,8 @@ public class HttpChannelOverHTTP extends HttpChannel
if ((response.getVersion() == HttpVersion.HTTP_1_1) &&
(response.getStatus() == HttpStatus.SWITCHING_PROTOCOLS_101))
{
String connection = response.getHeaders().get(HttpHeader.CONNECTION);
if ((connection == null) || !connection.toLowerCase(Locale.US).contains("upgrade"))
String next_connection = response.getHeaders().get(HttpHeader.CONNECTION);
if ((next_connection == null) || !next_connection.toLowerCase(Locale.US).contains("upgrade"))
{
return new Result(result,new HttpResponseException("101 Switching Protocols without Connection: Upgrade not supported",response));
}

View File

@ -679,11 +679,16 @@ public class HttpInput extends ServletInputStream implements Runnable
skip(item, item.remaining());
}
return isFinished() && !isError();
if (isFinished())
return !isError();
_state = EARLY_EOF;
return false;
}
catch (IOException e)
catch (Throwable e)
{
LOG.debug(e);
_state = new ErrorState(e);
return false;
}
}