+
-
-
-
-
-
+
diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket-forwarded.mod b/jetty-unixsocket/jetty-unixsocket-server/src/main/config/modules/unixsocket-forwarded.mod
similarity index 100%
rename from jetty-unixsocket/src/main/config/modules/unixsocket-forwarded.mod
rename to jetty-unixsocket/jetty-unixsocket-server/src/main/config/modules/unixsocket-forwarded.mod
diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket-http.mod b/jetty-unixsocket/jetty-unixsocket-server/src/main/config/modules/unixsocket-http.mod
similarity index 100%
rename from jetty-unixsocket/src/main/config/modules/unixsocket-http.mod
rename to jetty-unixsocket/jetty-unixsocket-server/src/main/config/modules/unixsocket-http.mod
diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket-http2c.mod b/jetty-unixsocket/jetty-unixsocket-server/src/main/config/modules/unixsocket-http2c.mod
similarity index 100%
rename from jetty-unixsocket/src/main/config/modules/unixsocket-http2c.mod
rename to jetty-unixsocket/jetty-unixsocket-server/src/main/config/modules/unixsocket-http2c.mod
diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket-proxy-protocol.mod b/jetty-unixsocket/jetty-unixsocket-server/src/main/config/modules/unixsocket-proxy-protocol.mod
similarity index 100%
rename from jetty-unixsocket/src/main/config/modules/unixsocket-proxy-protocol.mod
rename to jetty-unixsocket/jetty-unixsocket-server/src/main/config/modules/unixsocket-proxy-protocol.mod
diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket-secure.mod b/jetty-unixsocket/jetty-unixsocket-server/src/main/config/modules/unixsocket-secure.mod
similarity index 100%
rename from jetty-unixsocket/src/main/config/modules/unixsocket-secure.mod
rename to jetty-unixsocket/jetty-unixsocket-server/src/main/config/modules/unixsocket-secure.mod
diff --git a/jetty-unixsocket/src/main/config/modules/unixsocket.mod b/jetty-unixsocket/jetty-unixsocket-server/src/main/config/modules/unixsocket.mod
similarity index 91%
rename from jetty-unixsocket/src/main/config/modules/unixsocket.mod
rename to jetty-unixsocket/jetty-unixsocket-server/src/main/config/modules/unixsocket.mod
index 84a45d21831..a66fbdf9f6d 100644
--- a/jetty-unixsocket/src/main/config/modules/unixsocket.mod
+++ b/jetty-unixsocket/jetty-unixsocket-server/src/main/config/modules/unixsocket.mod
@@ -38,7 +38,7 @@ lib/jetty-unixsocket-${jetty.version}.jar
lib/jnr/*.jar
[license]
-Jetty UnixSockets is implmented using the Java Native Runtime, which is an
+Jetty UnixSockets is implemented using the Java Native Runtime, which is an
open source project hosted on Github and released under the Apache 2.0 license.
https://github.com/jnr/jnr-unixsocket
http://www.apache.org/licenses/LICENSE-2.0.html
@@ -46,13 +46,13 @@ http://www.apache.org/licenses/LICENSE-2.0.html
[ini-template]
### Unix SocketHTTP Connector Configuration
-## Connector host/address to bind to
-# jetty.unixsocket=/tmp/jetty.sock
+## Unix socket path to bind to
+# jetty.unixsocket.path=/tmp/jetty.sock
## Connector idle timeout in milliseconds
# jetty.unixsocket.idleTimeout=30000
-## Number of selectors (-1 picks default 1)
+## Number of selectors (-1 picks default)
# jetty.unixsocket.selectors=-1
## ServerSocketChannel backlog (0 picks platform default)
diff --git a/jetty-unixsocket/jetty-unixsocket-server/src/main/java/module-info.java b/jetty-unixsocket/jetty-unixsocket-server/src/main/java/module-info.java
new file mode 100644
index 00000000000..ce01b696bb9
--- /dev/null
+++ b/jetty-unixsocket/jetty-unixsocket-server/src/main/java/module-info.java
@@ -0,0 +1,29 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2019 Mort Bay Consulting Pty. Ltd.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+module org.eclipse.jetty.unixsocket.server
+{
+ exports org.eclipse.jetty.unixsocket.server;
+
+ requires jnr.enxio;
+ requires jnr.unixsocket;
+ requires org.eclipse.jetty.io;
+ requires org.eclipse.jetty.server;
+ requires org.eclipse.jetty.unixsocket.common;
+ requires org.eclipse.jetty.util;
+}
diff --git a/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/UnixSocketConnector.java b/jetty-unixsocket/jetty-unixsocket-server/src/main/java/org/eclipse/jetty/unixsocket/server/UnixSocketConnector.java
similarity index 63%
rename from jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/UnixSocketConnector.java
rename to jetty-unixsocket/jetty-unixsocket-server/src/main/java/org/eclipse/jetty/unixsocket/server/UnixSocketConnector.java
index 7767e772097..4bdbee1a384 100644
--- a/jetty-unixsocket/src/main/java/org/eclipse/jetty/unixsocket/UnixSocketConnector.java
+++ b/jetty-unixsocket/jetty-unixsocket-server/src/main/java/org/eclipse/jetty/unixsocket/server/UnixSocketConnector.java
@@ -16,7 +16,7 @@
// ========================================================================
//
-package org.eclipse.jetty.unixsocket;
+package org.eclipse.jetty.unixsocket.server;
import java.io.File;
import java.io.IOException;
@@ -28,8 +28,11 @@ import java.nio.channels.Selector;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.concurrent.Executor;
-import java.util.concurrent.Future;
+import jnr.enxio.channels.NativeSelectorProvider;
+import jnr.unixsocket.UnixServerSocketChannel;
+import jnr.unixsocket.UnixSocketAddress;
+import jnr.unixsocket.UnixSocketChannel;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.Connection;
import org.eclipse.jetty.io.EndPoint;
@@ -41,6 +44,7 @@ import org.eclipse.jetty.server.ConnectionFactory;
import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.SslConnectionFactory;
+import org.eclipse.jetty.unixsocket.common.UnixSocketEndPoint;
import org.eclipse.jetty.util.annotation.ManagedAttribute;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.annotation.Name;
@@ -49,153 +53,123 @@ import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.util.thread.Scheduler;
-import jnr.enxio.channels.NativeSelectorProvider;
-import jnr.unixsocket.UnixServerSocketChannel;
-import jnr.unixsocket.UnixSocketAddress;
-import jnr.unixsocket.UnixSocketChannel;
-
-/**
- *
- */
@ManagedObject("Connector using UNIX Socket")
public class UnixSocketConnector extends AbstractConnector
{
+ // See SockAddrUnix.ADDR_LENGTH.
+ public static final int MAX_UNIX_SOCKET_PATH_LENGTH = 107;
private static final Logger LOG = Log.getLogger(UnixSocketConnector.class);
-
+
private final SelectorManager _manager;
private String _unixSocket = "/tmp/jetty.sock";
private volatile UnixServerSocketChannel _acceptChannel;
private volatile int _acceptQueueSize = 0;
private volatile boolean _reuseAddress = true;
-
- /* ------------------------------------------------------------ */
- /** HTTP Server Connection.
+ /**
+ * HTTP Server Connection.
* Construct a ServerConnector with a private instance of {@link HttpConnectionFactory} as the only factory.
- * @param server The {@link Server} this connector will accept connection for.
+ *
+ * @param server The {@link Server} this connector will accept connection for.
*/
- public UnixSocketConnector( @Name("server") Server server)
+ public UnixSocketConnector(@Name("server") Server server)
{
- this(server,null,null,null,-1,new HttpConnectionFactory());
- }
-
- /* ------------------------------------------------------------ */
- /** HTTP Server Connection.
- * Construct a ServerConnector with a private instance of {@link HttpConnectionFactory} as the only factory.
- * @param server The {@link Server} this connector will accept connection for.
- * @param selectors
- * the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress.
- */
- public UnixSocketConnector(
- @Name("server") Server server,
- @Name("selectors") int selectors)
- {
- this(server,null,null,null,selectors,new HttpConnectionFactory());
- }
-
- /* ------------------------------------------------------------ */
- /** HTTP Server Connection.
- * Construct a ServerConnector with a private instance of {@link HttpConnectionFactory} as the only factory.
- * @param server The {@link Server} this connector will accept connection for.
- * @param selectors
- * the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress.
- * @param factories Zero or more {@link ConnectionFactory} instances used to create and configure connections.
- */
- public UnixSocketConnector(
- @Name("server") Server server,
- @Name("selectors") int selectors,
- @Name("factories") ConnectionFactory... factories)
- {
- this(server,null,null,null,selectors,factories);
+ this(server, -1);
}
- /* ------------------------------------------------------------ */
- /** Generic Server Connection with default configuration.
+ /**
+ * HTTP Server Connection.
+ * Construct a ServerConnector with a private instance of {@link HttpConnectionFactory} as the only factory.
+ *
+ * @param server The {@link Server} this connector will accept connection for.
+ * @param selectors the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress.
+ */
+ public UnixSocketConnector(@Name("server") Server server, @Name("selectors") int selectors)
+ {
+ this(server, selectors, new HttpConnectionFactory());
+ }
+
+ /**
+ * Generic Server Connection with default configuration.
* Construct a Server Connector with the passed Connection factories.
- * @param server The {@link Server} this connector will accept connection for.
+ *
+ * @param server The {@link Server} this connector will accept connection for.
* @param factories Zero or more {@link ConnectionFactory} instances used to create and configure connections.
*/
- public UnixSocketConnector(
- @Name("server") Server server,
- @Name("factories") ConnectionFactory... factories)
+ public UnixSocketConnector(@Name("server") Server server, @Name("factories") ConnectionFactory... factories)
{
- this(server,null,null,null,-1,factories);
+ this(server, -1, factories);
}
- /* ------------------------------------------------------------ */
- /** HTTP Server Connection.
- * Construct a ServerConnector with a private instance of {@link HttpConnectionFactory} as the primary protocol
.
- * @param server The {@link Server} this connector will accept connection for.
- * @param sslContextFactory If non null, then a {@link SslConnectionFactory} is instantiated and prepended to the
- * list of HTTP Connection Factory.
- */
- public UnixSocketConnector(
- @Name("server") Server server,
- @Name("sslContextFactory") SslContextFactory sslContextFactory)
- {
- this(server,null,null,null,-1,AbstractConnectionFactory.getFactories(sslContextFactory,new HttpConnectionFactory()));
- }
-
- /* ------------------------------------------------------------ */
- /** HTTP Server Connection.
- * Construct a ServerConnector with a private instance of {@link HttpConnectionFactory} as the primary protocol
.
- * @param server The {@link Server} this connector will accept connection for.
- * @param sslContextFactory If non null, then a {@link SslConnectionFactory} is instantiated and prepended to the
- * list of HTTP Connection Factory.
- * @param selectors
- * the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress.
- */
- public UnixSocketConnector(
- @Name("server") Server server,
- @Name("selectors") int selectors,
- @Name("sslContextFactory") SslContextFactory sslContextFactory)
- {
- this(server,null,null,null,selectors,AbstractConnectionFactory.getFactories(sslContextFactory,new HttpConnectionFactory()));
- }
-
- /* ------------------------------------------------------------ */
- /** Generic SSL Server Connection.
- * @param server The {@link Server} this connector will accept connection for.
- * @param sslContextFactory If non null, then a {@link SslConnectionFactory} is instantiated and prepended to the
- * list of ConnectionFactories, with the first factory being the default protocol for the SslConnectionFactory.
+ /**
+ * HTTP Server Connection.
+ * Construct a ServerConnector with a private instance of {@link HttpConnectionFactory} as the only factory.
+ *
+ * @param server The {@link Server} this connector will accept connection for.
+ * @param selectors the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress.
* @param factories Zero or more {@link ConnectionFactory} instances used to create and configure connections.
*/
- public UnixSocketConnector(
- @Name("server") Server server,
- @Name("sslContextFactory") SslContextFactory sslContextFactory,
- @Name("factories") ConnectionFactory... factories)
+ public UnixSocketConnector(@Name("server") Server server, @Name("selectors") int selectors, @Name("factories") ConnectionFactory... factories)
+ {
+ this(server, null, null, null, selectors, factories);
+ }
+
+ /**
+ * HTTP Server Connection.
+ * Construct a ServerConnector with a private instance of {@link HttpConnectionFactory} as the primary protocol
.
+ *
+ * @param server The {@link Server} this connector will accept connection for.
+ * @param sslContextFactory If non null, then a {@link SslConnectionFactory} is instantiated and prepended to the
+ * list of HTTP Connection Factory.
+ */
+ public UnixSocketConnector(@Name("server") Server server, @Name("sslContextFactory") SslContextFactory sslContextFactory)
+ {
+ this(server, -1, sslContextFactory);
+ }
+
+ /**
+ * HTTP Server Connection.
+ * Construct a ServerConnector with a private instance of {@link HttpConnectionFactory} as the primary protocol
.
+ *
+ * @param server The {@link Server} this connector will accept connection for.
+ * @param sslContextFactory If non null, then a {@link SslConnectionFactory} is instantiated and prepended to the
+ * list of HTTP Connection Factory.
+ * @param selectors the number of selector threads, or <=0 for a default value. Selectors notice and schedule established connection that can make IO progress.
+ */
+ public UnixSocketConnector(@Name("server") Server server, @Name("selectors") int selectors, @Name("sslContextFactory") SslContextFactory sslContextFactory)
+ {
+ this(server, null, null, null, selectors, AbstractConnectionFactory.getFactories(sslContextFactory, new HttpConnectionFactory()));
+ }
+
+ /**
+ * Generic SSL Server Connection.
+ *
+ * @param server The {@link Server} this connector will accept connection for.
+ * @param sslContextFactory If non null, then a {@link SslConnectionFactory} is instantiated and prepended to the
+ * list of ConnectionFactories, with the first factory being the default protocol for the SslConnectionFactory.
+ * @param factories Zero or more {@link ConnectionFactory} instances used to create and configure connections.
+ */
+ public UnixSocketConnector(@Name("server") Server server, @Name("sslContextFactory") SslContextFactory sslContextFactory, @Name("factories") ConnectionFactory... factories)
{
this(server, null, null, null, -1, AbstractConnectionFactory.getFactories(sslContextFactory, factories));
}
- /** Generic Server Connection.
- * @param server
- * The server this connector will be accept connection for.
- * @param executor
- * An executor used to run tasks for handling requests, acceptors and selectors.
- * If null then use the servers executor
- * @param scheduler
- * A scheduler used to schedule timeouts. If null then use the servers scheduler
- * @param bufferPool
- * A ByteBuffer pool used to allocate buffers. If null then create a private pool with default configuration.
- * @param selectors
- * the number of selector threads, or <=0 for a default value(1). Selectors notice and schedule established connection that can make IO progress.
- * @param factories
- * Zero or more {@link ConnectionFactory} instances used to create and configure connections.
+ /**
+ * Generic Server Connection.
+ *
+ * @param server The server this connector will be accept connection for.
+ * @param executor An executor used to run tasks for handling requests, acceptors and selectors.
+ * If null then use the servers executor
+ * @param scheduler A scheduler used to schedule timeouts. If null then use the servers scheduler
+ * @param bufferPool A ByteBuffer pool used to allocate buffers. If null then create a private pool with default configuration.
+ * @param selectors the number of selector threads, or <=0 for a default value(1). Selectors notice and schedule established connection that can make IO progress.
+ * @param factories Zero or more {@link ConnectionFactory} instances used to create and configure connections.
*/
- public UnixSocketConnector(
- @Name("server") Server server,
- @Name("executor") Executor executor,
- @Name("scheduler") Scheduler scheduler,
- @Name("bufferPool") ByteBufferPool bufferPool,
- @Name("selectors") int selectors,
- @Name("factories") ConnectionFactory... factories)
+ public UnixSocketConnector(@Name("server") Server server, @Name("executor") Executor executor, @Name("scheduler") Scheduler scheduler, @Name("bufferPool") ByteBufferPool bufferPool, @Name("selectors") int selectors, @Name("factories") ConnectionFactory... factories)
{
- super(server,executor,scheduler,bufferPool,0,factories);
- _manager = newSelectorManager(getExecutor(), getScheduler(),
- selectors>0?selectors:1);
+ super(server, executor, scheduler, bufferPool, 0, factories);
+ _manager = newSelectorManager(getExecutor(), getScheduler(), selectors > 0 ? selectors : 1);
addBean(_manager, true);
- setAcceptorPriorityDelta(-2);
}
@ManagedAttribute
@@ -203,10 +177,12 @@ public class UnixSocketConnector extends AbstractConnector
{
return _unixSocket;
}
-
+
public void setUnixSocket(String filename)
{
- _unixSocket=filename;
+ if (filename.length() > MAX_UNIX_SOCKET_PATH_LENGTH)
+ throw new IllegalArgumentException("Unix socket path too long");
+ _unixSocket = filename;
}
protected SelectorManager newSelectorManager(Executor executor, Scheduler scheduler, int selectors)
@@ -219,11 +195,10 @@ public class UnixSocketConnector extends AbstractConnector
{
open();
super.doStart();
-
- if (getAcceptors()==0)
+ if (getAcceptors() == 0)
_manager.acceptor(_acceptChannel);
}
-
+
@Override
protected void doStop() throws Exception
{
@@ -231,13 +206,6 @@ public class UnixSocketConnector extends AbstractConnector
close();
}
- public boolean isOpen()
- {
- UnixServerSocketChannel channel = _acceptChannel;
- return channel!=null && channel.isOpen();
- }
-
-
public void open() throws IOException
{
if (_acceptChannel == null)
@@ -246,8 +214,7 @@ public class UnixSocketConnector extends AbstractConnector
file.deleteOnExit();
SocketAddress bindAddress = new UnixSocketAddress(file);
UnixServerSocketChannel serverChannel = UnixServerSocketChannel.open();
-
- serverChannel.configureBlocking(getAcceptors()>0);
+ serverChannel.configureBlocking(getAcceptors() > 0);
try
{
serverChannel.socket().bind(bindAddress, getAcceptQueueSize());
@@ -259,18 +226,11 @@ public class UnixSocketConnector extends AbstractConnector
}
addBean(serverChannel);
if (LOG.isDebugEnabled())
- LOG.debug("opened {}",serverChannel);
+ LOG.debug("opened {}", serverChannel);
_acceptChannel = serverChannel;
}
}
- @Override
- public Future shutdown()
- {
- // shutdown all the connections
- return super.shutdown();
- }
-
public void close()
{
UnixServerSocketChannel serverChannel = _acceptChannel;
@@ -297,7 +257,7 @@ public class UnixSocketConnector extends AbstractConnector
{
Files.deleteIfExists(Paths.get(_unixSocket));
}
- catch ( IOException e )
+ catch (IOException e)
{
LOG.warn(e);
}
@@ -311,16 +271,16 @@ public class UnixSocketConnector extends AbstractConnector
UnixServerSocketChannel serverChannel = _acceptChannel;
if (serverChannel != null && serverChannel.isOpen())
{
- LOG.debug("accept {}",serverChannel);
+ LOG.debug("accept {}", serverChannel);
UnixSocketChannel channel = serverChannel.accept();
- LOG.debug("accepted {}",channel);
+ LOG.debug("accepted {}", channel);
accepted(channel);
}
}
-
+
protected void accepted(UnixSocketChannel channel) throws IOException
{
- channel.configureBlocking(false);
+ channel.configureBlocking(false);
_manager.accept(channel);
}
@@ -337,10 +297,9 @@ public class UnixSocketConnector extends AbstractConnector
protected UnixSocketEndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey key) throws IOException
{
- return new UnixSocketEndPoint((UnixSocketChannel)channel,selector,key,getScheduler());
+ return new UnixSocketEndPoint((UnixSocketChannel)channel, selector, key, getScheduler());
}
-
/**
* @return the accept queue size
*/
@@ -376,7 +335,6 @@ public class UnixSocketConnector extends AbstractConnector
_reuseAddress = reuseAddress;
}
-
@Override
public String toString()
{
@@ -384,7 +342,7 @@ public class UnixSocketConnector extends AbstractConnector
super.toString(),
_unixSocket);
}
-
+
protected class UnixSocketConnectorManager extends SelectorManager
{
public UnixSocketConnectorManager(Executor executor, Scheduler scheduler, int selectors)
@@ -403,7 +361,7 @@ public class UnixSocketConnector extends AbstractConnector
{
return NativeSelectorProvider.getInstance().openSelector();
}
-
+
@Override
protected EndPoint newEndPoint(SelectableChannel channel, ManagedSelector selector, SelectionKey selectionKey) throws IOException
{
@@ -448,10 +406,10 @@ public class UnixSocketConnector extends AbstractConnector
protected SelectableChannel doAccept(SelectableChannel server) throws IOException
{
if (LOG.isDebugEnabled())
- LOG.debug("doAccept async {}",server);
+ LOG.debug("doAccept async {}", server);
UnixSocketChannel channel = ((UnixServerSocketChannel)server).accept();
if (LOG.isDebugEnabled())
- LOG.debug("accepted async {}",channel);
+ LOG.debug("accepted async {}", channel);
return channel;
}
}
diff --git a/jetty-unixsocket/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketProxyServer.java b/jetty-unixsocket/jetty-unixsocket-server/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketProxyServer.java
similarity index 98%
rename from jetty-unixsocket/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketProxyServer.java
rename to jetty-unixsocket/jetty-unixsocket-server/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketProxyServer.java
index ce88a7acf2f..886ac885570 100644
--- a/jetty-unixsocket/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketProxyServer.java
+++ b/jetty-unixsocket/jetty-unixsocket-server/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketProxyServer.java
@@ -34,6 +34,7 @@ import org.eclipse.jetty.server.ProxyConnectionFactory;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.AbstractHandler;
+import org.eclipse.jetty.unixsocket.server.UnixSocketConnector;
public class UnixSocketProxyServer
{
diff --git a/jetty-unixsocket/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketServer.java b/jetty-unixsocket/jetty-unixsocket-server/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketServer.java
similarity index 95%
rename from jetty-unixsocket/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketServer.java
rename to jetty-unixsocket/jetty-unixsocket-server/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketServer.java
index 4323fa8767e..0705667dbfa 100644
--- a/jetty-unixsocket/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketServer.java
+++ b/jetty-unixsocket/jetty-unixsocket-server/src/test/java/org/eclipse/jetty/unixsocket/UnixSocketServer.java
@@ -25,15 +25,14 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Date;
-import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.HttpConnectionFactory;
-import org.eclipse.jetty.server.ProxyConnectionFactory;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.AbstractHandler;
+import org.eclipse.jetty.unixsocket.server.UnixSocketConnector;
public class UnixSocketServer
{
@@ -53,7 +52,7 @@ public class UnixSocketServer
{
@Override
protected void doNonErrorHandle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
- throws IOException, ServletException
+ throws IOException
{
int l = 0;
if (request.getContentLength()!=0)
diff --git a/jetty-unixsocket/jetty-unixsocket-server/src/test/resources/jetty-logging.properties b/jetty-unixsocket/jetty-unixsocket-server/src/test/resources/jetty-logging.properties
new file mode 100644
index 00000000000..f6dad82a697
--- /dev/null
+++ b/jetty-unixsocket/jetty-unixsocket-server/src/test/resources/jetty-logging.properties
@@ -0,0 +1,3 @@
+org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
+#org.eclipse.jetty.LEVEL=DEBUG
+#org.eclipse.jetty.unixsocket.LEVEL=DEBUG
diff --git a/jetty-unixsocket/pom.xml b/jetty-unixsocket/pom.xml
index de9e9ea1684..29fd16bab8a 100644
--- a/jetty-unixsocket/pom.xml
+++ b/jetty-unixsocket/pom.xml
@@ -1,48 +1,21 @@
-
+
org.eclipse.jetty
jetty-project
10.0.0-SNAPSHOT
+
4.0.0
jetty-unixsocket
+ pom
Jetty :: UnixSocket
- Jetty UnixSocket
- http://www.eclipse.org/jetty
-
- ${project.groupId}.unixsocket
-
-
-
-
- org.codehaus.mojo
- findbugs-maven-plugin
-
- org.eclipse.jetty.unixsocket.*
-
-
-
-
-
-
- org.eclipse.jetty
- jetty-server
- ${project.version}
-
-
- com.github.jnr
- jnr-unixsocket
-
-
- org.eclipse.jetty
- jetty-client
- ${project.version}
- provided
-
-
- org.eclipse.jetty.toolchain
- jetty-test-helper
- test
-
-
+ Jetty UnixSocket Parent
+
+
+ jetty-unixsocket-common
+ jetty-unixsocket-client
+ jetty-unixsocket-server
+
+
diff --git a/jetty-unixsocket/src/test/resources/haproxy b/jetty-unixsocket/src/test/resources/haproxy
deleted file mode 100755
index 73db7b00b8e..00000000000
Binary files a/jetty-unixsocket/src/test/resources/haproxy and /dev/null differ
diff --git a/jetty-unixsocket/src/test/resources/jetty-logging.properties b/jetty-unixsocket/src/test/resources/jetty-logging.properties
deleted file mode 100644
index 46f8e39c33f..00000000000
--- a/jetty-unixsocket/src/test/resources/jetty-logging.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
-#org.eclipse.jetty.LEVEL=DEBUG
-#org.eclipse.jetty.client.LEVEL=DEBUG
-#org.eclipse.jetty.proxy.LEVEL=DEBUG
-#org.eclipse.jetty.unixsocket.LEVEL=DEBUG
-#org.eclipse.jetty.io.LEVEL=DEBUG
-#org.eclipse.jetty.server.ProxyConnectionFactory.LEVEL=DEBUG
-#org.eclipse.jetty.unixsocket.LEVEL=DEBUG
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index c3e7f679eef..f4deea93706 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1034,7 +1034,7 @@
com.github.jnr
jnr-unixsocket
- 0.20
+ 0.22
junit
diff --git a/tests/test-http-client-transport/pom.xml b/tests/test-http-client-transport/pom.xml
index 7e909f8621a..3edc69bc67a 100644
--- a/tests/test-http-client-transport/pom.xml
+++ b/tests/test-http-client-transport/pom.xml
@@ -86,7 +86,13 @@
org.eclipse.jetty
- jetty-unixsocket
+ jetty-unixsocket-client
+ ${project.version}
+ test
+
+
+ org.eclipse.jetty
+ jetty-unixsocket-server
${project.version}
test
diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/AsyncIOServletTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/AsyncIOServletTest.java
index b5ef43875c7..f8dfac7e440 100644
--- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/AsyncIOServletTest.java
+++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/AsyncIOServletTest.java
@@ -18,20 +18,6 @@
package org.eclipse.jetty.http.client;
-import static java.nio.ByteBuffer.wrap;
-import static org.eclipse.jetty.http.client.Transport.FCGI;
-import static org.eclipse.jetty.util.BufferUtil.toArray;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.instanceOf;
-import static org.hamcrest.Matchers.is;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertFalse;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertSame;
-import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -85,7 +71,7 @@ import org.eclipse.jetty.server.HttpInput.Content;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.server.handler.ContextHandler.Context;
-import org.eclipse.jetty.unixsocket.UnixSocketConnector;
+import org.eclipse.jetty.unixsocket.server.UnixSocketConnector;
import org.eclipse.jetty.util.BufferUtil;
import org.eclipse.jetty.util.FuturePromise;
import org.eclipse.jetty.util.log.StacklessLogging;
@@ -96,6 +82,20 @@ import org.junit.jupiter.api.Tag;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ArgumentsSource;
+import static java.nio.ByteBuffer.wrap;
+import static org.eclipse.jetty.http.client.Transport.FCGI;
+import static org.eclipse.jetty.util.BufferUtil.toArray;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.hamcrest.Matchers.is;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
public class AsyncIOServletTest extends AbstractTest
{
@Override
diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientLoadTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientLoadTest.java
index a0ee475b519..4210cdb487e 100644
--- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientLoadTest.java
+++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientLoadTest.java
@@ -53,8 +53,8 @@ import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.handler.AbstractHandler;
-import org.eclipse.jetty.unixsocket.UnixSocketConnector;
import org.eclipse.jetty.unixsocket.client.HttpClientTransportOverUnixSockets;
+import org.eclipse.jetty.unixsocket.server.UnixSocketConnector;
import org.eclipse.jetty.util.IO;
import org.eclipse.jetty.util.LeakDetector;
import org.eclipse.jetty.util.ProcessorUtils;
diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/TransportScenario.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/TransportScenario.java
index 93d9031fff2..1e05572229f 100644
--- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/TransportScenario.java
+++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/TransportScenario.java
@@ -56,8 +56,8 @@ import org.eclipse.jetty.server.SslConnectionFactory;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
-import org.eclipse.jetty.unixsocket.UnixSocketConnector;
import org.eclipse.jetty.unixsocket.client.HttpClientTransportOverUnixSockets;
+import org.eclipse.jetty.unixsocket.server.UnixSocketConnector;
import org.eclipse.jetty.util.BlockingArrayQueue;
import org.eclipse.jetty.util.SocketAddressResolver;
import org.eclipse.jetty.util.log.Log;