Fixes #1816 - HttpClientTest.testClientCannotValidateServerCertificate() hangs with JDK 9.

Now upgrading the connection also in cased of filled=-1, so that the
new nested connection attempts to read/write and will see a failure
(although not the SslHandshakeException).
This commit is contained in:
Simone Bordet 2017-09-13 15:26:44 +02:00
parent ac2776259c
commit 8d03e97205
1 changed files with 9 additions and 5 deletions

View File

@ -80,13 +80,17 @@ public abstract class NegotiatingClientConnection extends AbstractConnection
while (true)
{
int filled = fill();
if (filled == 0 && !completed)
fillInterested();
if (filled <= 0 || completed)
if (completed || filled < 0)
{
replaceConnection();
break;
}
if (filled == 0)
{
fillInterested();
break;
}
}
if (completed)
replaceConnection();
}
private int fill()