From 50bc8fa400571eb165d6e5a8b635a5f5c17f9b13 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Thu, 29 Mar 2012 12:50:01 +0200 Subject: [PATCH] 375509 - Stalled stream stalls other streams or session control frames. Additional improvements for thread visibility, and clarified code comment. --- .../eclipse/jetty/spdy/StandardSession.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 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 f940b63b1ef..a85103ba354 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 @@ -1005,8 +1005,8 @@ public class StandardSession implements ISession, Parser.Listener, Handler handler, C context, IStream stream, DataInfo dataInfo) { @@ -1024,11 +1024,11 @@ public class StandardSession implements ISession, Parser.Listener, Handler windowSize) - length = windowSize; + size = dataInfo.available(); + if (size > windowSize) + size = windowSize; - buffer = generator.data(stream.getId(), length, dataInfo); + buffer = generator.data(stream.getId(), size, dataInfo); return buffer; } catch (Throwable x) @@ -1041,13 +1041,14 @@ public class StandardSession implements ISession, Parser.Listener, Handler 0) { - // If we could not write a full data frame, then we need first - // to finish it, and then process the others (to avoid data garbling) + // We have written a frame out of this DataInfo, but there is more to write. + // We need to keep the correct ordering of frames, to avoid that another + // DataInfo for the same stream is written before this one is finished. enqueueFirst(this); } else