Hi Scott,

cc'ing net-dev as this is not a build issue.

David

On 21/01/2016 4:18 AM, Scott Palmer wrote:
I was searching for a way to set TCP_NODELAY for an Endpoint using the default 
HTTP server and after finally tracking down the existence of the 
“sun.net.httpserver.nodelay” system property I noticed what appears to be a 
mistake (though not a big one) in the source code.

Look here:
http://hg.openjdk.java.net/jdk9/jdk9/jdk/file/c3ecf996006a/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java#l377

Notice the null check on ‘chan’ is performed after it may have been 
dereferenced to set the TCP_NODELAY on the channel’s socket.  If chan truly can 
be null at that point, the check needs to be move up a few lines.

Regards,

Scott

Reply via email to