aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2013-03-15 10:48:50 (EDT)
committerThomas Becker2013-03-15 10:49:05 (EDT)
commite1a31f468e116a0a57f7b6fca4c424bc9bbbeedd (patch)
tree8b7d20ee40c6614120f270bcf178dd9848409e48
parentd0f3db0f34b080d2fc79d24f7da6e2c8f352da30 (diff)
downloadorg.eclipse.jetty.project-e1a31f468e116a0a57f7b6fca4c424bc9bbbeedd.zip
org.eclipse.jetty.project-e1a31f468e116a0a57f7b6fca4c424bc9bbbeedd.tar.gz
org.eclipse.jetty.project-e1a31f468e116a0a57f7b6fca4c424bc9bbbeedd.tar.bz2
403370 move frameBytes.fail() call in StandardSession.flush() outside the synchronized block to avoid deadlock
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java24
1 files changed, 16 insertions, 8 deletions
diff --git a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java
index 114ffc1..c642050 100644
--- a/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java
+++ b/jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java
@@ -963,6 +963,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
{
FrameBytes frameBytes = null;
ByteBuffer buffer = null;
+ boolean failFrameBytes = false;
synchronized (queue)
{
if (flushing || queue.isEmpty())
@@ -982,11 +983,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
{
queue.remove(i);
if (stream != null && stream.isReset() && !(frameBytes instanceof ControlFrameBytes))
- {
- frameBytes.fail(new StreamException(stream.getId(), StreamStatus.INVALID_STREAM,
- "Stream: " + stream + " is reset!"));
- return;
- }
+ failFrameBytes = true;
break;
}
@@ -1001,10 +998,21 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
if (buffer == null)
return;
- flushing = true;
- LOG.debug("Flushing {}, {} frame(s) in queue", frameBytes, queue.size());
+ if (!failFrameBytes)
+ {
+ flushing = true;
+ LOG.debug("Flushing {}, {} frame(s) in queue", frameBytes, queue.size());
+ }
+ }
+ if (failFrameBytes)
+ {
+ frameBytes.fail(new StreamException(frameBytes.getStream().getId(), StreamStatus.INVALID_STREAM,
+ "Stream: " + frameBytes.getStream() + " is reset!"));
+ }
+ else
+ {
+ write(buffer, frameBytes);
}
- write(buffer, frameBytes);
}
private void append(FrameBytes frameBytes)