Issue #3787 - Jetty client throws EOFException instead of SSLHandshakeException on certificate errors.

Code cleanups.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2019-09-26 18:18:13 +02:00
parent ba728eee5d
commit d12df30df7
4 changed files with 16 additions and 4 deletions

View File

@ -410,6 +410,9 @@ public abstract class HttpReceiver
if (exchange == null)
return false;
if (LOG.isDebugEnabled())
LOG.debug("Response failure " + exchange.getResponse(), failure);
// Mark atomically the response as completed, with respect
// to concurrency between response success and response failure.
if (exchange.responseComplete(failure))
@ -514,7 +517,7 @@ public abstract class HttpReceiver
HttpResponse response = exchange.getResponse();
if (LOG.isDebugEnabled())
LOG.debug("Response failure {} {} on {}: {}", response, exchange, getHttpChannel(), failure);
LOG.debug("Response abort {} {} on {}: {}", response, exchange, getHttpChannel(), failure);
List<Response.ResponseListener> listeners = exchange.getConversation().getResponseListeners();
ResponseNotifier notifier = getHttpDestination().getResponseNotifier();
notifier.notifyFailure(listeners, response, failure);

View File

@ -344,6 +344,9 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
if (exchange == null)
return;
if (LOG.isDebugEnabled())
LOG.debug("Request failure " + exchange.getRequest(), failure);
// Mark atomically the request as completed, with respect
// to concurrency between request success and request failure.
if (exchange.requestComplete(failure))
@ -559,7 +562,7 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
Request request = exchange.getRequest();
if (LOG.isDebugEnabled())
LOG.debug("Request failure {} {} on {}: {}", request, exchange, getHttpChannel(), failure);
LOG.debug("Request abort {} {} on {}: {}", request, exchange, getHttpChannel(), failure);
HttpDestination destination = getHttpChannel().getHttpDestination();
destination.getRequestNotifier().notifyFailure(request, failure);

View File

@ -288,7 +288,6 @@ public class HttpSenderOverHTTP extends HttpSender
public void failed(Throwable x)
{
release();
callback.failed(x);
super.failed(x);
}
@ -299,6 +298,13 @@ public class HttpSenderOverHTTP extends HttpSender
callback.succeeded();
}
@Override
protected void onCompleteFailure(Throwable cause)
{
super.onCompleteFailure(cause);
callback.failed(cause);
}
private void release()
{
ByteBufferPool bufferPool = httpClient.getByteBufferPool();

View File

@ -1,5 +1,5 @@
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
org.eclipse.jetty.LEVEL=INFO
#org.eclipse.jetty.LEVEL=DEBUG
#org.eclipse.jetty.io.AbstractConnection.LEVEL=DEBUG
#org.eclipse.jetty.io.ManagedSelector.LEVEL=DEBUG
#org.eclipse.jetty.io.ssl.SslConnection.LEVEL=DEBUG