From 58dd9c3bf164ade8c5c53e4f19d5b1c11f3e9389 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Sat, 26 May 2012 22:49:43 +0200 Subject: [PATCH] Enabled flow control configuration in SPDYClient. --- .../java/org/eclipse/jetty/spdy/SPDYClient.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYClient.java b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYClient.java index 0a9881fc013..8b98bd361d0 100644 --- a/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYClient.java +++ b/jetty-spdy/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYClient.java @@ -64,6 +64,7 @@ public class SPDYClient private final Factory factory; private SocketAddress bindAddress; private long maxIdleTime = -1; + private boolean flowControlEnabled = true; protected SPDYClient(short version, Factory factory) { @@ -118,6 +119,16 @@ public class SPDYClient this.maxIdleTime = maxIdleTime; } + public boolean isFlowControlEnabled() + { + return flowControlEnabled; + } + + public void setFlowControlEnabled(boolean flowControlEnabled) + { + this.flowControlEnabled = flowControlEnabled; + } + protected String selectProtocol(List serverProtocols) { if (serverProtocols == null) @@ -419,7 +430,8 @@ public class SPDYClient public AsyncConnection newAsyncConnection(SocketChannel channel, AsyncEndPoint endPoint, Object attachment) { SessionPromise sessionPromise = (SessionPromise)attachment; - Factory factory = sessionPromise.client.factory; + SPDYClient client = sessionPromise.client; + Factory factory = client.factory; CompressionFactory compressionFactory = new StandardCompressionFactory(); Parser parser = new Parser(compressionFactory.newDecompressor()); @@ -428,7 +440,8 @@ public class SPDYClient SPDYAsyncConnection connection = new ClientSPDYAsyncConnection(endPoint, factory.bufferPool, parser, factory); endPoint.setConnection(connection); - StandardSession session = new StandardSession(sessionPromise.client.version, factory.bufferPool, factory.threadPool, factory.scheduler, connection, connection, 1, sessionPromise.listener, generator); + StandardSession session = new StandardSession(client.version, factory.bufferPool, factory.threadPool, factory.scheduler, connection, connection, 1, sessionPromise.listener, generator); + session.setFlowControlEnabled(client.isFlowControlEnabled()); parser.addListener(session); sessionPromise.completed(session); connection.setSession(session);