From 79e431f330b40ac31bb12b55cc52140debb8b5b9 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Thu, 29 Sep 2011 17:36:23 +1000 Subject: [PATCH] cleanup --- .../main/java/org/eclipse/jetty/http/HttpParser.java | 10 +++++++++- .../java/org/eclipse/jetty/io/nio/ChannelEndPoint.java | 1 - .../eclipse/jetty/io/nio/SelectChannelEndPoint.java | 4 +++- .../java/org/eclipse/jetty/io/nio/SelectorManager.java | 3 ++- .../eclipse/jetty/io/nio/SslSelectChannelEndPoint.java | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java index 46c8f30cc80..0c18400950b 100644 --- a/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java +++ b/jetty-http/src/main/java/org/eclipse/jetty/http/HttpParser.java @@ -939,7 +939,15 @@ public class HttpParser implements Parser if (_buffer.space() == 0) throw new HttpException(HttpStatus.REQUEST_ENTITY_TOO_LARGE_413, "FULL "+(_buffer==_body?"body":"head")); - return _endp.fill(_buffer); + try + { + return _endp.fill(_buffer); + } + catch(IOException e) + { + LOG.debug(e); + throw (e instanceof EofException) ? e:new EofException(e); + } } return -1; diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/ChannelEndPoint.java b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/ChannelEndPoint.java index 516e1cc6f75..5ee14242347 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/ChannelEndPoint.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/ChannelEndPoint.java @@ -264,7 +264,6 @@ public class ChannelEndPoint implements EndPoint { throw new IOException("Not Implemented"); } - return len; } diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java index 06bd0fd7114..5bf00235e0c 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectChannelEndPoint.java @@ -539,8 +539,10 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements AsyncEndPo cancelIdle(); if (_open) + { + _open=false; _selectSet.destroyEndPoint(this); - _open=false; + } _key = null; } } diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectorManager.java b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectorManager.java index 507fad0fa8a..1b8218832a4 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectorManager.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SelectorManager.java @@ -946,7 +946,8 @@ public abstract class SelectorManager extends AbstractLifeCycle implements Dumpa final CountDownLatch latch = new CountDownLatch(1); - addChange(new ChangeTask(){ + addChange(new ChangeTask() + { public void run() { dumpKeyState(dump); diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SslSelectChannelEndPoint.java b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SslSelectChannelEndPoint.java index 7476800bde8..2e1c93f3b7d 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SslSelectChannelEndPoint.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/nio/SslSelectChannelEndPoint.java @@ -388,7 +388,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint } // return the number of unencrypted bytes filled. int filled=buffer.length()-size; - if (filled==0 && isInputShutdown()) + if (filled==0 && (isInputShutdown() || !isOpen())) return -1; return filled;