summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorThomas Becker2012-05-10 06:29:58 (EDT)
committer Thomas Becker2012-05-10 06:29:58 (EDT)
commit5687aa8beb51d2f347753cd9d9351c0d819664fb (patch)
tree5b5eba94c0159add0f20a1059470ac9d8d5ebf53
parentea557759b3ed34d89c615a10c812a17bca92e6b4 (diff)
downloadorg.eclipse.jetty.project-5687aa8beb51d2f347753cd9d9351c0d819664fb.zip
org.eclipse.jetty.project-5687aa8beb51d2f347753cd9d9351c0d819664fb.tar.gz
org.eclipse.jetty.project-5687aa8beb51d2f347753cd9d9351c0d819664fb.tar.bz2
SPDY: move probably blocking/long running flush out of synchronized block in StandardSession.syn(..)refs/changes/11/5911/1
-rw-r--r--jetty-spdy/spdy-core/src/main/java/org/eclipse/jetty/spdy/StandardSession.java11
1 files changed, 8 insertions, 3 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 a652785..b77e9eb 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
@@ -154,8 +154,9 @@ public class StandardSession implements ISession, Parser.Listener, Handler<Stand
int streamId = streamIds.getAndAdd(2);
SynStreamFrame synStream = new SynStreamFrame(version, synInfo.getFlags(), streamId, associatedStreamId, synInfo.getPriority(), synInfo.getHeaders());
IStream stream = createStream(synStream, listener, true);
- control(stream, synStream, timeout, unit, handler, stream);
+ generateAndEnqueueControlFrame(stream, synStream, timeout, unit, handler, stream);
}
+ flush();
}
@Override
@@ -725,6 +726,12 @@ public class StandardSession implements ISession, Parser.Listener, Handler<Stand
@Override
public <C> void control(IStream stream, ControlFrame frame, long timeout, TimeUnit unit, Handler<C> handler, C context)
{
+ generateAndEnqueueControlFrame(stream,frame,timeout,unit,handler,context);
+ flush();
+ }
+
+ private <C> void generateAndEnqueueControlFrame(IStream stream, ControlFrame frame, long timeout, TimeUnit unit, Handler<C> handler, C context)
+ {
try
{
if (stream != null)
@@ -751,8 +758,6 @@ public class StandardSession implements ISession, Parser.Listener, Handler<Stand
else
append(frameBytes);
}
-
- flush();
}
catch (Throwable x)
{