From efbcd517fc9ec1ef5a6dfe85cb79bf0a57b954c5 Mon Sep 17 00:00:00 2001 From: Max Romanov Date: Tue, 17 Mar 2020 14:44:06 +0300 Subject: Checking sendfile() availability in configure. Removing SF_NODISKIO flag for FreeBSD sendfile() check because it is not used yet and to support DragonFlyBSD. This closes #414 issue on GitHub. --- auto/sendfile | 56 ++++++++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 24 deletions(-) (limited to 'auto') diff --git a/auto/sendfile b/auto/sendfile index e5bf3b79..a065f7b6 100644 --- a/auto/sendfile +++ b/auto/sendfile @@ -46,7 +46,7 @@ if [ $nxt_found = no ]; then int main() { off_t sent; - sendfile(-1, -1, 0, 0, NULL, &sent, SF_NODISKIO); + sendfile(-1, -1, 0, 0, NULL, &sent, 0); return 0; }" . auto/feature @@ -57,55 +57,63 @@ if [ $nxt_found = no ]; then fi -NXT_LIBSENDFILE= - if [ $nxt_found = no ]; then - # Solaris 8 sendfilev(). + # MacOSX sendfile(). - nxt_feature="Solaris sendfilev()" - nxt_feature_name=NXT_HAVE_SOLARIS_SENDFILEV - nxt_feature_libs="-lsendfile" - nxt_feature_test="#include + nxt_feature="MacOSX sendfile()" + nxt_feature_name=NXT_HAVE_MACOSX_SENDFILE + nxt_feature_libs= + nxt_feature_test="#include + #include + #include + #include int main() { - size_t sent; - struct sendfilevec vec; + off_t sent; - sendfilev(-1, &vec, 0, &sent); + sendfile(-1, -1, 0, &sent, NULL, 0); return 0; }" . auto/feature if [ $nxt_found = yes ]; then - NXT_HAVE_SOLARIS_SENDFILEV=YES - NXT_LIBSENDFILE=$nxt_feature_libs + NXT_HAVE_MACOSX_SENDFILE=YES fi fi if [ $nxt_found = no ]; then + $echo + $echo "$0: error: no supported sendfile() found." + $echo + exit 1; +fi - # MacOSX sendfile(). - nxt_feature="MacOSX sendfile()" - nxt_feature_name=NXT_HAVE_MACOSX_SENDFILE - nxt_feature_libs= - nxt_feature_test="#include - #include - #include - #include +NXT_LIBSENDFILE= + +if [ $nxt_found = no ]; then + + # Solaris 8 sendfilev(). + + nxt_feature="Solaris sendfilev()" + nxt_feature_name=NXT_HAVE_SOLARIS_SENDFILEV + nxt_feature_libs="-lsendfile" + nxt_feature_test="#include int main() { - off_t sent; + size_t sent; + struct sendfilevec vec; - sendfile(-1, -1, 0, &sent, NULL, 0); + sendfilev(-1, &vec, 0, &sent); return 0; }" . auto/feature if [ $nxt_found = yes ]; then - NXT_HAVE_MACOSX_SENDFILE=YES + NXT_HAVE_SOLARIS_SENDFILEV=YES + NXT_LIBSENDFILE=$nxt_feature_libs fi fi -- cgit From 8d727774e3a2b2eaf194781c382fb953ed61f755 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Fri, 27 Mar 2020 17:22:52 +0300 Subject: Implemented "return" action. The "return" action can be used to immediately generate a simple HTTP response with an arbitrary status: { "action": { "return": 404 } } This is especially useful for denying access to specific resources. --- auto/sources | 1 + 1 file changed, 1 insertion(+) (limited to 'auto') diff --git a/auto/sources b/auto/sources index 2283e543..c6b34bbc 100644 --- a/auto/sources +++ b/auto/sources @@ -87,6 +87,7 @@ NXT_LIB_SRCS=" \ src/nxt_http_error.c \ src/nxt_http_route.c \ src/nxt_http_route_addr.c \ + src/nxt_http_return.c \ src/nxt_http_static.c \ src/nxt_http_proxy.c \ src/nxt_application.c \ -- cgit