From c8d9106a0d3217c385f6afe572d904d9d77b8c8b Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sun, 19 Jun 2022 14:20:05 +0200 Subject: Removed code used when NXT_HAVE_POSIX_SPAWN is false. posix_spawn(3POSIX) was introduced by POSIX.1d (IEEE Std 1003.1d-1999), and was later consolidated in POSIX.1-2001, requiring it in all POSIX-compliant systems. It's safe to assume it's always available, more than 20 years after its standardization. Link: --- auto/unix | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'auto') diff --git a/auto/unix b/auto/unix index 7c241650..45c6a139 100644 --- a/auto/unix +++ b/auto/unix @@ -178,21 +178,6 @@ if [ $nxt_found = no ]; then fi -nxt_feature="posix_spawn()" -nxt_feature_name=NXT_HAVE_POSIX_SPAWN -nxt_feature_run= -nxt_feature_incs= -nxt_feature_libs= -nxt_feature_test="#include - #include - - int main(int argc, char *argv[]) { - (void) posix_spawn(NULL, \"\", NULL, NULL, argv, NULL); - return 0; - }" -. auto/feature - - # NetBSD 1.0, OpenBSD 1.0, FreeBSD 2.2 setproctitle(). nxt_feature="setproctitle()" -- cgit From 0d15cbd5b6136d8a92a23895bd83eb322aa633ea Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sun, 19 Jun 2022 16:55:14 +0200 Subject: Removed unnecessary include. Some OSes, as Linux, provide FIONBIO in . Others, such as the BSDs and Illumos, provide it in , but they all include that header from , so for this test, we can simplify and just include . --- auto/sockets | 7 ------- 1 file changed, 7 deletions(-) (limited to 'auto') diff --git a/auto/sockets b/auto/sockets index e6ef326d..e344a3db 100644 --- a/auto/sockets +++ b/auto/sockets @@ -225,12 +225,6 @@ nxt_feature_test="#include }" . auto/feature -if [ $nxt_found = yes ]; then - NXT_SYS_FILIO_H="#include " -else - NXT_SYS_FILIO_H= -fi - nxt_feature="ioctl(FIONBIO)" nxt_feature_name=NXT_HAVE_FIONBIO @@ -239,7 +233,6 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include #include - $NXT_SYS_FILIO_H #include int main() { -- cgit From 5015b05fc495bf3e87f8decfd1617a4a399939d4 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sat, 18 Jun 2022 15:59:12 +0200 Subject: Replaced Linux syscall macros by libc macros. User-space programs should use the SYS_*form, as documented in syscall(2). That also adds compatibility to non-Linux systems. --- auto/isolation | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'auto') diff --git a/auto/isolation b/auto/isolation index fd35f8ed..4ade6a38 100644 --- a/auto/isolation +++ b/auto/isolation @@ -21,7 +21,7 @@ nxt_feature_test="#include #include int main() { - return __NR_clone | SIGCHLD; + return SYS_clone | SIGCHLD; }" . auto/feature @@ -68,7 +68,7 @@ nxt_feature_libs= nxt_feature_test="#include int main() { - return __NR_pivot_root; + return SYS_pivot_root; }" . auto/feature -- cgit From 8761501b4845656a0f2e5c0e7bf98f948c45fb5f Mon Sep 17 00:00:00 2001 From: Zhidao HONG Date: Thu, 14 Jul 2022 11:14:20 +0800 Subject: Log: split access log from nxt_router.c. No functional changes. --- auto/sources | 1 + 1 file changed, 1 insertion(+) (limited to 'auto') diff --git a/auto/sources b/auto/sources index 27a45edc..65a83f45 100644 --- a/auto/sources +++ b/auto/sources @@ -84,6 +84,7 @@ NXT_LIB_SRCS=" \ src/nxt_signal_handlers.c \ src/nxt_controller.c \ src/nxt_router.c \ + src/nxt_router_access_log.c \ src/nxt_h1proto.c \ src/nxt_http_request.c \ src/nxt_http_response.c \ -- cgit From 2c0888f69c247c82fc02ba207aa19fa00acf4b5e Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sun, 19 Jun 2022 12:48:01 +0200 Subject: Including iff it exists. With NXT_HAVE_PIVOT_ROOT, we had issues in MacOS. Headers should normally be included unconditionally, except of course if they don't exist. This fixes part of the #737 issue on GitHub. --- auto/isolation | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'auto') diff --git a/auto/isolation b/auto/isolation index 4ade6a38..6debdc3b 100644 --- a/auto/isolation +++ b/auto/isolation @@ -73,6 +73,19 @@ nxt_feature_test="#include . auto/feature +nxt_feature="" +nxt_feature_name=NXT_HAVE_MNTENT_H +nxt_feature_run=no +nxt_feature_incs= +nxt_feature_libs= +nxt_feature_test="#include + + int main(void) { + return 0; + }" +. auto/feature + + nxt_feature="prctl(PR_SET_NO_NEW_PRIVS)" nxt_feature_name=NXT_HAVE_PR_SET_NO_NEW_PRIVS0 nxt_feature_run=no -- cgit From 418bc208d08dbc4a0a3511e503c946ab6ac71c39 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Tue, 2 Aug 2022 19:39:55 +0200 Subject: Rejecting non-Linux pivot_root(2). Some non-Linux systems implement pivot_root(2), even if they don't document that. An example is MacOS: $ grepc pivot_root / 2>/dev/null .../sys/sysproto.h:3012: int pivot_root(struct proc *, struct pivot_root_args *, int *); Since the prototype of the syscall differs from that of Linux, we can't use that syscall. Let's make sure the test only detects pivot_root(2) under Linux. Also, rename the feature macro to make clear that it's only about Linux's pivot_root(2). This closes #737 issue on GitHub. --- auto/isolation | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'auto') diff --git a/auto/isolation b/auto/isolation index 6debdc3b..384f7ef1 100644 --- a/auto/isolation +++ b/auto/isolation @@ -61,11 +61,14 @@ fi nxt_feature="Linux pivot_root()" -nxt_feature_name=NXT_HAVE_PIVOT_ROOT +nxt_feature_name=NXT_HAVE_LINUX_PIVOT_ROOT nxt_feature_run=no nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include + #if !defined(__linux__) + # error + #endif int main() { return SYS_pivot_root; -- cgit From 22c510066686d4f5c8cecfeb54c0b958b5f5bb3f Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 3 Aug 2022 14:42:49 +0200 Subject: Removed dead code. nxt_sockaddr_ntop() stopped being used in commit (git) 029942f4eb71. It has been replaced mostly by nxt_sockaddr_text(). commit 029942f4eb7196c2cff0d0e26bc6ff274138f7d8 Author: Igor Sysoev Date: Wed Feb 22 15:09:59 2017 +0300 I/O operations refactoring. nxt_job_sockaddr_parse() stopped being used in commit (git) 794248090a74. commit 794248090a74f31cbfcf24ea8c835df2d4d21073 Author: Igor Sysoev Date: Wed Mar 4 14:04:08 2020 +0300 Legacy upstream code removed. Also, remove functions and types used only by those two functions: nxt_job_sockaddr_unix_parse() nxt_job_sockaddr_inet6_parse() nxt_job_sockaddr_inet_parse() nxt_job_sockaddr_parse_t nxt_job_resolve() nxt_job_resolve_t --- auto/sources | 1 - 1 file changed, 1 deletion(-) (limited to 'auto') diff --git a/auto/sources b/auto/sources index 65a83f45..560f3bf3 100644 --- a/auto/sources +++ b/auto/sources @@ -69,7 +69,6 @@ NXT_LIB_SRCS=" \ src/nxt_event_conn_job_sendfile.c \ src/nxt_conn_proxy.c \ src/nxt_job.c \ - src/nxt_job_resolve.c \ src/nxt_sockaddr.c \ src/nxt_listen_socket.c \ src/nxt_upstream.c \ -- cgit From ce26dd729e6842c9ec8cc83bf091167e4c50a1ec Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Mon, 29 Aug 2022 14:27:09 +0800 Subject: Implemented basic statistics API. --- auto/sources | 1 + 1 file changed, 1 insertion(+) (limited to 'auto') diff --git a/auto/sources b/auto/sources index 560f3bf3..8548f812 100644 --- a/auto/sources +++ b/auto/sources @@ -85,6 +85,7 @@ NXT_LIB_SRCS=" \ src/nxt_router.c \ src/nxt_router_access_log.c \ src/nxt_h1proto.c \ + src/nxt_status.c \ src/nxt_http_request.c \ src/nxt_http_response.c \ src/nxt_http_error.c \ -- cgit