Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2015-01-02 13:33:25 +0000
committerGreg Wilkins2015-01-02 13:33:25 +0000
commit39b478e2c4a39929e7a5ad2707b8747d65d3880c (patch)
tree3aba70221d88a05850ddfa9aa431d4cf41ab6752
parent3ad8f627e78ba778951ae918d5be2e3c9976ca25 (diff)
downloadorg.eclipse.jetty.project-39b478e2c4a39929e7a5ad2707b8747d65d3880c.tar.gz
org.eclipse.jetty.project-39b478e2c4a39929e7a5ad2707b8747d65d3880c.tar.xz
org.eclipse.jetty.project-39b478e2c4a39929e7a5ad2707b8747d65d3880c.zip
Speculative fix for EWYK SSL client
-rw-r--r--jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java5
-rw-r--r--jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java2
-rw-r--r--jetty-io/src/main/java/org/eclipse/jetty/io/ssl/SslConnection.java30
3 files changed, 22 insertions, 15 deletions
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java
index 3d18de40ba..0a8993bb27 100644
--- a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractConnection.java
@@ -117,6 +117,11 @@ public abstract class AbstractConnection implements Connection
getEndPoint().fillInterested(_readCallback);
}
+ public boolean isFillInterested()
+ {
+ return ((AbstractEndPoint)getEndPoint()).getFillInterest().isInterested();
+ }
+
/**
* <p>Callback method invoked when the endpoint is ready to be read.</p>
* @see #fillInterested()
diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java
index 169123c58c..769106d9b1 100644
--- a/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java
+++ b/jetty-io/src/main/java/org/eclipse/jetty/io/AbstractEndPoint.java
@@ -132,7 +132,7 @@ public abstract class AbstractEndPoint extends IdleTimeout implements EndPoint
protected abstract void needsFillInterest() throws IOException;
- protected FillInterest getFillInterest()
+ public FillInterest getFillInterest()
{
return _fillInterest;
}
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 024977ef77..7d6276b68d 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
@@ -333,12 +333,6 @@ public class SslConnection extends AbstractConnection
}
@Override
- protected FillInterest getFillInterest()
- {
- return super.getFillInterest();
- }
-
- @Override
public void setIdleTimeout(long idleTimeout)
{
super.setIdleTimeout(idleTimeout);
@@ -375,7 +369,8 @@ public class SslConnection extends AbstractConnection
{
// check if we are actually read blocked in order to write
_flushRequiresFillToProgress = true;
- SslConnection.this.fillInterested();
+
+ ensureFillInterested();
}
else
{
@@ -450,12 +445,10 @@ public class SslConnection extends AbstractConnection
}
}
-
if (fillable)
getExecutor().execute(_runFillable);
- else
- SslConnection.this.fillInterested();
-
+ else
+ ensureFillInterested();
}
}
@@ -879,9 +872,12 @@ public class SslConnection extends AbstractConnection
{
try
{
- _sslEngine.closeOutbound();
- flush(BufferUtil.EMPTY_BUFFER); // Send close handshake
- // TODO SslConnection.this.fillInterested(); // seek reply FIN or RST or close handshake
+ synchronized (this) // TODO review synchronized boundary
+ {
+ _sslEngine.closeOutbound();
+ flush(BufferUtil.EMPTY_BUFFER); // Send close handshake
+ ensureFillInterested();
+ }
}
catch (Exception e)
{
@@ -891,6 +887,12 @@ public class SslConnection extends AbstractConnection
}
}
+ private void ensureFillInterested()
+ {
+ if (!SslConnection.this.isFillInterested())
+ SslConnection.this.fillInterested();
+ }
+
@Override
public boolean isOutputShutdown()
{

Back to the top