Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2014-09-03 05:01:10 +0000
committerGreg Wilkins2014-09-03 05:01:10 +0000
commitc3647f9d9f64e396bc0c5c99f4d9b7103dff386b (patch)
tree2e42e607b4b7dc7af8bec7494fc8d655f6f10710
parente03b5114156ec482f21c7009fc976447de63f89b (diff)
downloadorg.eclipse.jetty.project-c3647f9d9f64e396bc0c5c99f4d9b7103dff386b.tar.gz
org.eclipse.jetty.project-c3647f9d9f64e396bc0c5c99f4d9b7103dff386b.tar.xz
org.eclipse.jetty.project-c3647f9d9f64e396bc0c5c99f4d9b7103dff386b.zip
443158 Fixed HttpOutput spin
-rw-r--r--jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java
index 122f293529..4454f01e43 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java
@@ -24,6 +24,7 @@ import java.nio.ByteBuffer;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.WritePendingException;
import java.util.concurrent.atomic.AtomicReference;
+
import javax.servlet.ServletOutputStream;
import javax.servlet.WriteListener;
@@ -777,14 +778,15 @@ public class HttpOutput extends ServletOutputStream implements Runnable
}
continue;
}
-
+
switch(_state.get())
{
- case READY:
case CLOSED:
// even though a write is not possible, because a close has
// occurred, we need to call onWritePossible to tell async
// producer that the last write completed.
+ // so fall through
+ case READY:
try
{
_writeListener.onWritePossible();
@@ -795,8 +797,9 @@ public class HttpOutput extends ServletOutputStream implements Runnable
_onError=e;
}
break;
+
default:
-
+ _onError=new IllegalStateException("state="+_state.get());
}
}
}
@@ -841,7 +844,7 @@ public class HttpOutput extends ServletOutputStream implements Runnable
@Override
public void onCompleteFailure(Throwable e)
{
- _onError=e;
+ _onError=e==null?new IOException():e;
_channel.getState().onWritePossible();
}
}

Back to the top