Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt2012-08-03 11:49:48 -0400
committerJoakim Erdfelt2012-08-03 11:49:48 -0400
commit65cb45308044c4ef0684c99767557e839d81999c (patch)
tree36c850caf85014eb1cb437992ba3709daa541b18 /jetty-websocket
parent57f16d750d0120d02d9d60828c71daaaf4d83a3f (diff)
downloadorg.eclipse.jetty.project-65cb45308044c4ef0684c99767557e839d81999c.tar.gz
org.eclipse.jetty.project-65cb45308044c4ef0684c99767557e839d81999c.tar.xz
org.eclipse.jetty.project-65cb45308044c4ef0684c99767557e839d81999c.zip
Attempting to come to terms with EofException condition
Diffstat (limited to 'jetty-websocket')
-rw-r--r--jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/ControlFrameBytes.java6
-rw-r--r--jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/DataFrameBytes.java1
-rw-r--r--jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/FrameBytes.java11
-rw-r--r--jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/WebSocketAsyncConnection.java1
4 files changed, 16 insertions, 3 deletions
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/ControlFrameBytes.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/ControlFrameBytes.java
index 79f0f209b9..f42067df2a 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/ControlFrameBytes.java
+++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/ControlFrameBytes.java
@@ -43,7 +43,11 @@ public class ControlFrameBytes<C> extends FrameBytes<C>
if (frame.getOpCode() == OpCode.CLOSE)
{
// Disconnect the connection (no more packets/frames)
- connection.disconnect(true); // FIXME (should only shutdown output here)
+ connection.disconnect(false);
+ }
+ else
+ {
+ connection.flush();
}
}
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/DataFrameBytes.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/DataFrameBytes.java
index 13148f19f2..570ab6ea24 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/DataFrameBytes.java
+++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/DataFrameBytes.java
@@ -53,6 +53,7 @@ public class DataFrameBytes<C> extends FrameBytes<C>
{
super.completed(context);
}
+ connection.flush();
}
@Override
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/FrameBytes.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/FrameBytes.java
index 783bd103da..abd0644cf6 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/FrameBytes.java
+++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/FrameBytes.java
@@ -20,6 +20,7 @@ import java.nio.ByteBuffer;
import java.nio.channels.InterruptedByTimeoutException;
import java.util.concurrent.ScheduledFuture;
+import org.eclipse.jetty.io.EofException;
import org.eclipse.jetty.util.Callback;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@@ -67,7 +68,15 @@ public abstract class FrameBytes<C> implements Callback<C>, Runnable
@Override
public void failed(C context, Throwable x)
{
- LOG.warn("failed(" + context + ")",x);
+ if (x instanceof EofException)
+ {
+ // Abbreviate the EofException
+ LOG.warn("failed(" + context + ") - " + EofException.class);
+ }
+ else
+ {
+ LOG.warn("failed(" + context + ")",x);
+ }
cancelTask();
callback.failed(context,x);
}
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/WebSocketAsyncConnection.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/WebSocketAsyncConnection.java
index 2cb5c92bc1..ed8ce60876 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/WebSocketAsyncConnection.java
+++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/io/WebSocketAsyncConnection.java
@@ -99,7 +99,6 @@ public abstract class WebSocketAsyncConnection extends AbstractAsyncConnection i
}
flushing = false;
}
- flush();
}
@Override

Back to the top