Mercurial Hosting > luan
changeset 1005:0e96ce3db20a
remove HttpBuffers
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 23 Oct 2016 02:42:05 -0600 |
parents | 3fa54d9d19cd |
children | 58a9c4a42292 |
files | src/org/eclipse/jetty/http/HttpBuffers.java src/org/eclipse/jetty/http/HttpBuffersImpl.java src/org/eclipse/jetty/http/HttpParser.java src/org/eclipse/jetty/io/AbstractBuffer.java src/org/eclipse/jetty/io/View.java src/org/eclipse/jetty/io/nio/ChannelEndPoint.java src/org/eclipse/jetty/server/AbstractHttpConnection.java src/org/eclipse/jetty/server/Connector.java src/org/eclipse/jetty/server/nio/BlockingChannelConnector.java src/org/eclipse/jetty/server/ssl/SslSelectChannelConnector.java |
diffstat | 10 files changed, 859 insertions(+), 1084 deletions(-) [+] |
line wrap: on
line diff
diff -r 3fa54d9d19cd -r 0e96ce3db20a src/org/eclipse/jetty/http/HttpBuffers.java --- a/src/org/eclipse/jetty/http/HttpBuffers.java Sat Oct 22 23:00:57 2016 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -// -// ======================================================================== -// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd. -// ------------------------------------------------------------------------ -// All rights reserved. This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v1.0 -// and Apache License v2.0 which accompanies this distribution. -// -// The Eclipse Public License is available at -// http://www.eclipse.org/legal/epl-v10.html -// -// The Apache License v2.0 is available at -// http://www.opensource.org/licenses/apache2.0.php -// -// You may elect to redistribute this code under either of these licenses. -// ======================================================================== -// - -package org.eclipse.jetty.http; - -import org.eclipse.jetty.io.Buffers; - -/* ------------------------------------------------------------ */ -/** Abstract Buffer pool. - */ -public interface HttpBuffers -{ - /** - * @return the requestBufferSize - */ - public int getRequestBufferSize(); - - /** - * @param requestBufferSize the requestBufferSize to set - */ - public void setRequestBufferSize(int requestBufferSize); - - /** - * @return the requestHeaderSize - */ - public int getRequestHeaderSize(); - - /** - * @param requestHeaderSize the requestHeaderSize to set - */ - public void setRequestHeaderSize(int requestHeaderSize); - - /** - * @return the responseBufferSize - */ - public int getResponseBufferSize(); - - /** - * @param responseBufferSize the responseBufferSize to set - */ - public void setResponseBufferSize(int responseBufferSize); - - /** - * @return the responseHeaderSize - */ - public int getResponseHeaderSize(); - - /** - * @param responseHeaderSize the responseHeaderSize to set - */ - public void setResponseHeaderSize(int responseHeaderSize); - - /** - * @return the requestBufferType - */ - public Buffers.Type getRequestBufferType(); - - /** - * @return the requestHeaderType - */ - public Buffers.Type getRequestHeaderType(); - - /** - * @return the responseBufferType - */ - public Buffers.Type getResponseBufferType(); - - /** - * @return the responseHeaderType - */ - public Buffers.Type getResponseHeaderType(); - - /** - * @param requestBuffers the requestBuffers to set - */ - public void setRequestBuffers(Buffers requestBuffers); - - /** - * @param responseBuffers the responseBuffers to set - */ - public void setResponseBuffers(Buffers responseBuffers); - - public Buffers getRequestBuffers(); - - public Buffers getResponseBuffers(); - - public int getMaxBuffers(); - -}
diff -r 3fa54d9d19cd -r 0e96ce3db20a src/org/eclipse/jetty/http/HttpBuffersImpl.java --- a/src/org/eclipse/jetty/http/HttpBuffersImpl.java Sat Oct 22 23:00:57 2016 -0600 +++ b/src/org/eclipse/jetty/http/HttpBuffersImpl.java Sun Oct 23 02:42:05 2016 -0600 @@ -27,7 +27,7 @@ * simple unbounded pool of buffers for header, request and response sizes. * */ -public final class HttpBuffersImpl extends AbstractLifeCycle implements HttpBuffers +public final class HttpBuffersImpl extends AbstractLifeCycle { private int _requestBufferSize=16*1024; private int _requestHeaderSize=6*1024;
diff -r 3fa54d9d19cd -r 0e96ce3db20a src/org/eclipse/jetty/http/HttpParser.java --- a/src/org/eclipse/jetty/http/HttpParser.java Sat Oct 22 23:00:57 2016 -0600 +++ b/src/org/eclipse/jetty/http/HttpParser.java Sun Oct 23 02:42:05 2016 -0600 @@ -67,8 +67,8 @@ private Buffer _body; // Buffer for large content private Buffer _buffer; // The current buffer in use (either _header or _content) private CachedBuffer _cached; - private final View.CaseInsensitive _tok0; // Saved token: header name, request method or response version - private final View.CaseInsensitive _tok1; // Saved token: header value, request URI or response code + private final View.CaseInsensitive _tok0 = new View.CaseInsensitive(); // Saved token: header name, request method or response version + private final View.CaseInsensitive _tok1 = new View.CaseInsensitive(); // Saved token: header value, request URI or response code private String _multiLineValue; private int _responseStatus; // If >0 then we are parsing a response private boolean _persistent; @@ -88,8 +88,6 @@ _buffers = buffers; _endp = endp; _handler = handler; - _tok0 = new View.CaseInsensitive(); - _tok1 = new View.CaseInsensitive(); } public long getContentLength()
diff -r 3fa54d9d19cd -r 0e96ce3db20a src/org/eclipse/jetty/io/AbstractBuffer.java --- a/src/org/eclipse/jetty/io/AbstractBuffer.java Sat Oct 22 23:00:57 2016 -0600 +++ b/src/org/eclipse/jetty/io/AbstractBuffer.java Sun Oct 23 02:42:05 2016 -0600 @@ -33,696 +33,696 @@ */ public abstract class AbstractBuffer implements Buffer { - private static final Logger LOG = LoggerFactory.getLogger(AbstractBuffer.class); + private static final Logger LOG = LoggerFactory.getLogger(AbstractBuffer.class); - private final static boolean __boundsChecking = Boolean.getBoolean("org.eclipse.jetty.io.AbstractBuffer.boundsChecking"); - - protected final static String - __IMMUTABLE = "IMMUTABLE", - __READONLY = "READONLY", - __READWRITE = "READWRITE", - __VOLATILE = "VOLATILE"; - - protected int _access; - protected boolean _volatile; + private final static boolean __boundsChecking = Boolean.getBoolean("org.eclipse.jetty.io.AbstractBuffer.boundsChecking"); + + protected final static String + __IMMUTABLE = "IMMUTABLE", + __READONLY = "READONLY", + __READWRITE = "READWRITE", + __VOLATILE = "VOLATILE"; + + protected int _access; + protected boolean _volatile; - protected int _get; - protected int _put; - protected int _hash; - protected int _hashGet; - protected int _hashPut; - protected int _mark; - protected String _string; - protected View _view; + protected int _get; + protected int _put; + protected int _hash; + protected int _hashGet; + protected int _hashPut; + protected int _mark; + protected String _string; + protected View _view; - /** - * Constructor for BufferView - * - * @param access 0==IMMUTABLE, 1==READONLY, 2==READWRITE - */ - public AbstractBuffer(int access, boolean isVolatile) - { - if (access == IMMUTABLE && isVolatile) - throw new IllegalArgumentException("IMMUTABLE && VOLATILE"); - setMarkIndex(-1); - _access = access; - _volatile = isVolatile; - } + /** + * Constructor for BufferView + * + * @param access 0==IMMUTABLE, 1==READONLY, 2==READWRITE + */ + public AbstractBuffer(int access, boolean isVolatile) + { + if (access == IMMUTABLE && isVolatile) + throw new IllegalArgumentException("IMMUTABLE && VOLATILE"); + setMarkIndex(-1); + _access = access; + _volatile = isVolatile; + } - /* - * @see org.eclipse.io.Buffer#toArray() - */ - public byte[] asArray() - { - byte[] bytes = new byte[length()]; - byte[] array = array(); - if (array != null) - System.arraycopy(array, getIndex(), bytes, 0, bytes.length); - else - peek(getIndex(), bytes, 0, length()); - return bytes; - } + /* + * @see org.eclipse.io.Buffer#toArray() + */ + public byte[] asArray() + { + byte[] bytes = new byte[length()]; + byte[] array = array(); + if (array != null) + System.arraycopy(array, getIndex(), bytes, 0, bytes.length); + else + peek(getIndex(), bytes, 0, length()); + return bytes; + } - public ByteArrayBuffer duplicate(int access) - { - Buffer b=this.buffer(); - if (this instanceof Buffer.CaseInsensitve || b instanceof Buffer.CaseInsensitve) - return new ByteArrayBuffer.CaseInsensitive(asArray(), 0, length(),access); - else - return new ByteArrayBuffer(asArray(), 0, length(), access); - } - - /* - * @see org.eclipse.io.Buffer#asNonVolatile() - */ - public Buffer asNonVolatileBuffer() - { - if (!isVolatile()) return this; - return duplicate(_access); - } + private ByteArrayBuffer duplicate(int access) + { + Buffer b=this.buffer(); + if (this instanceof Buffer.CaseInsensitve || b instanceof Buffer.CaseInsensitve) + return new ByteArrayBuffer.CaseInsensitive(asArray(), 0, length(),access); + else + return new ByteArrayBuffer(asArray(), 0, length(), access); + } + + /* + * @see org.eclipse.io.Buffer#asNonVolatile() + */ + public Buffer asNonVolatileBuffer() + { + if (!isVolatile()) return this; + return duplicate(_access); + } - public Buffer asImmutableBuffer() - { - if (isImmutable()) return this; - return duplicate(IMMUTABLE); - } + public Buffer asImmutableBuffer() + { + if (isImmutable()) return this; + return duplicate(IMMUTABLE); + } - /* - * @see org.eclipse.util.Buffer#asReadOnlyBuffer() - */ - public Buffer asReadOnlyBuffer() - { - if (isReadOnly()) return this; - return new View(this, markIndex(), getIndex(), putIndex(), READONLY); - } + /* + * @see org.eclipse.util.Buffer#asReadOnlyBuffer() + */ + public Buffer asReadOnlyBuffer() + { + if (isReadOnly()) return this; + return new View(this, markIndex(), getIndex(), putIndex(), READONLY); + } - public Buffer asMutableBuffer() - { - if (!isImmutable()) return this; - - Buffer b=this.buffer(); - if (b.isReadOnly()) - { - return duplicate(READWRITE); - } - return new View(b, markIndex(), getIndex(), putIndex(), _access); - } + public Buffer asMutableBuffer() + { + if (!isImmutable()) return this; + + Buffer b=this.buffer(); + if (b.isReadOnly()) + { + return duplicate(READWRITE); + } + return new View(b, markIndex(), getIndex(), putIndex(), _access); + } - public Buffer buffer() - { - return this; - } + public Buffer buffer() + { + return this; + } - public void clear() - { - setMarkIndex(-1); - setGetIndex(0); - setPutIndex(0); - } + public void clear() + { + setMarkIndex(-1); + setGetIndex(0); + setPutIndex(0); + } - public void compact() - { - if (isReadOnly()) throw new IllegalStateException(__READONLY); - int s = markIndex() >= 0 ? markIndex() : getIndex(); - if (s > 0) - { - byte array[] = array(); - int length = putIndex() - s; - if (length > 0) - { - if (array != null) - System.arraycopy(array(), s, array(), 0, length); - else - poke(0, peek(s, length)); - } - if (markIndex() > 0) setMarkIndex(markIndex() - s); - setGetIndex(getIndex() - s); - setPutIndex(putIndex() - s); - } - } + public void compact() + { + if (isReadOnly()) throw new IllegalStateException(__READONLY); + int s = markIndex() >= 0 ? markIndex() : getIndex(); + if (s > 0) + { + byte array[] = array(); + int length = putIndex() - s; + if (length > 0) + { + if (array != null) + System.arraycopy(array(), s, array(), 0, length); + else + poke(0, peek(s, length)); + } + if (markIndex() > 0) setMarkIndex(markIndex() - s); + setGetIndex(getIndex() - s); + setPutIndex(putIndex() - s); + } + } - @Override - public boolean equals(Object obj) - { - if (obj==this) - return true; - - // reject non buffers; - if (obj == null || !(obj instanceof Buffer)) return false; - Buffer b = (Buffer) obj; + @Override + public boolean equals(Object obj) + { + if (obj==this) + return true; + + // reject non buffers; + if (obj == null || !(obj instanceof Buffer)) return false; + Buffer b = (Buffer) obj; - if (this instanceof Buffer.CaseInsensitve || b instanceof Buffer.CaseInsensitve) - return equalsIgnoreCase(b); - - // reject different lengths - if (b.length() != length()) return false; + if (this instanceof Buffer.CaseInsensitve || b instanceof Buffer.CaseInsensitve) + return equalsIgnoreCase(b); + + // reject different lengths + if (b.length() != length()) return false; - // reject AbstractBuffer with different hash value - if (_hash != 0 && obj instanceof AbstractBuffer) - { - AbstractBuffer ab = (AbstractBuffer) obj; - if (ab._hash != 0 && _hash != ab._hash) return false; - } + // reject AbstractBuffer with different hash value + if (_hash != 0 && obj instanceof AbstractBuffer) + { + AbstractBuffer ab = (AbstractBuffer) obj; + if (ab._hash != 0 && _hash != ab._hash) return false; + } - // Nothing for it but to do the hard grind. - int get=getIndex(); - int bi=b.putIndex(); - for (int i = putIndex(); i-->get;) - { - byte b1 = peek(i); - byte b2 = b.peek(--bi); - if (b1 != b2) return false; - } - return true; - } + // Nothing for it but to do the hard grind. + int get=getIndex(); + int bi=b.putIndex(); + for (int i = putIndex(); i-->get;) + { + byte b1 = peek(i); + byte b2 = b.peek(--bi); + if (b1 != b2) return false; + } + return true; + } - public boolean equalsIgnoreCase(Buffer b) - { - if (b==this) - return true; - - // reject different lengths - if (b.length() != length()) return false; + public boolean equalsIgnoreCase(Buffer b) + { + if (b==this) + return true; + + // reject different lengths + if (b.length() != length()) return false; - // reject AbstractBuffer with different hash value - if (_hash != 0 && b instanceof AbstractBuffer) - { - AbstractBuffer ab = (AbstractBuffer) b; - if (ab._hash != 0 && _hash != ab._hash) return false; - } + // reject AbstractBuffer with different hash value + if (_hash != 0 && b instanceof AbstractBuffer) + { + AbstractBuffer ab = (AbstractBuffer) b; + if (ab._hash != 0 && _hash != ab._hash) return false; + } - // Nothing for it but to do the hard grind. - int get=getIndex(); - int bi=b.putIndex(); - - byte[] array = array(); - byte[] barray= b.array(); - if (array!=null && barray!=null) - { - for (int i = putIndex(); i-->get;) - { - byte b1 = array[i]; - byte b2 = barray[--bi]; - if (b1 != b2) - { - if ('a' <= b1 && b1 <= 'z') b1 = (byte) (b1 - 'a' + 'A'); - if ('a' <= b2 && b2 <= 'z') b2 = (byte) (b2 - 'a' + 'A'); - if (b1 != b2) return false; - } - } - } - else - { - for (int i = putIndex(); i-->get;) - { - byte b1 = peek(i); - byte b2 = b.peek(--bi); - if (b1 != b2) - { - if ('a' <= b1 && b1 <= 'z') b1 = (byte) (b1 - 'a' + 'A'); - if ('a' <= b2 && b2 <= 'z') b2 = (byte) (b2 - 'a' + 'A'); - if (b1 != b2) return false; - } - } - } - return true; - } + // Nothing for it but to do the hard grind. + int get=getIndex(); + int bi=b.putIndex(); + + byte[] array = array(); + byte[] barray= b.array(); + if (array!=null && barray!=null) + { + for (int i = putIndex(); i-->get;) + { + byte b1 = array[i]; + byte b2 = barray[--bi]; + if (b1 != b2) + { + if ('a' <= b1 && b1 <= 'z') b1 = (byte) (b1 - 'a' + 'A'); + if ('a' <= b2 && b2 <= 'z') b2 = (byte) (b2 - 'a' + 'A'); + if (b1 != b2) return false; + } + } + } + else + { + for (int i = putIndex(); i-->get;) + { + byte b1 = peek(i); + byte b2 = b.peek(--bi); + if (b1 != b2) + { + if ('a' <= b1 && b1 <= 'z') b1 = (byte) (b1 - 'a' + 'A'); + if ('a' <= b2 && b2 <= 'z') b2 = (byte) (b2 - 'a' + 'A'); + if (b1 != b2) return false; + } + } + } + return true; + } - public byte get() - { - return peek(_get++); - } + public byte get() + { + return peek(_get++); + } - public int get(byte[] b, int offset, int length) - { - int gi = getIndex(); - int l=length(); - if (l==0) - return -1; - - if (length>l) - length=l; - - length = peek(gi, b, offset, length); - if (length>0) - setGetIndex(gi + length); - return length; - } + public int get(byte[] b, int offset, int length) + { + int gi = getIndex(); + int l=length(); + if (l==0) + return -1; + + if (length>l) + length=l; + + length = peek(gi, b, offset, length); + if (length>0) + setGetIndex(gi + length); + return length; + } - public Buffer get(int length) - { - int gi = getIndex(); - Buffer view = peek(gi, length); - setGetIndex(gi + length); - return view; - } + public Buffer get(int length) + { + int gi = getIndex(); + Buffer view = peek(gi, length); + setGetIndex(gi + length); + return view; + } - public final int getIndex() - { - return _get; - } + public final int getIndex() + { + return _get; + } - public boolean hasContent() - { - return _put > _get; - } - - @Override - public int hashCode() - { - if (_hash == 0 || _hashGet!=_get || _hashPut!=_put) - { - int get=getIndex(); - byte[] array = array(); - if (array==null) - { - for (int i = putIndex(); i-- >get;) - { - byte b = peek(i); - if ('a' <= b && b <= 'z') - b = (byte) (b - 'a' + 'A'); - _hash = 31 * _hash + b; - } - } - else - { - for (int i = putIndex(); i-- >get;) - { - byte b = array[i]; - if ('a' <= b && b <= 'z') - b = (byte) (b - 'a' + 'A'); - _hash = 31 * _hash + b; - } - } - if (_hash == 0) - _hash = -1; - _hashGet=_get; - _hashPut=_put; - - } - return _hash; - } + public boolean hasContent() + { + return _put > _get; + } + + @Override + public int hashCode() + { + if (_hash == 0 || _hashGet!=_get || _hashPut!=_put) + { + int get=getIndex(); + byte[] array = array(); + if (array==null) + { + for (int i = putIndex(); i-- >get;) + { + byte b = peek(i); + if ('a' <= b && b <= 'z') + b = (byte) (b - 'a' + 'A'); + _hash = 31 * _hash + b; + } + } + else + { + for (int i = putIndex(); i-- >get;) + { + byte b = array[i]; + if ('a' <= b && b <= 'z') + b = (byte) (b - 'a' + 'A'); + _hash = 31 * _hash + b; + } + } + if (_hash == 0) + _hash = -1; + _hashGet=_get; + _hashPut=_put; + + } + return _hash; + } - public boolean isImmutable() - { - return _access <= IMMUTABLE; - } + public boolean isImmutable() + { + return _access <= IMMUTABLE; + } - public boolean isReadOnly() - { - return _access <= READONLY; - } + public boolean isReadOnly() + { + return _access <= READONLY; + } - public boolean isVolatile() - { - return _volatile; - } + public boolean isVolatile() + { + return _volatile; + } - public int length() - { - return _put - _get; - } + public int length() + { + return _put - _get; + } - public void mark() - { - setMarkIndex(_get - 1); - } + public void mark() + { + setMarkIndex(_get - 1); + } - public void mark(int offset) - { - setMarkIndex(_get + offset); - } + public void mark(int offset) + { + setMarkIndex(_get + offset); + } - public int markIndex() - { - return _mark; - } + public int markIndex() + { + return _mark; + } - public byte peek() - { - return peek(_get); - } + public byte peek() + { + return peek(_get); + } - public Buffer peek(int index, int length) - { - if (_view == null) - { - _view = new View(this, -1, index, index + length, isReadOnly() ? READONLY : READWRITE); - } - else - { - _view.update(this.buffer()); - _view.setMarkIndex(-1); - _view.setGetIndex(0); - _view.setPutIndex(index + length); - _view.setGetIndex(index); - - } - return _view; - } + public Buffer peek(int index, int length) + { + if (_view == null) + { + _view = new View(this, -1, index, index + length, isReadOnly() ? READONLY : READWRITE); + } + else + { + _view.update(this.buffer()); + _view.setMarkIndex(-1); + _view.setGetIndex(0); + _view.setPutIndex(index + length); + _view.setGetIndex(index); + + } + return _view; + } - public int poke(int index, Buffer src) - { - _hash=0; - /* - if (isReadOnly()) - throw new IllegalStateException(__READONLY); - if (index < 0) - throw new IllegalArgumentException("index<0: " + index + "<0"); - */ - - int length=src.length(); - if (index + length > capacity()) - { - length=capacity()-index; - /* - if (length<0) - throw new IllegalArgumentException("index>capacity(): " + index + ">" + capacity()); - */ - } - - byte[] src_array = src.array(); - byte[] dst_array = array(); - if (src_array != null && dst_array != null) - System.arraycopy(src_array, src.getIndex(), dst_array, index, length); - else if (src_array != null) - { - int s=src.getIndex(); - for (int i=0;i<length;i++) - poke(index++,src_array[s++]); - } - else if (dst_array != null) - { - int s=src.getIndex(); - for (int i=0;i<length;i++) - dst_array[index++]=src.peek(s++); - } - else - { - int s=src.getIndex(); - for (int i=0;i<length;i++) - poke(index++,src.peek(s++)); - } - - return length; - } - + public int poke(int index, Buffer src) + { + _hash=0; + /* + if (isReadOnly()) + throw new IllegalStateException(__READONLY); + if (index < 0) + throw new IllegalArgumentException("index<0: " + index + "<0"); + */ + + int length=src.length(); + if (index + length > capacity()) + { + length=capacity()-index; + /* + if (length<0) + throw new IllegalArgumentException("index>capacity(): " + index + ">" + capacity()); + */ + } + + byte[] src_array = src.array(); + byte[] dst_array = array(); + if (src_array != null && dst_array != null) + System.arraycopy(src_array, src.getIndex(), dst_array, index, length); + else if (src_array != null) + { + int s=src.getIndex(); + for (int i=0;i<length;i++) + poke(index++,src_array[s++]); + } + else if (dst_array != null) + { + int s=src.getIndex(); + for (int i=0;i<length;i++) + dst_array[index++]=src.peek(s++); + } + else + { + int s=src.getIndex(); + for (int i=0;i<length;i++) + poke(index++,src.peek(s++)); + } + + return length; + } + - public int poke(int index, byte[] b, int offset, int length) - { - _hash=0; - /* - if (isReadOnly()) - throw new IllegalStateException(__READONLY); - if (index < 0) - throw new IllegalArgumentException("index<0: " + index + "<0"); - */ - if (index + length > capacity()) - { - length=capacity()-index; - /* if (length<0) - throw new IllegalArgumentException("index>capacity(): " + index + ">" + capacity()); - */ - } - - byte[] dst_array = array(); - if (dst_array != null) - System.arraycopy(b, offset, dst_array, index, length); - else - { - int s=offset; - for (int i=0;i<length;i++) - poke(index++,b[s++]); - } - return length; - } + public int poke(int index, byte[] b, int offset, int length) + { + _hash=0; + /* + if (isReadOnly()) + throw new IllegalStateException(__READONLY); + if (index < 0) + throw new IllegalArgumentException("index<0: " + index + "<0"); + */ + if (index + length > capacity()) + { + length=capacity()-index; + /* if (length<0) + throw new IllegalArgumentException("index>capacity(): " + index + ">" + capacity()); + */ + } + + byte[] dst_array = array(); + if (dst_array != null) + System.arraycopy(b, offset, dst_array, index, length); + else + { + int s=offset; + for (int i=0;i<length;i++) + poke(index++,b[s++]); + } + return length; + } - public int put(Buffer src) - { - int pi = putIndex(); - int l=poke(pi, src); - setPutIndex(pi + l); - return l; - } + public int put(Buffer src) + { + int pi = putIndex(); + int l=poke(pi, src); + setPutIndex(pi + l); + return l; + } - public void put(byte b) - { - int pi = putIndex(); - poke(pi, b); - setPutIndex(pi + 1); - } + public void put(byte b) + { + int pi = putIndex(); + poke(pi, b); + setPutIndex(pi + 1); + } - public int put(byte[] b, int offset, int length) - { - int pi = putIndex(); - int l = poke(pi, b, offset, length); - setPutIndex(pi + l); - return l; - } - - public int put(byte[] b) - { - int pi = putIndex(); - int l = poke(pi, b, 0, b.length); - setPutIndex(pi + l); - return l; - } + public int put(byte[] b, int offset, int length) + { + int pi = putIndex(); + int l = poke(pi, b, offset, length); + setPutIndex(pi + l); + return l; + } + + public int put(byte[] b) + { + int pi = putIndex(); + int l = poke(pi, b, 0, b.length); + setPutIndex(pi + l); + return l; + } - public final int putIndex() - { - return _put; - } + public final int putIndex() + { + return _put; + } - public void reset() - { - if (markIndex() >= 0) setGetIndex(markIndex()); - } + public void reset() + { + if (markIndex() >= 0) setGetIndex(markIndex()); + } - public void rewind() - { - setGetIndex(0); - setMarkIndex(-1); - } + public void rewind() + { + setGetIndex(0); + setMarkIndex(-1); + } - public void setGetIndex(int getIndex) - { - /* bounds checking - if (isImmutable()) - throw new IllegalStateException(__IMMUTABLE); - if (getIndex < 0) - throw new IllegalArgumentException("getIndex<0: " + getIndex + "<0"); - if (getIndex > putIndex()) - throw new IllegalArgumentException("getIndex>putIndex: " + getIndex + ">" + putIndex()); - */ - _get = getIndex; - _hash=0; - } + public void setGetIndex(int getIndex) + { + /* bounds checking + if (isImmutable()) + throw new IllegalStateException(__IMMUTABLE); + if (getIndex < 0) + throw new IllegalArgumentException("getIndex<0: " + getIndex + "<0"); + if (getIndex > putIndex()) + throw new IllegalArgumentException("getIndex>putIndex: " + getIndex + ">" + putIndex()); + */ + _get = getIndex; + _hash=0; + } - public void setMarkIndex(int index) - { - /* - if (index>=0 && isImmutable()) - throw new IllegalStateException(__IMMUTABLE); - */ - _mark = index; - } + public void setMarkIndex(int index) + { + /* + if (index>=0 && isImmutable()) + throw new IllegalStateException(__IMMUTABLE); + */ + _mark = index; + } - public void setPutIndex(int putIndex) - { - /* bounds checking - if (isImmutable()) - throw new IllegalStateException(__IMMUTABLE); - if (putIndex > capacity()) - throw new IllegalArgumentException("putIndex>capacity: " + putIndex + ">" + capacity()); - if (getIndex() > putIndex) - throw new IllegalArgumentException("getIndex>putIndex: " + getIndex() + ">" + putIndex); - */ - _put = putIndex; - _hash=0; - } + public void setPutIndex(int putIndex) + { + /* bounds checking + if (isImmutable()) + throw new IllegalStateException(__IMMUTABLE); + if (putIndex > capacity()) + throw new IllegalArgumentException("putIndex>capacity: " + putIndex + ">" + capacity()); + if (getIndex() > putIndex) + throw new IllegalArgumentException("getIndex>putIndex: " + getIndex() + ">" + putIndex); + */ + _put = putIndex; + _hash=0; + } - public int skip(int n) - { - if (length() < n) n = length(); - setGetIndex(getIndex() + n); - return n; - } + public int skip(int n) + { + if (length() < n) n = length(); + setGetIndex(getIndex() + n); + return n; + } - public Buffer slice() - { - return peek(getIndex(), length()); - } + public Buffer slice() + { + return peek(getIndex(), length()); + } - public Buffer sliceFromMark() - { - return sliceFromMark(getIndex() - markIndex() - 1); - } + public Buffer sliceFromMark() + { + return sliceFromMark(getIndex() - markIndex() - 1); + } - public Buffer sliceFromMark(int length) - { - if (markIndex() < 0) return null; - Buffer view = peek(markIndex(), length); - setMarkIndex(-1); - return view; - } + public Buffer sliceFromMark(int length) + { + if (markIndex() < 0) return null; + Buffer view = peek(markIndex(), length); + setMarkIndex(-1); + return view; + } - public int space() - { - return capacity() - _put; - } + public int space() + { + return capacity() - _put; + } - public String toDetailString() - { - StringBuilder buf = new StringBuilder(); - buf.append("["); - buf.append(super.hashCode()); - buf.append(","); - buf.append(this.buffer().hashCode()); - buf.append(",m="); - buf.append(markIndex()); - buf.append(",g="); - buf.append(getIndex()); - buf.append(",p="); - buf.append(putIndex()); - buf.append(",c="); - buf.append(capacity()); - buf.append("]={"); - if (markIndex() >= 0) - { - for (int i = markIndex(); i < getIndex(); i++) - { - byte b = peek(i); - TypeUtil.toHex(b,buf); - } - buf.append("}{"); - } - int count = 0; - for (int i = getIndex(); i < putIndex(); i++) - { - byte b = peek(i); - TypeUtil.toHex(b,buf); - if (count++ == 50) - { - if (putIndex() - i > 20) - { - buf.append(" ... "); - i = putIndex() - 20; - } - } - } - buf.append('}'); - return buf.toString(); - } + public String toDetailString() + { + StringBuilder buf = new StringBuilder(); + buf.append("["); + buf.append(super.hashCode()); + buf.append(","); + buf.append(this.buffer().hashCode()); + buf.append(",m="); + buf.append(markIndex()); + buf.append(",g="); + buf.append(getIndex()); + buf.append(",p="); + buf.append(putIndex()); + buf.append(",c="); + buf.append(capacity()); + buf.append("]={"); + if (markIndex() >= 0) + { + for (int i = markIndex(); i < getIndex(); i++) + { + byte b = peek(i); + TypeUtil.toHex(b,buf); + } + buf.append("}{"); + } + int count = 0; + for (int i = getIndex(); i < putIndex(); i++) + { + byte b = peek(i); + TypeUtil.toHex(b,buf); + if (count++ == 50) + { + if (putIndex() - i > 20) + { + buf.append(" ... "); + i = putIndex() - 20; + } + } + } + buf.append('}'); + return buf.toString(); + } - /* ------------------------------------------------------------ */ - @Override - public String toString() - { - if (isImmutable()) - { - if (_string == null) - _string = new String(asArray(), 0, length()); - return _string; - } - return new String(asArray(), 0, length()); - } + /* ------------------------------------------------------------ */ + @Override + public String toString() + { + if (isImmutable()) + { + if (_string == null) + _string = new String(asArray(), 0, length()); + return _string; + } + return new String(asArray(), 0, length()); + } - /* ------------------------------------------------------------ */ - public String toString(String charset) - { - try - { - byte[] bytes=array(); - if (bytes!=null) - return new String(bytes,getIndex(),length(),charset); - return new String(asArray(), 0, length(),charset); - - } - catch(Exception e) - { - LOG.warn("",e); - return new String(asArray(), 0, length()); - } - } + /* ------------------------------------------------------------ */ + public String toString(String charset) + { + try + { + byte[] bytes=array(); + if (bytes!=null) + return new String(bytes,getIndex(),length(),charset); + return new String(asArray(), 0, length(),charset); + + } + catch(Exception e) + { + LOG.warn("",e); + return new String(asArray(), 0, length()); + } + } - /* ------------------------------------------------------------ */ - public String toString(Charset charset) - { - try - { - byte[] bytes=array(); - if (bytes!=null) - return new String(bytes,getIndex(),length(),charset); - return new String(asArray(), 0, length(),charset); - } - catch(Exception e) - { - LOG.warn("",e); - return new String(asArray(), 0, length()); - } - } + /* ------------------------------------------------------------ */ + public String toString(Charset charset) + { + try + { + byte[] bytes=array(); + if (bytes!=null) + return new String(bytes,getIndex(),length(),charset); + return new String(asArray(), 0, length(),charset); + } + catch(Exception e) + { + LOG.warn("",e); + return new String(asArray(), 0, length()); + } + } - /* ------------------------------------------------------------ */ - public String toDebugString() - { - return getClass()+"@"+super.hashCode(); - } + /* ------------------------------------------------------------ */ + public String toDebugString() + { + return getClass()+"@"+super.hashCode(); + } - /* ------------------------------------------------------------ */ - public void writeTo(OutputStream out) - throws IOException - { - byte[] array = array(); - - if (array!=null) - { - out.write(array,getIndex(),length()); - } - else - { - int len = this.length(); - byte[] buf=new byte[len>1024?1024:len]; - int offset=_get; - while (len>0) - { - int l=peek(offset,buf,0,len>buf.length?buf.length:len); - out.write(buf,0,l); - offset+=l; - len-=l; - } - } - clear(); - } - - /* ------------------------------------------------------------ */ - public int readFrom(InputStream in,int max) throws IOException - { - byte[] array = array(); - int s=space(); - if (s>max) - s=max; + /* ------------------------------------------------------------ */ + public void writeTo(OutputStream out) + throws IOException + { + byte[] array = array(); + + if (array!=null) + { + out.write(array,getIndex(),length()); + } + else + { + int len = this.length(); + byte[] buf=new byte[len>1024?1024:len]; + int offset=_get; + while (len>0) + { + int l=peek(offset,buf,0,len>buf.length?buf.length:len); + out.write(buf,0,l); + offset+=l; + len-=l; + } + } + clear(); + } + + /* ------------------------------------------------------------ */ + public int readFrom(InputStream in,int max) throws IOException + { + byte[] array = array(); + int s=space(); + if (s>max) + s=max; - if (array!=null) - { - int l=in.read(array,_put,s); - if (l>0) - _put+=l; - return l; - } - else - { - byte[] buf=new byte[s>1024?1024:s]; - int total=0; - while (s>0) - { - int l=in.read(buf,0,buf.length); - if (l<0) - return total>0?total:-1; - int p=put(buf,0,l); - assert l==p; - s-=l; - } - return total; - } - } + if (array!=null) + { + int l=in.read(array,_put,s); + if (l>0) + _put+=l; + return l; + } + else + { + byte[] buf=new byte[s>1024?1024:s]; + int total=0; + while (s>0) + { + int l=in.read(buf,0,buf.length); + if (l<0) + return total>0?total:-1; + int p=put(buf,0,l); + assert l==p; + s-=l; + } + return total; + } + } }
diff -r 3fa54d9d19cd -r 0e96ce3db20a src/org/eclipse/jetty/io/View.java --- a/src/org/eclipse/jetty/io/View.java Sat Oct 22 23:00:57 2016 -0600 +++ b/src/org/eclipse/jetty/io/View.java Sun Oct 23 02:42:05 2016 -0600 @@ -27,225 +27,225 @@ */ public class View extends AbstractBuffer { - Buffer _buffer; + Buffer _buffer; - /** - * @param buffer The <code>Buffer</code> on which we are presenting a <code>View</code>. - * @param mark The initial value of the {@link Buffer#markIndex mark index} - * @param get The initial value of the {@link Buffer#getIndex get index} - * @param put The initial value of the {@link Buffer#putIndex put index} - * @param access The access level - one of the constants from {@link Buffer}. - */ - public View(Buffer buffer, int mark, int get, int put,int access) - { - super(READWRITE,!buffer.isImmutable()); - _buffer=buffer.buffer(); - setPutIndex(put); - setGetIndex(get); - setMarkIndex(mark); - _access=access; - } - - public View(Buffer buffer) - { - super(READWRITE,!buffer.isImmutable()); - _buffer=buffer.buffer(); - setPutIndex(buffer.putIndex()); - setGetIndex(buffer.getIndex()); - setMarkIndex(buffer.markIndex()); - _access=buffer.isReadOnly()?READONLY:READWRITE; - } + /** + * @param buffer The <code>Buffer</code> on which we are presenting a <code>View</code>. + * @param mark The initial value of the {@link Buffer#markIndex mark index} + * @param get The initial value of the {@link Buffer#getIndex get index} + * @param put The initial value of the {@link Buffer#putIndex put index} + * @param access The access level - one of the constants from {@link Buffer}. + */ + public View(Buffer buffer, int mark, int get, int put,int access) + { + super(READWRITE,!buffer.isImmutable()); + _buffer=buffer.buffer(); + setPutIndex(put); + setGetIndex(get); + setMarkIndex(mark); + _access=access; + } + + public View(Buffer buffer) + { + super(READWRITE,!buffer.isImmutable()); + _buffer=buffer.buffer(); + setPutIndex(buffer.putIndex()); + setGetIndex(buffer.getIndex()); + setMarkIndex(buffer.markIndex()); + _access=buffer.isReadOnly()?READONLY:READWRITE; + } - public View() - { - super(READWRITE,true); - } - - /** - * Update view to buffer - */ - public void update(Buffer buffer) - { - _access=READWRITE; - _buffer=buffer.buffer(); - setGetIndex(0); - setPutIndex(buffer.putIndex()); - setGetIndex(buffer.getIndex()); - setMarkIndex(buffer.markIndex()); - _access=buffer.isReadOnly()?READONLY:READWRITE; - } + public View() + { + super(READWRITE,true); + } + + /** + * Update view to buffer + */ + public void update(Buffer buffer) + { + _access=READWRITE; + _buffer=buffer.buffer(); + setGetIndex(0); + setPutIndex(buffer.putIndex()); + setGetIndex(buffer.getIndex()); + setMarkIndex(buffer.markIndex()); + _access=buffer.isReadOnly()?READONLY:READWRITE; + } - public void update(int get, int put) - { - int a=_access; - _access=READWRITE; - setGetIndex(0); - setPutIndex(put); - setGetIndex(get); - setMarkIndex(-1); - _access=a; - } + public void update(int get, int put) + { + int a=_access; + _access=READWRITE; + setGetIndex(0); + setPutIndex(put); + setGetIndex(get); + setMarkIndex(-1); + _access=a; + } - /** - * @return The {@link Buffer#array()} from the underlying buffer. - */ - public byte[] array() - { - return _buffer.array(); - } + /** + * @return The {@link Buffer#array()} from the underlying buffer. + */ + public byte[] array() + { + return _buffer.array(); + } - /** - * @return The {@link Buffer#buffer()} from the underlying buffer. - */ - @Override - public Buffer buffer() - { - return _buffer.buffer(); - } + /** + * @return The {@link Buffer#buffer()} from the underlying buffer. + */ + @Override + public Buffer buffer() + { + return _buffer.buffer(); + } - /** - * @return The {@link Buffer#capacity} of the underlying buffer. - */ - public int capacity() - { - return _buffer.capacity(); - } + /** + * @return The {@link Buffer#capacity} of the underlying buffer. + */ + public int capacity() + { + return _buffer.capacity(); + } - /** - * - */ - @Override - public void clear() - { - setMarkIndex(-1); - setGetIndex(0); - setPutIndex(_buffer.getIndex()); - setGetIndex(_buffer.getIndex()); - } + /** + * + */ + @Override + public void clear() + { + setMarkIndex(-1); + setGetIndex(0); + setPutIndex(_buffer.getIndex()); + setGetIndex(_buffer.getIndex()); + } - /** - * - */ - @Override - public void compact() - { - // TODO - } + /** + * + */ + @Override + public void compact() + { + // TODO + } - /* - * (non-Javadoc) - * - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) - { - return this==obj ||((obj instanceof Buffer)&& obj.equals(this)) || super.equals(obj); - } + /* + * (non-Javadoc) + * + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) + { + return this==obj ||((obj instanceof Buffer)&& obj.equals(this)) || super.equals(obj); + } - /** - * @return Whether the underlying buffer is {@link Buffer#isReadOnly read only} - */ - @Override - public boolean isReadOnly() - { - return _buffer.isReadOnly(); - } + /** + * @return Whether the underlying buffer is {@link Buffer#isReadOnly read only} + */ + @Override + public boolean isReadOnly() + { + return _buffer.isReadOnly(); + } - /** - * @return Whether the underlying buffer is {@link Buffer#isVolatile volatile} - */ - @Override - public boolean isVolatile() - { - return true; - } + /** + * @return Whether the underlying buffer is {@link Buffer#isVolatile volatile} + */ + @Override + public boolean isVolatile() + { + return true; + } - /** - * @return The result of calling {@link Buffer#peek(int)} on the underlying buffer - */ - public byte peek(int index) - { - return _buffer.peek(index); - } + /** + * @return The result of calling {@link Buffer#peek(int)} on the underlying buffer + */ + public byte peek(int index) + { + return _buffer.peek(index); + } - /** - * @return The result of calling {@link Buffer#peek(int, byte[], int, int)} on the underlying buffer - */ - public int peek(int index, byte[] b, int offset, int length) - { - return _buffer.peek(index,b,offset,length); - } + /** + * @return The result of calling {@link Buffer#peek(int, byte[], int, int)} on the underlying buffer + */ + public int peek(int index, byte[] b, int offset, int length) + { + return _buffer.peek(index,b,offset,length); + } - /** - * @return The result of calling {@link Buffer#peek(int, int)} on the underlying buffer - */ - @Override - public Buffer peek(int index, int length) - { - return _buffer.peek(index, length); - } - - /** - * @param index - * @param src - */ - @Override - public int poke(int index, Buffer src) - { - return _buffer.poke(index,src); - } + /** + * @return The result of calling {@link Buffer#peek(int, int)} on the underlying buffer + */ + @Override + public Buffer peek(int index, int length) + { + return _buffer.peek(index, length); + } + + /** + * @param index + * @param src + */ + @Override + public int poke(int index, Buffer src) + { + return _buffer.poke(index,src); + } - /** - * @param index - * @param b - */ - public void poke(int index, byte b) - { - _buffer.poke(index,b); - } + /** + * @param index + * @param b + */ + public void poke(int index, byte b) + { + _buffer.poke(index,b); + } - /** - * @param index - * @param b - * @param offset - * @param length - */ - @Override - public int poke(int index, byte[] b, int offset, int length) - { - return _buffer.poke(index,b,offset,length); - } - - @Override - public String toString() - { - if (_buffer==null) - return "INVALID"; - return super.toString(); - } - - public static class CaseInsensitive extends View implements Buffer.CaseInsensitve - { - public CaseInsensitive() - { - super(); - } + /** + * @param index + * @param b + * @param offset + * @param length + */ + @Override + public int poke(int index, byte[] b, int offset, int length) + { + return _buffer.poke(index,b,offset,length); + } + + @Override + public String toString() + { + if (_buffer==null) + return "INVALID"; + return super.toString(); + } + + public static class CaseInsensitive extends View implements Buffer.CaseInsensitve + { + public CaseInsensitive() + { + super(); + } - public CaseInsensitive(Buffer buffer, int mark, int get, int put, int access) - { - super(buffer,mark,get,put,access); - } + public CaseInsensitive(Buffer buffer, int mark, int get, int put, int access) + { + super(buffer,mark,get,put,access); + } - public CaseInsensitive(Buffer buffer) - { - super(buffer); - } - - @Override - public boolean equals(Object obj) - { - return this==obj ||((obj instanceof Buffer)&&((Buffer)obj).equalsIgnoreCase(this)) || super.equals(obj); - } - } + public CaseInsensitive(Buffer buffer) + { + super(buffer); + } + + @Override + public boolean equals(Object obj) + { + return this==obj ||((obj instanceof Buffer)&&((Buffer)obj).equalsIgnoreCase(this)) || super.equals(obj); + } + } }
diff -r 3fa54d9d19cd -r 0e96ce3db20a src/org/eclipse/jetty/io/nio/ChannelEndPoint.java --- a/src/org/eclipse/jetty/io/nio/ChannelEndPoint.java Sat Oct 22 23:00:57 2016 -0600 +++ b/src/org/eclipse/jetty/io/nio/ChannelEndPoint.java Sun Oct 23 02:42:05 2016 -0600 @@ -158,6 +158,7 @@ @Override public void close() throws IOException { +//Thread.dumpStack(); LOG.debug("close {}",this); _channel.close(); } @@ -168,11 +169,11 @@ if (_ishut) return -1; Buffer buf = buffer.buffer(); - int len=0; + int len = 0; if (buf instanceof NIOBuffer) { final NIOBuffer nbuf = (NIOBuffer)buf; - final ByteBuffer bbuf=nbuf.getByteBuffer(); + final ByteBuffer bbuf = nbuf.getByteBuffer(); //noinspection SynchronizationOnLocalVariableOrMethodParameter try
diff -r 3fa54d9d19cd -r 0e96ce3db20a src/org/eclipse/jetty/server/AbstractHttpConnection.java --- a/src/org/eclipse/jetty/server/AbstractHttpConnection.java Sat Oct 22 23:00:57 2016 -0600 +++ b/src/org/eclipse/jetty/server/AbstractHttpConnection.java Sun Oct 23 02:42:05 2016 -0600 @@ -29,7 +29,7 @@ import javax.servlet.http.HttpServletResponse; import org.eclipse.jetty.http.EncodedHttpURI; -import org.eclipse.jetty.http.HttpBuffers; +import org.eclipse.jetty.http.HttpBuffersImpl; import org.eclipse.jetty.http.HttpException; import org.eclipse.jetty.http.HttpFields; import org.eclipse.jetty.http.HttpGenerator; @@ -122,7 +122,7 @@ { super(endpoint); _connector = connector; - HttpBuffers ab = _connector; + HttpBuffersImpl ab = _connector._buffers; _parser = new HttpParser(ab.getRequestBuffers(), endpoint, new RequestHandler()); _request = new Request(this); _response = new Response(this);
diff -r 3fa54d9d19cd -r 0e96ce3db20a src/org/eclipse/jetty/server/Connector.java --- a/src/org/eclipse/jetty/server/Connector.java Sat Oct 22 23:00:57 2016 -0600 +++ b/src/org/eclipse/jetty/server/Connector.java Sun Oct 23 02:42:05 2016 -0600 @@ -28,7 +28,6 @@ import javax.servlet.ServletRequest; -import org.eclipse.jetty.http.HttpBuffers; import org.eclipse.jetty.http.HttpBuffersImpl; import org.eclipse.jetty.http.HttpFields; import org.eclipse.jetty.http.HttpHeaders; @@ -53,7 +52,7 @@ * <li>Optional reverse proxy headers checking</li> * </ul> */ -public abstract class Connector extends AggregateLifeCycle implements HttpBuffers, Dumpable, Runnable +public abstract class Connector extends AggregateLifeCycle implements Dumpable, Runnable { private static final Logger LOG = LoggerFactory.getLogger(Connector.class); @@ -184,108 +183,6 @@ protected abstract void accept() throws IOException, InterruptedException; @Override - public final int getRequestBufferSize() - { - return _buffers.getRequestBufferSize(); - } - - @Override - public final void setRequestBufferSize(int requestBufferSize) - { - _buffers.setRequestBufferSize(requestBufferSize); - } - - @Override - public final int getRequestHeaderSize() - { - return _buffers.getRequestHeaderSize(); - } - - @Override - public final void setRequestHeaderSize(int requestHeaderSize) - { - _buffers.setRequestHeaderSize(requestHeaderSize); - } - - @Override - public final int getResponseBufferSize() - { - return _buffers.getResponseBufferSize(); - } - - @Override - public final void setResponseBufferSize(int responseBufferSize) - { - _buffers.setResponseBufferSize(responseBufferSize); - } - - @Override - public final int getResponseHeaderSize() - { - return _buffers.getResponseHeaderSize(); - } - - @Override - public final void setResponseHeaderSize(int responseHeaderSize) - { - _buffers.setResponseHeaderSize(responseHeaderSize); - } - - @Override - public final Type getRequestBufferType() - { - return _buffers.getRequestBufferType(); - } - - @Override - public final Type getRequestHeaderType() - { - return _buffers.getRequestHeaderType(); - } - - @Override - public final Type getResponseBufferType() - { - return _buffers.getResponseBufferType(); - } - - @Override - public final Type getResponseHeaderType() - { - return _buffers.getResponseHeaderType(); - } - - @Override - public final void setRequestBuffers(Buffers requestBuffers) - { - _buffers.setRequestBuffers(requestBuffers); - } - - @Override - public final void setResponseBuffers(Buffers responseBuffers) - { - _buffers.setResponseBuffers(responseBuffers); - } - - @Override - public final Buffers getRequestBuffers() - { - return _buffers.getRequestBuffers(); - } - - @Override - public final Buffers getResponseBuffers() - { - return _buffers.getResponseBuffers(); - } - - @Override - public final int getMaxBuffers() - { - return _buffers.getMaxBuffers(); - } - - @Override public String toString() { return String.format("%s@%s:%d", @@ -347,7 +244,7 @@ public final boolean getUseDirectBuffers() { - return getRequestBufferType()==Type.DIRECT; + return _buffers.getRequestBufferType()==Type.DIRECT; } /* ------------------------------------------------------------------------------- */
diff -r 3fa54d9d19cd -r 0e96ce3db20a src/org/eclipse/jetty/server/nio/BlockingChannelConnector.java --- a/src/org/eclipse/jetty/server/nio/BlockingChannelConnector.java Sat Oct 22 23:00:57 2016 -0600 +++ b/src/org/eclipse/jetty/server/nio/BlockingChannelConnector.java Sun Oct 23 02:42:05 2016 -0600 @@ -211,13 +211,15 @@ } catch (EofException e) { - LOG.debug("EOF", e); - try{BlockingChannelEndPoint.this.close();} + LOG.warn("EOF", e); +// LOG.debug("EOF", e); + try{close();} catch(IOException e2){LOG.trace("",e2);} } catch (HttpException e) { - LOG.debug("BAD", e); + LOG.warn("BAD", e); +// LOG.debug("BAD", e); try{close();} catch(IOException e2){LOG.trace("",e2);} }
diff -r 3fa54d9d19cd -r 0e96ce3db20a src/org/eclipse/jetty/server/ssl/SslSelectChannelConnector.java --- a/src/org/eclipse/jetty/server/ssl/SslSelectChannelConnector.java Sat Oct 22 23:00:57 2016 -0600 +++ b/src/org/eclipse/jetty/server/ssl/SslSelectChannelConnector.java Sun Oct 23 02:42:05 2016 -0600 @@ -30,7 +30,6 @@ import org.eclipse.jetty.io.AsyncEndPoint; import org.eclipse.jetty.io.Buffers; import org.eclipse.jetty.io.Buffers.Type; -import org.eclipse.jetty.io.BuffersFactory; import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.RuntimeIOException; import org.eclipse.jetty.io.nio.AsyncConnection; @@ -53,7 +52,6 @@ public final class SslSelectChannelConnector extends SelectChannelConnector { private final SslContextFactory _sslContextFactory; - private Buffers _sslBuffers; /* ------------------------------------------------------------ */ public SslSelectChannelConnector(Server server,int port) @@ -189,29 +187,12 @@ SSLSession sslSession = sslEngine.getSession(); - _sslBuffers = BuffersFactory.newBuffers( - getUseDirectBuffers()?Type.DIRECT:Type.INDIRECT,sslSession.getApplicationBufferSize(), - getUseDirectBuffers()?Type.DIRECT:Type.INDIRECT,sslSession.getApplicationBufferSize(), - getUseDirectBuffers()?Type.DIRECT:Type.INDIRECT,getMaxBuffers() - ); - - if (getRequestHeaderSize()<sslSession.getApplicationBufferSize()) - setRequestHeaderSize(sslSession.getApplicationBufferSize()); - if (getRequestBufferSize()<sslSession.getApplicationBufferSize()) - setRequestBufferSize(sslSession.getApplicationBufferSize()); + if (_buffers.getRequestHeaderSize()<sslSession.getApplicationBufferSize()) + _buffers.setRequestHeaderSize(sslSession.getApplicationBufferSize()); + if (_buffers.getRequestBufferSize()<sslSession.getApplicationBufferSize()) + _buffers.setRequestBufferSize(sslSession.getApplicationBufferSize()); super.doStart(); } - /* ------------------------------------------------------------ */ - /** - * @see org.eclipse.jetty.server.nio.SelectChannelConnector#doStop() - */ - @Override - protected void doStop() throws Exception - { - _sslBuffers = null; - super.doStop(); - } - }