293739 - Deprecate static Jetty Log usage in favor of named logs

+ Finished conversion of jetty-continuation, jetty-http, jetty-io
This commit is contained in:
Joakim Erdfelt 2011-08-24 12:51:39 -07:00
parent b63e56e8e1
commit f15617fbb2
15 changed files with 93 additions and 50 deletions

View File

@ -8,8 +8,7 @@ import javax.servlet.ServletResponse;
import javax.servlet.ServletResponseWrapper; import javax.servlet.ServletResponseWrapper;
import org.mortbay.log.Log; import org.mortbay.log.Log;
import org.mortbay.log.Logger;
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
@ -19,6 +18,8 @@ import org.mortbay.log.Log;
*/ */
public class Jetty6Continuation implements ContinuationFilter.FilteredContinuation public class Jetty6Continuation implements ContinuationFilter.FilteredContinuation
{ {
private static final Logger LOG = Log.getLogger(Jetty6Continuation.class.getName());
// Exception reused for all continuations // Exception reused for all continuations
// Turn on debug in ContinuationFilter to see real stack trace. // Turn on debug in ContinuationFilter to see real stack trace.
private final static ContinuationThrowable __exception = new ContinuationThrowable(); private final static ContinuationThrowable __exception = new ContinuationThrowable();
@ -40,7 +41,7 @@ public class Jetty6Continuation implements ContinuationFilter.FilteredContinuati
{ {
if (!ContinuationFilter._initialized) if (!ContinuationFilter._initialized)
{ {
Log.warn("!ContinuationFilter installed"); LOG.warn("!ContinuationFilter installed",null,null);
throw new IllegalStateException("!ContinuationFilter installed"); throw new IllegalStateException("!ContinuationFilter installed");
} }
_request=request; _request=request;

View File

@ -22,6 +22,7 @@ import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.EofException; import org.eclipse.jetty.io.EofException;
import org.eclipse.jetty.io.View; import org.eclipse.jetty.io.View;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
@ -34,6 +35,8 @@ import org.eclipse.jetty.util.log.Log;
*/ */
public abstract class AbstractGenerator implements Generator public abstract class AbstractGenerator implements Generator
{ {
private static final Logger LOG = Log.getLogger(AbstractGenerator.class);
// states // states
public final static int STATE_HEADER = 0; public final static int STATE_HEADER = 0;
public final static int STATE_CONTENT = 2; public final static int STATE_CONTENT = 2;
@ -410,8 +413,8 @@ public abstract class AbstractGenerator implements Generator
if (_contentLength >= 0 && _contentLength != _contentWritten && !_head) if (_contentLength >= 0 && _contentLength != _contentWritten && !_head)
{ {
if (Log.isDebugEnabled()) if (LOG.isDebugEnabled())
Log.debug("ContentLength written=="+_contentWritten+" != contentLength=="+_contentLength); LOG.debug("ContentLength written=="+_contentWritten+" != contentLength=="+_contentLength);
_persistent = false; _persistent = false;
} }
} }

View File

@ -44,6 +44,7 @@ import org.eclipse.jetty.util.QuotedStringTokenizer;
import org.eclipse.jetty.util.StringMap; import org.eclipse.jetty.util.StringMap;
import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
@ -56,6 +57,8 @@ import org.eclipse.jetty.util.log.Log;
*/ */
public class HttpFields public class HttpFields
{ {
private static final Logger LOG = Log.getLogger(HttpFields.class);
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
public static final String __COOKIE_DELIM="\"\\\n\r\t\f\b%+ ;="; public static final String __COOKIE_DELIM="\"\\\n\r\t\f\b%+ ;=";
public static final TimeZone __GMT = TimeZone.getTimeZone("GMT"); public static final TimeZone __GMT = TimeZone.getTimeZone("GMT");
@ -242,7 +245,7 @@ public class HttpFields
} }
catch (java.lang.Exception e) catch (java.lang.Exception e)
{ {
// Log.ignore(e); // LOG.ignore(e);
} }
} }
@ -259,7 +262,7 @@ public class HttpFields
} }
catch (java.lang.Exception e) catch (java.lang.Exception e)
{ {
// Log.ignore(e); // LOG.ignore(e);
} }
} }
} }
@ -1058,7 +1061,7 @@ public class HttpFields
} }
catch (Exception e) catch (Exception e)
{ {
Log.warn(e); LOG.warn(e);
return e.toString(); return e.toString();
} }
} }

View File

@ -25,6 +25,7 @@ import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.io.EofException; import org.eclipse.jetty.io.EofException;
import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
@ -35,6 +36,8 @@ import org.eclipse.jetty.util.log.Log;
*/ */
public class HttpGenerator extends AbstractGenerator public class HttpGenerator extends AbstractGenerator
{ {
private static final Logger LOG = Log.getLogger(HttpGenerator.class);
// Build cache of response lines for status // Build cache of response lines for status
private static class Status private static class Status
{ {
@ -154,7 +157,7 @@ public class HttpGenerator extends AbstractGenerator
if (_last || _state==STATE_END) if (_last || _state==STATE_END)
{ {
Log.debug("Ignoring extra content {}",content); LOG.debug("Ignoring extra content {}",content);
content.clear(); content.clear();
return; return;
} }
@ -239,7 +242,7 @@ public class HttpGenerator extends AbstractGenerator
if (_last || _state==STATE_END) if (_last || _state==STATE_END)
{ {
Log.debug("Ignoring extra content {}",Byte.valueOf(b)); LOG.debug("Ignoring extra content {}",Byte.valueOf(b));
return false; return false;
} }
@ -345,7 +348,7 @@ public class HttpGenerator extends AbstractGenerator
} }
catch(InterruptedException e) catch(InterruptedException e)
{ {
Log.debug(e); LOG.debug(e);
throw new InterruptedIOException(e.toString()); throw new InterruptedIOException(e.toString());
} }
} }
@ -912,7 +915,7 @@ public class HttpGenerator extends AbstractGenerator
} }
catch (IOException e) catch (IOException e)
{ {
Log.ignore(e); LOG.ignore(e);
throw (e instanceof EofException) ? e:new EofException(e); throw (e instanceof EofException) ? e:new EofException(e);
} }
} }

View File

@ -26,9 +26,12 @@ import org.eclipse.jetty.io.View;
import org.eclipse.jetty.io.bio.StreamEndPoint; import org.eclipse.jetty.io.bio.StreamEndPoint;
import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
public class HttpParser implements Parser public class HttpParser implements Parser
{ {
private static final Logger LOG = Log.getLogger(HttpParser.class);
// States // States
public static final int STATE_START=-14; public static final int STATE_START=-14;
public static final int STATE_FIELD0=-13; public static final int STATE_FIELD0=-13;
@ -488,7 +491,7 @@ public class HttpParser implements Parser
} }
catch(NumberFormatException e) catch(NumberFormatException e)
{ {
Log.ignore(e); LOG.ignore(e);
throw new HttpException(HttpStatus.BAD_REQUEST_400); throw new HttpException(HttpStatus.BAD_REQUEST_400);
} }
if (_contentLength <= 0) if (_contentLength <= 0)
@ -930,7 +933,7 @@ public class HttpParser implements Parser
} }
catch(IOException e) catch(IOException e)
{ {
Log.debug(e); LOG.debug(e);
throw (e instanceof EofException) ? e:new EofException(e); throw (e instanceof EofException) ? e:new EofException(e);
} }
} }

View File

@ -25,6 +25,7 @@ import org.eclipse.jetty.io.BufferCache;
import org.eclipse.jetty.io.BufferCache.CachedBuffer; import org.eclipse.jetty.io.BufferCache.CachedBuffer;
import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
@ -33,6 +34,8 @@ import org.eclipse.jetty.util.log.Log;
*/ */
public class MimeTypes public class MimeTypes
{ {
private static final Logger LOG = Log.getLogger(MimeTypes.class);
public final static String public final static String
FORM_ENCODED="application/x-www-form-urlencoded", FORM_ENCODED="application/x-www-form-urlencoded",
MESSAGE_HTTP="message/http", MESSAGE_HTTP="message/http",
@ -132,8 +135,8 @@ public class MimeTypes
} }
catch(MissingResourceException e) catch(MissingResourceException e)
{ {
Log.warn(e.toString()); LOG.warn(e.toString());
Log.debug(e); LOG.debug(e);
} }
try try
@ -148,8 +151,8 @@ public class MimeTypes
} }
catch(MissingResourceException e) catch(MissingResourceException e)
{ {
Log.warn(e.toString()); LOG.warn(e.toString());
Log.debug(e); LOG.debug(e);
} }

View File

@ -19,6 +19,7 @@ import java.security.MessageDigest;
import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.TypeUtil;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
@ -37,6 +38,8 @@ import org.eclipse.jetty.util.log.Log;
*/ */
public abstract class Credential implements Serializable public abstract class Credential implements Serializable
{ {
private static final Logger LOG = Log.getLogger(Credential.class);
private static final long serialVersionUID = -7760551052768181572L; private static final long serialVersionUID = -7760551052768181572L;
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
@ -91,7 +94,7 @@ public abstract class Credential implements Serializable
if (credentials instanceof char[]) if (credentials instanceof char[])
credentials=new String((char[])credentials); credentials=new String((char[])credentials);
if (!(credentials instanceof String) && !(credentials instanceof Password)) if (!(credentials instanceof String) && !(credentials instanceof Password))
Log.warn("Can't check " + credentials.getClass() + " against CRYPT"); LOG.warn("Can't check " + credentials.getClass() + " against CRYPT");
String passwd = credentials.toString(); String passwd = credentials.toString();
return _cooked.equals(UnixCrypt.crypt(passwd, _cooked)); return _cooked.equals(UnixCrypt.crypt(passwd, _cooked));
@ -172,13 +175,13 @@ public abstract class Credential implements Serializable
} }
else else
{ {
Log.warn("Can't check " + credentials.getClass() + " against MD5"); LOG.warn("Can't check " + credentials.getClass() + " against MD5");
return false; return false;
} }
} }
catch (Exception e) catch (Exception e)
{ {
Log.warn(e); LOG.warn(e);
return false; return false;
} }
} }
@ -199,7 +202,7 @@ public abstract class Credential implements Serializable
} }
catch (Exception e) catch (Exception e)
{ {
Log.warn(e); LOG.warn(e);
return null; return null;
} }
} }
@ -213,7 +216,7 @@ public abstract class Credential implements Serializable
} }
catch (Exception e) catch (Exception e)
{ {
Log.warn(e); LOG.warn(e);
return null; return null;
} }
} }

View File

@ -17,6 +17,7 @@ import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
@ -48,6 +49,8 @@ import org.eclipse.jetty.util.log.Log;
*/ */
public class Password extends Credential public class Password extends Credential
{ {
private static final Logger LOG = Log.getLogger(Password.class);
private static final long serialVersionUID = 5062906681431569445L; private static final long serialVersionUID = 5062906681431569445L;
public static final String __OBFUSCATE = "OBF:"; public static final String __OBFUSCATE = "OBF:";
@ -210,7 +213,7 @@ public class Password extends Credential
} }
catch (IOException e) catch (IOException e)
{ {
Log.warn(Log.EXCEPTION, e); LOG.warn(Log.EXCEPTION, e);
} }
if (passwd == null || passwd.length() == 0) passwd = promptDft; if (passwd == null || passwd.length() == 0) passwd = promptDft;
} }

View File

@ -19,6 +19,7 @@ import java.io.OutputStream;
import org.eclipse.jetty.util.TypeUtil; import org.eclipse.jetty.util.TypeUtil;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
/** /**
* *
@ -26,6 +27,8 @@ import org.eclipse.jetty.util.log.Log;
*/ */
public abstract class AbstractBuffer implements Buffer public abstract class AbstractBuffer implements Buffer
{ {
private static final Logger LOG = Log.getLogger(AbstractBuffer.class);
private final static boolean __boundsChecking = Boolean.getBoolean("org.eclipse.jetty.io.AbstractBuffer.boundsChecking"); private final static boolean __boundsChecking = Boolean.getBoolean("org.eclipse.jetty.io.AbstractBuffer.boundsChecking");
protected final static String protected final static String
@ -637,7 +640,7 @@ public abstract class AbstractBuffer implements Buffer
} }
catch(Exception e) catch(Exception e)
{ {
Log.warn(e); LOG.warn(e);
return new String(asArray(), 0, length()); return new String(asArray(), 0, length());
} }
} }

View File

@ -3,10 +3,13 @@ package org.eclipse.jetty.io;
import java.io.IOException; import java.io.IOException;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
public abstract class AbstractConnection implements Connection public abstract class AbstractConnection implements Connection
{ {
private static final Logger LOG = Log.getLogger(AbstractConnection.class);
private final long _timeStamp; private final long _timeStamp;
protected final EndPoint _endp; protected final EndPoint _endp;
@ -40,7 +43,7 @@ public abstract class AbstractConnection implements Connection
} }
catch(IOException e) catch(IOException e)
{ {
Log.ignore(e); LOG.ignore(e);
try try
{ {
@ -48,7 +51,7 @@ public abstract class AbstractConnection implements Connection
} }
catch(IOException e2) catch(IOException e2)
{ {
Log.ignore(e2); LOG.ignore(e2);
} }
} }

View File

@ -22,6 +22,7 @@ import java.io.PrintWriter;
import java.io.Writer; import java.io.Writer;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
@ -31,6 +32,8 @@ import org.eclipse.jetty.util.log.Log;
*/ */
public class UncheckedPrintWriter extends PrintWriter public class UncheckedPrintWriter extends PrintWriter
{ {
private static final Logger LOG = Log.getLogger(UncheckedPrintWriter.class);
private boolean _autoFlush = false; private boolean _autoFlush = false;
private boolean _throwUnchecked=true; private boolean _throwUnchecked=true;
@ -105,7 +108,7 @@ public class UncheckedPrintWriter extends PrintWriter
setError(); setError();
if (_throwUnchecked) if (_throwUnchecked)
throw new RuntimeIOException(th); throw new RuntimeIOException(th);
Log.debug(th); LOG.debug(th);
} }
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */

View File

@ -20,6 +20,7 @@ import java.net.Socket;
import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
/** /**
* *
@ -28,6 +29,8 @@ import org.eclipse.jetty.util.log.Log;
*/ */
public class SocketEndPoint extends StreamEndPoint public class SocketEndPoint extends StreamEndPoint
{ {
private static final Logger LOG = Log.getLogger(SocketEndPoint.class);
final Socket _socket; final Socket _socket;
final InetSocketAddress _local; final InetSocketAddress _local;
final InetSocketAddress _remote; final InetSocketAddress _remote;
@ -230,7 +233,7 @@ public class SocketEndPoint extends StreamEndPoint
} }
catch(IOException e) catch(IOException e)
{ {
Log.ignore(e); LOG.ignore(e);
_socket.close(); _socket.close();
} }
} }

View File

@ -26,6 +26,7 @@ import org.eclipse.jetty.io.Buffer;
import org.eclipse.jetty.io.EndPoint; import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
/** /**
* Channel End Point. * Channel End Point.
@ -34,6 +35,8 @@ import org.eclipse.jetty.util.log.Log;
*/ */
public class ChannelEndPoint implements EndPoint public class ChannelEndPoint implements EndPoint
{ {
private static final Logger LOG = Log.getLogger(ChannelEndPoint.class);
protected final ByteChannel _channel; protected final ByteChannel _channel;
protected final ByteBuffer[] _gather2=new ByteBuffer[2]; protected final ByteBuffer[] _gather2=new ByteBuffer[2];
protected final Socket _socket; protected final Socket _socket;
@ -188,12 +191,12 @@ public class ChannelEndPoint implements EndPoint
} }
catch (IOException xx) catch (IOException xx)
{ {
Log.ignore(xx); LOG.ignore(xx);
} }
if (len>0) if (len>0)
throw x; throw x;
Log.ignore(x); LOG.ignore(x);
len=-1; len=-1;
} }
} }

View File

@ -22,9 +22,12 @@ import java.util.List;
import org.eclipse.jetty.io.Buffer; import org.eclipse.jetty.io.Buffer;
import org.eclipse.jetty.io.NetworkTrafficListener; import org.eclipse.jetty.io.NetworkTrafficListener;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
public class NetworkTrafficSelectChannelEndPoint extends SelectChannelEndPoint public class NetworkTrafficSelectChannelEndPoint extends SelectChannelEndPoint
{ {
private static final Logger LOG = Log.getLogger(NetworkTrafficSelectChannelEndPoint.class);
private final List<NetworkTrafficListener> listeners; private final List<NetworkTrafficListener> listeners;
public NetworkTrafficSelectChannelEndPoint(SocketChannel channel, SelectorManager.SelectSet selectSet, SelectionKey key, int maxIdleTime, List<NetworkTrafficListener> listeners) throws IOException public NetworkTrafficSelectChannelEndPoint(SocketChannel channel, SelectorManager.SelectSet selectSet, SelectionKey key, int maxIdleTime, List<NetworkTrafficListener> listeners) throws IOException
@ -74,7 +77,7 @@ public class NetworkTrafficSelectChannelEndPoint extends SelectChannelEndPoint
} }
catch (Exception x) catch (Exception x)
{ {
Log.warn(x); LOG.warn(x);
} }
} }
} }
@ -93,7 +96,7 @@ public class NetworkTrafficSelectChannelEndPoint extends SelectChannelEndPoint
} }
catch (Exception x) catch (Exception x)
{ {
Log.warn(x); LOG.warn(x);
} }
} }
} }
@ -114,7 +117,7 @@ public class NetworkTrafficSelectChannelEndPoint extends SelectChannelEndPoint
} }
catch (Exception x) catch (Exception x)
{ {
Log.warn(x); LOG.warn(x);
} }
} }
} }
@ -132,7 +135,7 @@ public class NetworkTrafficSelectChannelEndPoint extends SelectChannelEndPoint
} }
catch (Exception x) catch (Exception x)
{ {
Log.warn(x); LOG.warn(x);
} }
} }
} }

View File

@ -28,6 +28,7 @@ import org.eclipse.jetty.io.Buffers;
import org.eclipse.jetty.io.EofException; import org.eclipse.jetty.io.EofException;
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.util.log.Logger;
/* ------------------------------------------------------------ */ /* ------------------------------------------------------------ */
/** /**
@ -41,6 +42,8 @@ import org.eclipse.jetty.util.log.Logger;
*/ */
public class SslSelectChannelEndPoint extends SelectChannelEndPoint public class SslSelectChannelEndPoint extends SelectChannelEndPoint
{ {
private static final Logger LOG = Log.getLogger(SslSelectChannelEndPoint.class);
public static final Logger __log=Log.getLogger("org.eclipse.jetty.io.nio").getLogger("ssl"); public static final Logger __log=Log.getLogger("org.eclipse.jetty.io.nio").getLogger("ssl");
private static final ByteBuffer[] __NO_BUFFERS={}; private static final ByteBuffer[] __NO_BUFFERS={};
@ -247,7 +250,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
catch(SSLException e) catch(SSLException e)
{ {
super.close(); super.close();
Log.ignore(e); LOG.ignore(e);
} }
finally finally
{ {
@ -299,7 +302,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
} }
catch (Exception x) catch (Exception x)
{ {
Log.debug(x); LOG.debug(x);
super.close(); super.close();
} }
} }
@ -440,7 +443,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
{ {
case BUFFER_OVERFLOW: case BUFFER_OVERFLOW:
case BUFFER_UNDERFLOW: case BUFFER_UNDERFLOW:
Log.warn("wrap {}",_result); LOG.warn("wrap {}",_result);
case CLOSED: case CLOSED:
_closing=true; _closing=true;
} }
@ -595,7 +598,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
{ {
case BUFFER_OVERFLOW: case BUFFER_OVERFLOW:
case BUFFER_UNDERFLOW: case BUFFER_UNDERFLOW:
Log.warn("unwrap {}",_result); LOG.warn("unwrap {}",_result);
case CLOSED: case CLOSED:
_closing=true; _closing=true;
} }
@ -656,7 +659,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
{ {
if (_handshook && !_allowRenegotiate && _channel!=null && _channel.isOpen()) if (_handshook && !_allowRenegotiate && _channel!=null && _channel.isOpen())
{ {
Log.warn("SSL renegotiate denied: "+_channel); LOG.warn("SSL renegotiate denied: "+_channel);
super.close(); super.close();
} }
} }
@ -760,7 +763,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
} }
catch(SSLException e) catch(SSLException e)
{ {
Log.warn(getRemoteAddr() + ":" + getRemotePort() + " " + e); LOG.warn(getRemoteAddr() + ":" + getRemotePort() + " " + e);
freeOutBuffer(); freeOutBuffer();
super.close(); super.close();
throw e; throw e;
@ -784,7 +787,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
// If we are closed, we will never get more, so EOF // If we are closed, we will never get more, so EOF
// else return and we will be tried again // else return and we will be tried again
// later when more data arriving causes another dispatch. // later when more data arriving causes another dispatch.
if (Log.isDebugEnabled()) Log.debug("unwrap {}",_result); if (LOG.isDebugEnabled()) LOG.debug("unwrap {}",_result);
if(!isOpen()) if(!isOpen())
{ {
_inNIOBuffer.clear(); _inNIOBuffer.clear();
@ -802,7 +805,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
// return true is some bytes somewhere were moved about. // return true is some bytes somewhere were moved about.
return total_filled>0 ||_result.bytesConsumed()>0 || _result.bytesProduced()>0; return total_filled>0 ||_result.bytesConsumed()>0 || _result.bytesProduced()>0;
default: default:
Log.warn("unwrap "+_result); LOG.warn("unwrap "+_result);
throw new IOException(_result.toString()); throw new IOException(_result.toString());
} }
} }
@ -854,7 +857,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
} }
catch(SSLException e) catch(SSLException e)
{ {
Log.warn(getRemoteAddr()+":"+getRemotePort()+" "+e); LOG.warn(getRemoteAddr()+":"+getRemotePort()+" "+e);
super.close(); super.close();
throw e; throw e;
} }
@ -891,7 +894,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
{ {
case BUFFER_OVERFLOW: case BUFFER_OVERFLOW:
case BUFFER_UNDERFLOW: case BUFFER_UNDERFLOW:
Log.warn("unwrap {}",_result); LOG.warn("unwrap {}",_result);
case OK: case OK:
return _result.bytesConsumed(); return _result.bytesConsumed();
@ -900,7 +903,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
return _result.bytesConsumed()>0?_result.bytesConsumed():-1; return _result.bytesConsumed()>0?_result.bytesConsumed():-1;
default: default:
Log.warn("wrap "+_result); LOG.warn("wrap "+_result);
throw new IOException(_result.toString()); throw new IOException(_result.toString());
} }
} }
@ -935,7 +938,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
} }
catch(SSLException e) catch(SSLException e)
{ {
Log.warn(getRemoteAddr()+":"+getRemotePort()+" "+e); LOG.warn(getRemoteAddr()+":"+getRemotePort()+" "+e);
super.close(); super.close();
throw e; throw e;
} }
@ -961,7 +964,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
{ {
case BUFFER_OVERFLOW: case BUFFER_OVERFLOW:
case BUFFER_UNDERFLOW: case BUFFER_UNDERFLOW:
Log.warn("unwrap {}",_result); LOG.warn("unwrap {}",_result);
case OK: case OK:
return _result.bytesConsumed(); return _result.bytesConsumed();
@ -970,7 +973,7 @@ public class SslSelectChannelEndPoint extends SelectChannelEndPoint
return _result.bytesConsumed()>0?_result.bytesConsumed():-1; return _result.bytesConsumed()>0?_result.bytesConsumed():-1;
default: default:
Log.warn("wrap "+_result); LOG.warn("wrap "+_result);
throw new IOException(_result.toString()); throw new IOException(_result.toString());
} }
} }