mirror of
https://github.com/jetty/jetty.project.git
synced 2025-03-01 03:19:13 +00:00
Merge branch 'master' of ssh://git.eclipse.org/gitroot/jetty/org.eclipse.jetty.project
This commit is contained in:
commit
aa0b71f928
@ -466,7 +466,7 @@ public class SslBytesServerTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check that we did not spin
|
// Check that we did not spin
|
||||||
Assert.assertThat(sslHandles.get(), lessThan(500));
|
Assert.assertThat(sslHandles.get(), lessThan(750));
|
||||||
Assert.assertThat(httpParses.get(), lessThan(150));
|
Assert.assertThat(httpParses.get(), lessThan(150));
|
||||||
|
|
||||||
client.close();
|
client.close();
|
||||||
|
@ -43,8 +43,9 @@ public class ChannelEndPoint implements EndPoint
|
|||||||
protected final Socket _socket;
|
protected final Socket _socket;
|
||||||
protected final InetSocketAddress _local;
|
protected final InetSocketAddress _local;
|
||||||
protected final InetSocketAddress _remote;
|
protected final InetSocketAddress _remote;
|
||||||
protected int _maxIdleTime;
|
protected volatile int _maxIdleTime;
|
||||||
private boolean _ishut;
|
private volatile boolean _ishut;
|
||||||
|
private volatile boolean _oshut;
|
||||||
|
|
||||||
public ChannelEndPoint(ByteChannel channel) throws IOException
|
public ChannelEndPoint(ByteChannel channel) throws IOException
|
||||||
{
|
{
|
||||||
@ -109,34 +110,32 @@ public class ChannelEndPoint implements EndPoint
|
|||||||
*/
|
*/
|
||||||
protected final void shutdownChannelInput() throws IOException
|
protected final void shutdownChannelInput() throws IOException
|
||||||
{
|
{
|
||||||
LOG.debug("ishut {}",this);
|
LOG.debug("ishut {}", this);
|
||||||
|
_ishut = true;
|
||||||
if (_channel.isOpen())
|
if (_channel.isOpen())
|
||||||
{
|
{
|
||||||
if (_socket!=null)
|
if (_socket != null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!_socket.isInputShutdown())
|
if (!_socket.isInputShutdown())
|
||||||
{
|
{
|
||||||
// System.err.println("ISHUT "+_socket);
|
|
||||||
_socket.shutdownInput();
|
_socket.shutdownInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(SocketException e)
|
catch (SocketException e)
|
||||||
{
|
{
|
||||||
// System.err.println(e);
|
|
||||||
LOG.debug(e.toString());
|
LOG.debug(e.toString());
|
||||||
LOG.ignore(e);
|
LOG.ignore(e);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
_ishut=true;
|
if (_oshut)
|
||||||
if(_socket.isOutputShutdown() && !_socket.isClosed())
|
{
|
||||||
close();
|
close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
_ishut=true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,33 +150,31 @@ public class ChannelEndPoint implements EndPoint
|
|||||||
protected final void shutdownChannelOutput() throws IOException
|
protected final void shutdownChannelOutput() throws IOException
|
||||||
{
|
{
|
||||||
LOG.debug("oshut {}",this);
|
LOG.debug("oshut {}",this);
|
||||||
|
_oshut = true;
|
||||||
if (_channel.isOpen())
|
if (_channel.isOpen())
|
||||||
{
|
{
|
||||||
if (_socket!=null)
|
if (_socket != null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!_socket.isOutputShutdown())
|
if (!_socket.isOutputShutdown())
|
||||||
{
|
{
|
||||||
// System.err.println("OSHUT "+_socket);
|
|
||||||
_socket.shutdownOutput();
|
_socket.shutdownOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(SocketException e)
|
catch (SocketException e)
|
||||||
{
|
{
|
||||||
LOG.debug(e.toString());
|
LOG.debug(e.toString());
|
||||||
LOG.ignore(e);
|
LOG.ignore(e);
|
||||||
if (!_socket.isClosed())
|
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
if ((_ishut||_socket.isInputShutdown()) && !_socket.isClosed())
|
if (_ishut)
|
||||||
|
{
|
||||||
close();
|
close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,12 +188,12 @@ public class ChannelEndPoint implements EndPoint
|
|||||||
|
|
||||||
public boolean isOutputShutdown()
|
public boolean isOutputShutdown()
|
||||||
{
|
{
|
||||||
return !_channel.isOpen() || _socket!=null && _socket.isOutputShutdown();
|
return _oshut || !_channel.isOpen() || _socket != null && _socket.isOutputShutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInputShutdown()
|
public boolean isInputShutdown()
|
||||||
{
|
{
|
||||||
return !_channel.isOpen() || _ishut || _socket!=null && _socket.isInputShutdown();
|
return _ishut || !_channel.isOpen() || _socket != null && _socket.isInputShutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
@ -357,7 +354,7 @@ public class ChannelEndPoint implements EndPoint
|
|||||||
trailer!=null && trailer.length()>0)
|
trailer!=null && trailer.length()>0)
|
||||||
length+=flush(trailer);
|
length+=flush(trailer);
|
||||||
}
|
}
|
||||||
|
|
||||||
return length;
|
return length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user