Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jetty-io/src/main/java/org/eclipse/jetty/io/nio/ChannelEndPoint.java')
-rw-r--r--jetty-io/src/main/java/org/eclipse/jetty/io/nio/ChannelEndPoint.java56
1 files changed, 23 insertions, 33 deletions
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 decf75d076..1f642abeda 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
@@ -154,49 +154,39 @@ public class ChannelEndPoint implements EndPoint
final NIOBuffer nbuf = (NIOBuffer)buf;
final ByteBuffer bbuf=nbuf.getByteBuffer();
//noinspection SynchronizationOnLocalVariableOrMethodParameter
- synchronized(bbuf)
+
+ try
{
- try
- {
- bbuf.position(buffer.putIndex());
- len=_channel.read(bbuf);
- if (len<0 && isOpen() && !isInputShutdown())
- {
- try
- {
- shutdownInput();
- }
- catch(IOException x)
- {
- Log.ignore(x);
- try
- {
- close();
- }
- catch (IOException xx)
- {
- Log.ignore(xx);
- }
- }
- }
- }
- catch (IOException x)
+ synchronized(bbuf)
{
try
{
- close();
+ bbuf.position(buffer.putIndex());
+ len=_channel.read(bbuf);
}
- catch (IOException xx)
+ finally
{
- Log.ignore(xx);
+ buffer.setPutIndex(bbuf.position());
+ bbuf.position(0);
}
- throw x;
}
- finally
+
+ if (len<0 && isOpen() && !isInputShutdown())
+ shutdownInput();
+ }
+ catch (IOException x)
+ {
+ try
{
- buffer.setPutIndex(bbuf.position());
- bbuf.position(0);
+ close();
}
+ catch (IOException xx)
+ {
+ Log.ignore(xx);
+ }
+
+ if (len>=0)
+ throw x;
}
}
else

Back to the top