aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2012-12-06 08:15:09 (EST)
committerThomas Becker2012-12-06 08:18:52 (EST)
commit98d17bdea9d2f9f037482d99978e5625bfb4221d (patch)
tree1b5c41bd44cb58d60e19d705a7958d2005dda32d
parentddb1a1b7190f1f08c5277bc9db7ae89bc0c4044c (diff)
downloadorg.eclipse.jetty.project-98d17bdea9d2f9f037482d99978e5625bfb4221d.zip
org.eclipse.jetty.project-98d17bdea9d2f9f037482d99978e5625bfb4221d.tar.gz
org.eclipse.jetty.project-98d17bdea9d2f9f037482d99978e5625bfb4221d.tar.bz2
395922: Avoid that SPDY frames containing headers are sent in another order than they have been created
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java23
1 files changed, 15 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 bab3b91..46a3267 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
@@ -910,7 +910,7 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
queue.remove(i);
if (stream != null && stream.isReset())
{
- frameBytes.fail(new StreamException(stream.getId(),StreamStatus.INVALID_STREAM,
+ frameBytes.fail(new StreamException(stream.getId(), StreamStatus.INVALID_STREAM,
"Stream: " + stream + " is reset!"));
return;
}
@@ -942,15 +942,22 @@ public class StandardSession implements ISession, Parser.Listener, Dumpable
failure = this.failure;
if (failure == null)
{
- int index = queue.size();
- while (index > 0)
+ // Frames containing headers must be send in the order the headers have been generated. We don't need
+ // to do this check in StandardSession.prepend() as no frames containing headers will be prepended.
+ if (frameBytes instanceof ControlFrameBytes)
+ queue.addLast(frameBytes);
+ else
{
- FrameBytes element = queue.get(index - 1);
- if (element.compareTo(frameBytes) >= 0)
- break;
- --index;
+ int index = queue.size();
+ while (index > 0)
+ {
+ FrameBytes element = queue.get(index - 1);
+ if (element.compareTo(frameBytes) >= 0)
+ break;
+ --index;
+ }
+ queue.add(index, frameBytes);
}
- queue.add(index, frameBytes);
}
}