mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8147862: Null check too late in sun.net.httpserver.ServerImpl
Reviewed-by: chegar
This commit is contained in:
parent
0e9196c50f
commit
1cbdf12c05
1 changed files with 15 additions and 15 deletions
|
@ -373,22 +373,22 @@ class ServerImpl implements TimeSource {
|
|||
}
|
||||
SocketChannel chan = schan.accept();
|
||||
|
||||
// Set TCP_NODELAY, if appropriate
|
||||
if (ServerConfig.noDelay()) {
|
||||
chan.socket().setTcpNoDelay(true);
|
||||
// optimist there's a channel
|
||||
if (chan != null) {
|
||||
// Set TCP_NODELAY, if appropriate
|
||||
if (ServerConfig.noDelay()) {
|
||||
chan.socket().setTcpNoDelay(true);
|
||||
}
|
||||
chan.configureBlocking (false);
|
||||
SelectionKey newkey =
|
||||
chan.register (selector, SelectionKey.OP_READ);
|
||||
HttpConnection c = new HttpConnection ();
|
||||
c.selectionKey = newkey;
|
||||
c.setChannel (chan);
|
||||
newkey.attach (c);
|
||||
requestStarted (c);
|
||||
allConnections.add (c);
|
||||
}
|
||||
|
||||
if (chan == null) {
|
||||
continue; /* cancel something ? */
|
||||
}
|
||||
chan.configureBlocking (false);
|
||||
SelectionKey newkey = chan.register (selector, SelectionKey.OP_READ);
|
||||
HttpConnection c = new HttpConnection ();
|
||||
c.selectionKey = newkey;
|
||||
c.setChannel (chan);
|
||||
newkey.attach (c);
|
||||
requestStarted (c);
|
||||
allConnections.add (c);
|
||||
} else {
|
||||
try {
|
||||
if (key.isReadable()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue