Skip to content

Instantly share code, notes, and snippets.

@gregw
Created November 9, 2016 22:08
Show Gist options
  • Save gregw/020cd0ee7f448e0d651790f3c519c5d2 to your computer and use it in GitHub Desktop.
Save gregw/020cd0ee7f448e0d651790f3c519c5d2 to your computer and use it in GitHub Desktop.
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java
index 20e6c2b..3ef3994 100644
--- a/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java
@@ -944,11 +944,41 @@ public class SslConnection extends AbstractConnection
getEndPoint().close();
}
}
+
+ Callback _nonBlockingReadCallback = new Callback.NonBlocking()
+ {
+ @Override
+ public void succeeded()
+ {
+ SslConnection.this.onFillable();
+ }
+
+ @Override
+ public void failed(final Throwable x)
+ {
+ SslConnection.this.onFillInterestedFailed(x);
+ }
+
+ @Override
+ public String toString()
+ {
+ return String.format("SSLC.NBReadCB@%x{%s}", SslConnection.this.hashCode(),SslConnection.this);
+ }
+ };
private void ensureFillInterested()
{
if (!SslConnection.this.isFillInterested())
- SslConnection.this.fillInterested();
+ {
+ if (getFillInterest().isCallbackNonBlocking())
+ {
+ SslConnection.this.getEndPoint().fillInterested(_nonBlockingReadCallback);
+ }
+ else
+ {
+ SslConnection.this.fillInterested();
+ }
+ }
}
@Override
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment