Applied part of the patch submitted by Carl Hasselskog on dev list. Fixed a NullPointerException that occurred for instance when an SSLSocket called getTcpNoDelay() on PseudoTCPSocket. PseudoTcpSocketImpl returned null but the SSLSocket assumed it would be true/false. Improved logging to better detect if someone is trying to get some other option that would return null.

This commit is contained in:
paweldomas 2013-03-22 11:41:26 +00:00
parent f665337062
commit e4b0014b88

View File

@ -268,7 +268,18 @@ class PseudoTcpSocketImpl
throws SocketException
{
//TODO: map options to PTCP options/method calls
return options.get(optID);
if(optID == SocketOptions.TCP_NODELAY)
{
Object ret = options.get(Option.OPT_NODELAY.ordinal());
return ret != null;
}
Object option = options.get(optID);
if(option == null)
{
logger.warning("Asked for unknown optID" + optID);
}
return option;
}
public long getPTCPOption(Option opt)