From 06e00355a271aa3871acbef6c324ed55df8ee467 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 20 Oct 2017 09:41:47 +1100 Subject: [PATCH] Fixed #1912 --- .../src/main/java/org/eclipse/jetty/io/ManagedSelector.java | 2 +- .../main/java/org/eclipse/jetty/server/LocalConnector.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java b/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java index 3a80593282e..18a05eafd5e 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/ManagedSelector.java @@ -418,10 +418,10 @@ public class ManagedSelector extends AbstractLifeCycle implements Runnable, Dump private EndPoint createEndPoint(SocketChannel channel, SelectionKey selectionKey) throws IOException { EndPoint endPoint = _selectorManager.newEndPoint(channel, this, selectionKey); - _selectorManager.endPointOpened(endPoint); Connection connection = _selectorManager.newConnection(channel, endPoint, selectionKey.attachment()); endPoint.setConnection(connection); selectionKey.attach(endPoint); + _selectorManager.endPointOpened(endPoint); _selectorManager.connectionOpened(connection); if (LOG.isDebugEnabled()) LOG.debug("Created {}", endPoint); diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java index 7788ec40249..02cef7d2ee2 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/LocalConnector.java @@ -195,11 +195,12 @@ public class LocalConnector extends AbstractConnector if (LOG.isDebugEnabled()) LOG.debug("accepting {}", acceptorID); LocalEndPoint endPoint = _connects.take(); - endPoint.onOpen(); - onEndPointOpened(endPoint); Connection connection = getDefaultConnectionFactory().newConnection(this, endPoint); endPoint.setConnection(connection); + + endPoint.onOpen(); + onEndPointOpened(endPoint); connection.onOpen(); }