From 90029a14ebdf258de0a5ef1ef632347fc3827726 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Thu, 23 Aug 2012 18:36:28 +0200 Subject: [PATCH] Jetty9 - Added and used shortcut method getByteBufferPool() in place of getConnector().getByteBufferPool(), also used by tests. --- .../src/main/java/org/eclipse/jetty/server/HttpChannel.java | 6 ++++++ .../src/main/java/org/eclipse/jetty/server/HttpOutput.java | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java index 65df7678898..16bf9ac3632 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpChannel.java @@ -39,6 +39,7 @@ import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.http.HttpURI; import org.eclipse.jetty.http.HttpVersion; import org.eclipse.jetty.http.MimeTypes; +import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.EofException; import org.eclipse.jetty.server.handler.ErrorHandler; @@ -126,6 +127,11 @@ public class HttpChannel implements HttpParser.RequestHandler, Runnable return _connector; } + public ByteBufferPool getByteBufferPool() + { + return _connector.getByteBufferPool(); + } + public HttpConfiguration getHttpConfiguration() { return _configuration; diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java index 66c83613216..10237157c77 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpOutput.java @@ -139,7 +139,7 @@ public class HttpOutput extends ServletOutputStream } // Allocate an aggregate buffer - _aggregate = _channel.getConnector().getByteBufferPool().acquire(size, false); + _aggregate = _channel.getByteBufferPool().acquire(size, false); } // Do we have space to aggregate ? @@ -179,7 +179,7 @@ public class HttpOutput extends ServletOutputStream throw new EOFException(); if (_aggregate == null) - _aggregate = _channel.getConnector().getByteBufferPool().acquire(getBufferSize(), false); + _aggregate = _channel.getByteBufferPool().acquire(getBufferSize(), false); BufferUtil.append(_aggregate, (byte)b); _written++;