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:
parent
f665337062
commit
e4b0014b88
@ -268,7 +268,18 @@ class PseudoTcpSocketImpl
|
|||||||
throws SocketException
|
throws SocketException
|
||||||
{
|
{
|
||||||
//TODO: map options to PTCP options/method calls
|
//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)
|
public long getPTCPOption(Option opt)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user