ServerImpl misplaced null check
swpalmer at gmail.com
Wed Jan 20 18:18:13 UTC 2016
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.
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.
More information about the build-dev