summaryrefslogtreecommitdiffhomepage
path: root/auto
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2019-09-19 19:04:16 +0300
committerKonstantin Pavlov <thresh@nginx.com>2019-09-19 19:04:16 +0300
commitdeb26fa47a9ab1b358938134a8ced8bbc4a083e1 (patch)
tree0bedf8829f003fa4c0101e3421b7184acc1c8343 /auto
parentfcb1f851d0b5d1774a6cb876288ea29cfef58618 (diff)
parentdb777d1e7f607d1b0f01dfb73ad0bac12987202b (diff)
downloadunit-deb26fa47a9ab1b358938134a8ced8bbc4a083e1.tar.gz
unit-deb26fa47a9ab1b358938134a8ced8bbc4a083e1.tar.bz2
Merged with the default branch.
Diffstat (limited to 'auto')
-rw-r--r--auto/capability19
-rw-r--r--auto/isolation52
-rw-r--r--auto/modules/java166
-rw-r--r--auto/sources8
-rw-r--r--auto/summary2
5 files changed, 238 insertions, 9 deletions
diff --git a/auto/capability b/auto/capability
new file mode 100644
index 00000000..48777665
--- /dev/null
+++ b/auto/capability
@@ -0,0 +1,19 @@
+
+# Copyright (C) Igor Sysoev
+# Copyright (C) NGINX, Inc.
+
+# Linux capability
+
+nxt_feature="Linux capability"
+nxt_feature_name=NXT_HAVE_LINUX_CAPABILITY
+nxt_feature_test="#include <linux/capability.h>
+ #include <unistd.h>
+ #include <sys/syscall.h>
+
+ int main() {
+ struct __user_cap_header_struct hdr;
+ hdr.version = _LINUX_CAPABILITY_VERSION;
+ syscall(SYS_capget, &hdr, 0);
+ return 0;
+ }"
+. auto/feature
diff --git a/auto/isolation b/auto/isolation
new file mode 100644
index 00000000..c26a4991
--- /dev/null
+++ b/auto/isolation
@@ -0,0 +1,52 @@
+# Copyright (C) Igor Sysoev
+# Copyright (C) NGINX, Inc.
+
+# Linux clone syscall.
+
+NXT_ISOLATION=NO
+NXT_HAVE_CLONE=NO
+
+nsflags="USER NS PID NET UTS CGROUP"
+
+nxt_feature="clone(2)"
+nxt_feature_name=NXT_HAVE_CLONE
+nxt_feature_run=no
+nxt_feature_incs=
+nxt_feature_libs=
+nxt_feature_test="#include <sys/wait.h>
+ #include <sys/syscall.h>
+
+ int main() {
+ return __NR_clone | SIGCHLD;
+ }"
+. auto/feature
+
+if [ $nxt_found = yes ]; then
+ NXT_HAVE_CLONE=YES
+
+ # Test all isolation flags
+ for flag in $nsflags; do
+ nxt_feature="CLONE_NEW${flag}"
+ nxt_feature_name=NXT_HAVE_CLONE_NEW${flag}
+ nxt_feature_run=no
+ nxt_feature_incs=
+ nxt_feature_libs=
+ nxt_feature_test="#define _GNU_SOURCE
+ #include <sys/wait.h>
+ #include <sys/syscall.h>
+ #include <sched.h>
+
+ int main() {
+ return CLONE_NEW$flag;
+ }"
+ . auto/feature
+
+ if [ $nxt_found = yes ]; then
+ if [ "$NXT_ISOLATION" = "NO" ]; then
+ NXT_ISOLATION=$flag
+ else
+ NXT_ISOLATION="$NXT_ISOLATION $flag"
+ fi
+ fi
+ done
+fi
diff --git a/auto/modules/java b/auto/modules/java
index 27030da1..24ee4927 100644
--- a/auto/modules/java
+++ b/auto/modules/java
@@ -214,6 +214,7 @@ fi
. ./version
NXT_UNIT_JAR=nginx-unit-jsc-${NXT_JAVA_MODULE}-$NXT_VERSION.jar
+NXT_WS_API_JAR=websocket-api-${NXT_JAVA_MODULE}-$NXT_VERSION.jar
NXT_JAVA_BUILD_CP=$NXT_BUILD_DIR/$NXT_JAVA_MODULE
NXT_JAVA_INSTALL_JARS=
@@ -269,6 +270,7 @@ NXT_JAR_NAMESPACE=org/eclipse/jdt/
. auto/modules/java_get_jar
cat << END >> $NXT_JAVA_JARS
+ "$NXT_WS_API_JAR",
NULL
};
@@ -367,6 +369,112 @@ NXT_JAVA_SRCS=" \
src/java/nginx/unit/SessionAttrProxy.java \
src/java/nginx/unit/Taglib.java \
src/java/nginx/unit/UnitSessionCookieConfig.java \
+ src/java/nginx/unit/websocket/AsyncChannelGroupUtil.java \
+ src/java/nginx/unit/websocket/AsyncChannelWrapper.java \
+ src/java/nginx/unit/websocket/AsyncChannelWrapperNonSecure.java \
+ src/java/nginx/unit/websocket/AsyncChannelWrapperSecure.java \
+ src/java/nginx/unit/websocket/AuthenticationException.java \
+ src/java/nginx/unit/websocket/Authenticator.java \
+ src/java/nginx/unit/websocket/AuthenticatorFactory.java \
+ src/java/nginx/unit/websocket/BackgroundProcess.java \
+ src/java/nginx/unit/websocket/BackgroundProcessManager.java \
+ src/java/nginx/unit/websocket/BasicAuthenticator.java \
+ src/java/nginx/unit/websocket/Constants.java \
+ src/java/nginx/unit/websocket/DecoderEntry.java \
+ src/java/nginx/unit/websocket/DigestAuthenticator.java \
+ src/java/nginx/unit/websocket/FutureToSendHandler.java \
+ src/java/nginx/unit/websocket/MessageHandlerResult.java \
+ src/java/nginx/unit/websocket/MessageHandlerResultType.java \
+ src/java/nginx/unit/websocket/MessagePart.java \
+ src/java/nginx/unit/websocket/PerMessageDeflate.java \
+ src/java/nginx/unit/websocket/ReadBufferOverflowException.java \
+ src/java/nginx/unit/websocket/Transformation.java \
+ src/java/nginx/unit/websocket/TransformationFactory.java \
+ src/java/nginx/unit/websocket/TransformationResult.java \
+ src/java/nginx/unit/websocket/Util.java \
+ src/java/nginx/unit/websocket/WrappedMessageHandler.java \
+ src/java/nginx/unit/websocket/WsContainerProvider.java \
+ src/java/nginx/unit/websocket/WsExtension.java \
+ src/java/nginx/unit/websocket/WsExtensionParameter.java \
+ src/java/nginx/unit/websocket/WsFrameBase.java \
+ src/java/nginx/unit/websocket/WsFrameClient.java \
+ src/java/nginx/unit/websocket/WsHandshakeResponse.java \
+ src/java/nginx/unit/websocket/WsIOException.java \
+ src/java/nginx/unit/websocket/WsPongMessage.java \
+ src/java/nginx/unit/websocket/WsRemoteEndpointAsync.java \
+ src/java/nginx/unit/websocket/WsRemoteEndpointBase.java \
+ src/java/nginx/unit/websocket/WsRemoteEndpointBasic.java \
+ src/java/nginx/unit/websocket/WsRemoteEndpointImplBase.java \
+ src/java/nginx/unit/websocket/WsRemoteEndpointImplClient.java \
+ src/java/nginx/unit/websocket/WsSession.java \
+ src/java/nginx/unit/websocket/WsWebSocketContainer.java \
+ src/java/nginx/unit/websocket/pojo/Constants.java \
+ src/java/nginx/unit/websocket/pojo/PojoEndpointBase.java \
+ src/java/nginx/unit/websocket/pojo/PojoEndpointClient.java \
+ src/java/nginx/unit/websocket/pojo/PojoEndpointServer.java \
+ src/java/nginx/unit/websocket/pojo/PojoMessageHandlerBase.java \
+ src/java/nginx/unit/websocket/pojo/PojoMessageHandlerPartialBase.java \
+ src/java/nginx/unit/websocket/pojo/PojoMessageHandlerPartialBinary.java \
+ src/java/nginx/unit/websocket/pojo/PojoMessageHandlerPartialText.java \
+ src/java/nginx/unit/websocket/pojo/PojoMessageHandlerWholeBase.java \
+ src/java/nginx/unit/websocket/pojo/PojoMessageHandlerWholeBinary.java \
+ src/java/nginx/unit/websocket/pojo/PojoMessageHandlerWholePong.java \
+ src/java/nginx/unit/websocket/pojo/PojoMessageHandlerWholeText.java \
+ src/java/nginx/unit/websocket/pojo/PojoMethodMapping.java \
+ src/java/nginx/unit/websocket/pojo/PojoPathParam.java \
+ src/java/nginx/unit/websocket/pojo/package-info.java \
+ src/java/nginx/unit/websocket/server/Constants.java \
+ src/java/nginx/unit/websocket/server/DefaultServerEndpointConfigurator.java \
+ src/java/nginx/unit/websocket/server/UpgradeUtil.java \
+ src/java/nginx/unit/websocket/server/UriTemplate.java \
+ src/java/nginx/unit/websocket/server/WsContextListener.java \
+ src/java/nginx/unit/websocket/server/WsFilter.java \
+ src/java/nginx/unit/websocket/server/WsHandshakeRequest.java \
+ src/java/nginx/unit/websocket/server/WsHttpUpgradeHandler.java \
+ src/java/nginx/unit/websocket/server/WsMappingResult.java \
+ src/java/nginx/unit/websocket/server/WsPerSessionServerEndpointConfig.java \
+ src/java/nginx/unit/websocket/server/WsRemoteEndpointImplServer.java \
+ src/java/nginx/unit/websocket/server/WsSci.java \
+ src/java/nginx/unit/websocket/server/WsServerContainer.java \
+ src/java/nginx/unit/websocket/server/WsSessionListener.java \
+ src/java/nginx/unit/websocket/server/WsWriteTimeout.java \
+ src/java/nginx/unit/websocket/server/package-info.java \
+"
+
+NXT_JAVA_WS_API_SRCS=" \
+ src/java/javax/websocket/ClientEndpoint.java \
+ src/java/javax/websocket/ClientEndpointConfig.java \
+ src/java/javax/websocket/CloseReason.java \
+ src/java/javax/websocket/ContainerProvider.java \
+ src/java/javax/websocket/DecodeException.java \
+ src/java/javax/websocket/Decoder.java \
+ src/java/javax/websocket/DefaultClientEndpointConfig.java \
+ src/java/javax/websocket/DeploymentException.java \
+ src/java/javax/websocket/EncodeException.java \
+ src/java/javax/websocket/Encoder.java \
+ src/java/javax/websocket/Endpoint.java \
+ src/java/javax/websocket/EndpointConfig.java \
+ src/java/javax/websocket/Extension.java \
+ src/java/javax/websocket/HandshakeResponse.java \
+ src/java/javax/websocket/MessageHandler.java \
+ src/java/javax/websocket/OnClose.java \
+ src/java/javax/websocket/OnError.java \
+ src/java/javax/websocket/OnMessage.java \
+ src/java/javax/websocket/OnOpen.java \
+ src/java/javax/websocket/PongMessage.java \
+ src/java/javax/websocket/RemoteEndpoint.java \
+ src/java/javax/websocket/SendHandler.java \
+ src/java/javax/websocket/SendResult.java \
+ src/java/javax/websocket/Session.java \
+ src/java/javax/websocket/SessionException.java \
+ src/java/javax/websocket/WebSocketContainer.java \
+ src/java/javax/websocket/server/DefaultServerEndpointConfig.java \
+ src/java/javax/websocket/server/HandshakeRequest.java \
+ src/java/javax/websocket/server/PathParam.java \
+ src/java/javax/websocket/server/ServerApplicationConfig.java \
+ src/java/javax/websocket/server/ServerContainer.java \
+ src/java/javax/websocket/server/ServerEndpoint.java \
+ src/java/javax/websocket/server/ServerEndpointConfig.java \
"
cat << END >> $NXT_MAKEFILE
@@ -378,7 +486,8 @@ cat << END >> $NXT_MAKEFILE
all: ${NXT_JAVA_MODULE}
${NXT_JAVA_MODULE}: $NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so \
- $NXT_BUILD_DIR/$NXT_UNIT_JAR
+ $NXT_BUILD_DIR/$NXT_UNIT_JAR \
+ $NXT_BUILD_DIR/$NXT_WS_API_JAR
$NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so: $nxt_objs
\$(NXT_MODULE_LINK) -o $NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so \\
@@ -388,12 +497,15 @@ $NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so: $nxt_objs
install: ${NXT_JAVA_MODULE}-install
${NXT_JAVA_MODULE}-install: $NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so \\
- $NXT_BUILD_DIR/$NXT_UNIT_JAR java-shared-install
+ $NXT_BUILD_DIR/$NXT_UNIT_JAR \\
+ $NXT_BUILD_DIR/$NXT_WS_API_JAR \\
+ java-shared-install
install -d \$(DESTDIR)$NXT_MODULES
install -p $NXT_BUILD_DIR/${NXT_JAVA_MODULE}.unit.so \\
\$(DESTDIR)$NXT_MODULES/
install -d \$(DESTDIR)$NXT_JARS
install -p -m 0644 $NXT_BUILD_DIR/$NXT_UNIT_JAR \$(DESTDIR)$NXT_JARS/
+ install -p -m 0644 $NXT_BUILD_DIR/$NXT_WS_API_JAR \$(DESTDIR)$NXT_JARS/
uninstall: ${NXT_JAVA_MODULE}-uninstall
@@ -402,6 +514,7 @@ ${NXT_JAVA_MODULE}-uninstall: java-shared-uninstall
rm -f \$(DESTDIR)$NXT_MODULES/${NXT_JAVA_MODULE}.unit.so
@rmdir -p \$(DESTDIR)$NXT_MODULES 2>/dev/null || true
rm -f \$(DESTDIR)$NXT_JARS/$NXT_UNIT_JAR
+ rm -f \$(DESTDIR)$NXT_JARS/$NXT_WS_API_JAR
@rmdir -p \$(DESTDIR)$NXT_JARS 2>/dev/null || true
END
@@ -410,14 +523,15 @@ if ! grep ^$NXT_BUILD_DIR/$NXT_UNIT_JAR: $NXT_MAKEFILE 2>&1 > /dev/null; then
cat << END >> $NXT_MAKEFILE
-.INTERMEDIATE: $NXT_BUILD_DIR/$NXT_JAVA_MODULE/.classes
-
NXT_JAVA_SRCS = $NXT_JAVA_SRCS
-$NXT_BUILD_DIR/$NXT_JAVA_MODULE/.classes: \$(NXT_JAVA_SRCS)
- rm -rf $NXT_BUILD_DIR/$NXT_JAVA_MODULE/nginx
- $NXT_JAVAC -d $NXT_BUILD_DIR/$NXT_JAVA_MODULE -cp $NXT_JAVA_BUILD_CP \\
+$NXT_BUILD_DIR/$NXT_JAVA_MODULE/.nginx.unit.classes: \$(NXT_JAVA_SRCS) \\
+ $NXT_BUILD_DIR/$NXT_WS_API_JAR
+ rm -rf $NXT_BUILD_DIR/$NXT_JAVA_MODULE/nginx/unit
+ $NXT_JAVAC -d $NXT_BUILD_DIR/$NXT_JAVA_MODULE \\
+ -cp $NXT_JAVA_BUILD_CP:$NXT_BUILD_DIR/$NXT_WS_API_JAR \\
\$(NXT_JAVA_SRCS)
+ touch \$@
$NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/LICENSE: LICENSE
mkdir -p $NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF
@@ -427,15 +541,49 @@ $NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/NOTICE: NOTICE
mkdir -p $NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF
cp -p NOTICE \$@
-
-$NXT_BUILD_DIR/$NXT_UNIT_JAR: $NXT_BUILD_DIR/$NXT_JAVA_MODULE/.classes \\
+$NXT_BUILD_DIR/$NXT_UNIT_JAR: \\
+ $NXT_BUILD_DIR/$NXT_JAVA_MODULE/.nginx.unit.classes \\
$NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/LICENSE \\
$NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/NOTICE
$NXT_JAVA_HOME/bin/jar c -C $NXT_BUILD_DIR/$NXT_JAVA_MODULE META-INF \\
-C $NXT_BUILD_DIR/$NXT_JAVA_MODULE nginx/unit > \$@
+NXT_JAVA_WS_API_SRCS = $NXT_JAVA_WS_API_SRCS
+
+$NXT_BUILD_DIR/$NXT_JAVA_MODULE/.javax.websocket.classes: \$(NXT_JAVA_WS_API_SRCS)
+ rm -rf $NXT_BUILD_DIR/$NXT_JAVA_MODULE/javax/websocket
+ $NXT_JAVAC -d $NXT_BUILD_DIR/$NXT_JAVA_MODULE -cp $NXT_JAVA_BUILD_CP \\
+ \$(NXT_JAVA_WS_API_SRCS)
+ touch \$@
+
+$NXT_BUILD_DIR/$NXT_WS_API_JAR: \\
+ $NXT_BUILD_DIR/$NXT_JAVA_MODULE/.javax.websocket.classes \\
+ $NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/LICENSE \\
+ $NXT_BUILD_DIR/$NXT_JAVA_MODULE/META-INF/NOTICE
+ $NXT_JAVA_HOME/bin/jar c -C $NXT_BUILD_DIR/$NXT_JAVA_MODULE META-INF \\
+ -C $NXT_BUILD_DIR/$NXT_JAVA_MODULE javax/websocket > \$@
+
END
+NXT_PROPS="\
+ nginx/unit/websocket/LocalStrings.properties \
+ nginx/unit/websocket/pojo/LocalStrings.properties \
+ nginx/unit/websocket/server/LocalStrings.properties \
+"
+
+for nxt_prop in $NXT_PROPS ; do
+
+ cat << END >> $NXT_MAKEFILE
+$NXT_BUILD_DIR/$NXT_JAVA_MODULE/$nxt_prop: src/java/$nxt_prop \\
+ $NXT_BUILD_DIR/$NXT_JAVA_MODULE/.nginx.unit.classes
+ cp src/java/$nxt_prop \$@
+
+$NXT_BUILD_DIR/$NXT_UNIT_JAR: $NXT_BUILD_DIR/$NXT_JAVA_MODULE/$nxt_prop
+
+END
+
+done
+
fi
if ! grep ^java-shared-install: $NXT_MAKEFILE 2>&1 > /dev/null; then
diff --git a/auto/sources b/auto/sources
index 8ac8fb19..c4b3808b 100644
--- a/auto/sources
+++ b/auto/sources
@@ -71,6 +71,7 @@ NXT_LIB_SRCS=" \
src/nxt_upstream_round_robin.c \
src/nxt_http_parse.c \
src/nxt_app_log.c \
+ src/nxt_capability.c \
src/nxt_runtime.c \
src/nxt_conf.c \
src/nxt_conf_validation.c \
@@ -83,6 +84,7 @@ NXT_LIB_SRCS=" \
src/nxt_http_response.c \
src/nxt_http_error.c \
src/nxt_http_route.c \
+ src/nxt_http_static.c \
src/nxt_application.c \
src/nxt_external.c \
src/nxt_port_hash.c \
@@ -132,6 +134,7 @@ NXT_LIB_SOLARIS_SENDFILEV_SRCS="src/nxt_solaris_sendfilev.c"
NXT_LIB_MACOSX_SENDFILE_SRCS="src/nxt_macosx_sendfile.c"
NXT_LIB_AIX_SEND_FILE_SRCS="src/nxt_aix_send_file.c"
NXT_LIB_HPUX_SENDFILE_SRCS="src/nxt_hpux_sendfile.c"
+NXT_LIB_CLONE_SRCS="src/nxt_clone.c"
NXT_TEST_BUILD_DEPS="src/nxt_test_build.h"
NXT_TEST_BUILD_SRCS="src/nxt_test_build.c"
@@ -257,6 +260,11 @@ if [ "$NXT_HAVE_HPUX_SENDFILE" = "YES" \
fi
+if [ "$NXT_HAVE_CLONE" = "YES" ]; then
+ NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_LIB_CLONE_SRCS"
+fi
+
+
if [ "$NXT_TEST_BUILD" = "YES" ]; then
NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_TEST_BUILD_SRCS"
fi
diff --git a/auto/summary b/auto/summary
index 1c9df4b1..59267f6c 100644
--- a/auto/summary
+++ b/auto/summary
@@ -26,6 +26,8 @@ Unit configuration summary:
Unix domain sockets support: $NXT_UNIX_DOMAIN
TLS support: ............... $NXT_OPENSSL
+ process isolation: ......... $NXT_ISOLATION
+
debug logging: ............. $NXT_DEBUG
END